/-- Variation of `extend_eq` where we ask that `f` has a limit along `comap i (𝓝 b)` for each
`b : β`. This is a strictly stronger assumption than continuity of `f`, but in a lot of cases
you'd have to prove it anyway to use `continuous_extend`, so this avoids doing the work twice. -/
theorem extend_eq' [T2Space γ] {f : α → γ} (di : DenseInducing i)
    (hf : ∀ b, ∃ c, Tendsto f (comap i (𝓝 b)) (𝓝 c)) (a : α) : di.extend f (i a) = f a

(hf : ∀ (b : β), ∃ c, Filter.Tendsto f (Filter.comap i (𝓝 b)) (𝓝 c))


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


theorem hasBasis_biInf_of_directed' {ι : Type*} {ι' : ι → Sort _} {dom : Set ι}
    (hdom : dom.Nonempty) {l : ι → Filter α} (s : ∀ i, ι' i → Set α) (p : ∀ i, ι' i → Prop)
    (hl : ∀ i ∈ dom, (l i).HasBasis (p i) (s i)) (h : DirectedOn (l ⁻¹'o GE.ge) dom) :
    (⨅ i ∈ dom, l i).HasBasis (fun ii' : Σi, ι' i => ii'.1 ∈ dom ∧ p ii'.1 ii'.2) fun ii' =>
      s ii'.1 ii'.2

(⨅ i ∈ dom, l i).HasBasis (fun ii' => ii'.fst ∈ dom ∧ p ii'.fst ii'.snd) fun ii' => s ii'.fst ii'.snd


@[simp]
theorem eigenspace_zero (f : End R M) : f.eigenspace 0 = LinearMap.ker f

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
(f : Module.End R M)


/-- Taking the product under `h` is an additive-to-multiplicative homomorphism of finsupps,
if `h` is an additive-to-multiplicative homomorphism on the support.
This is a more general version of `Finsupp.prod_add_index'`; the latter has simpler hypotheses. -/
@[to_additive
      "Taking the product under `h` is an additive homomorphism of finsupps,  if `h` is an
      additive homomorphism on the support. This is a more general version of
      `Finsupp.sum_add_index'`; the latter has simpler hypotheses."]
theorem prod_add_index [DecidableEq α] [AddZeroClass M] [CommMonoid N] {f g : α →₀ M}
    {h : α → M → N} (h_zero : ∀ a ∈ f.support ∪ g.support, h a 0 = 1)
    (h_add : ∀ a ∈ f.support ∪ g.support, ∀ (b₁ b₂), h a (b₁ + b₂) = h a b₁ * h a b₂) :
    (f + g).prod h = f.prod h * g.prod h

(h_zero : ∀ a ∈ f.support ∪ g.support, h a 0 = 0)

(h_add : ∀ a ∈ f.support ∪ g.support, ∀ (b₁ b₂ : M), h a (b₁ + b₂) = h a b₁ + h a b₂)


@[simp] theorem Proj.zero_apply : (0 : (Proj.structureSheaf 𝒜).1.obj V).1 x = 0

{V : (TopologicalSpace.Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ}


@[simp]
theorem length_sublists (l : List α) : length (sublists l) = 2 ^ length l


theorem IsEulerian.edgesFinset_eq [Fintype G.edgeSet] {u v : V} {p : G.Walk u v}
    (h : p.IsEulerian) : h.isTrail.edgesFinset = G.edgeFinset

{V : Type u_1}
{G : SimpleGraph V}
[DecidableEq V]
[Fintype ↑G.edgeSet]
{u v : V}
{p : G.Walk u v}
(h : p.IsEulerian)


@[to_additive]
theorem image_smul : (s.image fun x => a • x) = a • s

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[SMul α β]
{s : Finset β}
{a : α}


theorem Multiset.mem_sup_map_support_iff [Zero M] {s : Multiset (ι →₀ M)} {x : ι} :
    x ∈ (s.map Finsupp.support).sup ↔ ∃ f ∈ s, x ∈ f.support

{ι : Type u_1}
{M : Type u_2}
[DecidableEq ι]
[Zero M]
{s : Multiset (ι →₀ M)}
{x : ι}

x ∈ (Multiset.map Finsupp.support s).sup ↔ ∃ f ∈ s, x ∈ f.support


@[simp]
theorem right_vsub_lineMap (p₀ p₁ : P1) (c : k) : p₁ -ᵥ lineMap p₀ p₁ c = (1 - c) • (p₁ -ᵥ p₀)

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
(p₀ p₁ : P1)
(c : k)

p₁ -ᵥ (AffineMap.lineMap p₀ p₁) c = (1 - c) • (p₁ -ᵥ p₀)


theorem lift_lift_same_le_lift {g : Set α → Set α → Filter β} :
    (f.lift fun s => f.lift (g s)) ≤ f.lift fun s => g s s

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{g : Set α → Set α → Filter β}


/-- Group homomorphisms preserve division. -/
@[to_additive "Additive group homomorphisms preserve subtraction."]
protected theorem map_div [Group α] [DivisionMonoid β] (f : α →* β) (g h : α) :
    f (g / h) = f g / f h

{α : Type u_2}
{β : Type u_3}
[AddGroup α]
[SubtractionMonoid β]
(f : α →+ β)
(g h : α)


@[simp]
theorem map_nil {β : Type*} (f : α → β) : map f nil = nil

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


theorem prod_snd_fst : Pi.prod (Prod.snd : α × β → β) (Prod.fst : α × β → α) = Prod.swap


@[simp]
nonrec theorem zero_iff_nonpos : smoothTransition x = 0 ↔ x ≤ 0


theorem map_normalClosure (s : Set G) (f : G →* N) (hf : Surjective f) :
    (normalClosure s).map f = normalClosure (f '' s)

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(s : Set G)
(f : G →* N)
(hf : Function.Surjective ⇑f)

Subgroup.map f (Subgroup.normalClosure s) = Subgroup.normalClosure (⇑f '' s)


@[simp]
theorem conjTranspose_eq_one [DecidableEq n] [Semiring α] [StarRing α] {M : Matrix n n α} :
    Mᴴ = 1 ↔ M = 1

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Semiring α]
[StarRing α]
{M : Matrix n n α}


@[trans]
theorem fuzzy_of_fuzzy_of_equiv {x y z : PGame} (h₁ : x ‖ y) (h₂ : y ≈ z) : x ‖ z

{x y z : SetTheory.PGame}
(h₁ : x.Fuzzy y)
(h₂ : y ≈ z)


/-- A *⋆-ring* equivalence is an equivalence preserving addition, multiplication, and the star
operation, which allows for considering both unital and non-unital equivalences with a single
structure. -/
structure StarRingEquiv (A B : Type*) [Add A] [Add B] [Mul A] [Mul B] [Star A] [Star B]
    extends A ≃+* B where
  /-- By definition, a ⋆-ring equivalence preserves the `star` operation. -/
  map_star' : ∀ a : A, toFun (star a) = star (toFun a)

{A : Type u_1}
{B : Type u_2}
[Add A]
[Add B]
[Mul A]
[Mul B]
[Star A]
[Star B]
(self : A ≃⋆+* B)
(a : A)

self.toFun (star a) = star (self.toFun a)


theorem WCovBy.covBy_of_lt (h : a ⩿ b) (h2 : a < b) : a ⋖ b

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


theorem maximum_ne_bot_of_length_pos (h : 0 < l.length) : l.maximum ≠ ⊥

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


protected theorem lt_neg_add_of_add_lt {a b c : Int} (h : a + b < c) : b < -a + c


/-- Functional equation for the even Hurwitz zeta function. -/
lemma completedHurwitzZetaEven_one_sub (a : UnitAddCircle) (s : ℂ) :
    completedHurwitzZetaEven a (1 - s) = completedCosZeta a s

HurwitzZeta.completedHurwitzZetaEven a (1 - s) = HurwitzZeta.completedCosZeta a s


theorem theory_model_iff (h : M ≅[L] N) : M ⊨ T ↔ N ⊨ T

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{T : L.Theory}
(h : L.ElementarilyEquivalent M N)


{R : Type u_1}
{M : Type u_9}
{M₂ : Type u_11}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
(fₗ : M →ₗ[R] M₂)


@[simp]
theorem offDiag_univ : (univ : Set α).offDiag = (diagonal α)ᶜ


@[reassoc (attr := simp)]
lemma isoHomologyπ_hom_inv_id :
    K.homologyπ j ≫ (K.isoHomologyπ i j hi h).inv = 𝟙 _

K.homologyπ j ≫ (K.isoHomologyπ i j hi h).inv = 𝟙 (K.cycles j)


theorem Int.coe_nat_two_pow_pred (p : ℕ) : ((2 ^ p - 1 : ℕ) : ℤ) = (2 ^ p - 1 : ℤ)


lemma exact_iff :
    Exact f g ↔ LinearMap.ker g = LinearMap.range f

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{P : Type u_6}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
{f : M →ₗ[R] N}
{g : N →ₗ[R] P}

Function.Exact ⇑f ⇑g ↔ LinearMap.ker g = LinearMap.range f


lemma coyonedaEquiv_comp {X : C} {F G : C ⥤ Type v₁} (α : coyoneda.obj (op X) ⟶ F) (β : F ⟶ G) :
    coyonedaEquiv (α ≫ β) = β.app _ (coyonedaEquiv α)

{F G : CategoryTheory.Functor C (Type v₁)}

(α : CategoryTheory.coyoneda.obj (Opposite.op X) ⟶ F)

CategoryTheory.coyonedaEquiv (CategoryTheory.CategoryStruct.comp α β) = β.app X (CategoryTheory.coyonedaEquiv α)


theorem equivFun_symm_stdBasis [Finite n] (b : Basis n R M) (i : n) :
    b.equivFun.symm (LinearMap.stdBasis R (fun _ => R) i 1) = b i

{R : Type u_1}
{M : Type u_2}
{n : Type u_3}
[DecidableEq n]
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Finite n]
(b : Basis n R M)
(i : n)

b.equivFun.symm ((LinearMap.stdBasis R (fun x => R) i) 1) = b i


theorem Sigma.isConnected_iff [∀ i, TopologicalSpace (π i)] {s : Set (Σi, π i)} :
    IsConnected s ↔ ∃ i t, IsConnected t ∧ s = Sigma.mk i '' t

{ι : Type u_1}
{π : ι → Type u_2}
[(i : ι) → TopologicalSpace (π i)]
{s : Set ((i : ι) × π i)}


@[simp]
theorem mem_bipartiteAbove {b : β} : b ∈ t.bipartiteAbove r a ↔ b ∈ t ∧ r a b

{α : Type u_1}
{β : Type u_2}
(r : α → β → Prop)
{t : Finset β}
{a : α}
[DecidablePred (r a)]
{b : β}

b ∈ Finset.bipartiteAbove r t a ↔ b ∈ t ∧ r a b


theorem monic_expand_iff {p : ℕ} {f : R[X]} (hp : 0 < p) : (expand R p f).Monic ↔ f.Monic

{R : Type u}
[CommSemiring R]
{p : ℕ}
{f : R[X]}
(hp : 0 < p)

((Polynomial.expand R p) f).Monic ↔ f.Monic


lemma d₁_eq_zero (h : ¬ c₁.Rel i₁ (c₁.next i₁)) :
    K.d₁ c₁₂ i₁ i₂ i₁₂ = 0

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Preadditive C]
{I₁ : Type u_2}
{I₂ : Type u_3}
{I₁₂ : Type u_4}
{c₁ : ComplexShape I₁}
{c₂ : ComplexShape I₂}
(K : HomologicalComplex₂ C c₁ c₂)
(c₁₂ : ComplexShape I₁₂)
[DecidableEq I₁₂]
[TotalComplexShape c₁ c₂ c₁₂]
[K.HasTotal c₁₂]
(i₁ : I₁)
(i₂ : I₂)
(i₁₂ : I₁₂)
(h : ¬c₁.Rel i₁ (c₁.next i₁))


theorem totient_eq_one_iff : ∀ {n : ℕ}, n.totient = 1 ↔ n = 1 ∨ n = 2


/-- Bijection between a subring `S` and `MulOpposite` of its opposite. -/
@[simps!]
def ringEquivOpMop (S : Subring R) : S ≃+* (S.op)ᵐᵒᵖ

∀ (a : (↥S.op)ᵐᵒᵖ), ↑(S.ringEquivOpMop.symm a) = MulOpposite.unop ↑(MulOpposite.unop a)


@[simp]
theorem image_sup_prod (s t : Set α) : Set.image2 (· ⊔ ·) s t = s ⊻ t

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

Set.image2 (fun x x_1 => x ⊔ x_1) s t = s ⊻ t


theorem degreeLE_eq_span_X_pow [DecidableEq R] {n : ℕ} :
    degreeLE R n = Submodule.span R ↑((Finset.range (n + 1)).image fun n => (X : R[X]) ^ n)

{R : Type u}
[Semiring R]
[DecidableEq R]
{n : ℕ}

Polynomial.degreeLE R ↑n = Submodule.span R ↑(Finset.image (fun n => Polynomial.X ^ n) (Finset.range (n + 1)))


theorem pos_pow_of_pos {n : Nat} (m : Nat) (h : 0 < n) : 0 < n^m


protected theorem id_traverse (x : t' α) : Equiv.traverse eqv (pure : α → Id α) x = x

{t t' : Type u → Type u}
(eqv : (α : Type u) → t α ≃ t' α)
[Traversable t]
[LawfulTraversable t]
{α : Type u}
(x : t' α)


theorem sin_add : sin (x + y) = sin x * cos y + cos x * sin y

Complex.sin (x + y) = Complex.sin x * Complex.cos y + Complex.cos x * Complex.sin y


/-- `repr` preserves zero, up to multiples of `f` -/
theorem repr_zero_mem_span (h : IsAdjoinRoot S f) : h.repr 0 ∈ Ideal.span ({f} : Set R[X])

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRoot S f)


theorem toArrayLit_eq (as : Array α) (n : Nat) (hsz : as.size = n) : as = toArrayLit as n hsz

{α : Type u_1}
(as : Array α)
(n : Nat)
(hsz : as.size = n)
(i : Nat)
(hi : i ≤ as.size)

as.toListLitAux n hsz i hi (List.drop i as.data) = as.data


/-- The equivalence between `C` and its monoidal opposite's monoidal opposite. -/
@[simps!] def MonoidalOpposite.mopMopEquivalence : Cᴹᵒᵖᴹᵒᵖ ≌ C

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

(CategoryTheory.MonoidalOpposite.mopMopEquivalence C).functor.obj X = X.unmop.unmop


@[to_additive]
lemma units_iInf {ι : Sort*} (f : ι → Submonoid M) : (iInf f).units = ⨅ (i : ι), (f i).units

{M : Type u_1}
[Monoid M]
{ι : Sort u_2}
(f : ι → Submonoid M)


lemma eval_polynomialZ (P : Fin 3 → R) : eval P W.polynomialZ =
    P y ^ 2 + W.a₁ * P x * P y + 2 * W.a₃ * P y * P z
      - (W.a₂ * P x ^ 2 + 2 * W.a₄ * P x * P z + 3 * W.a₆ * P z ^ 2)

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Projective R)
(P : Fin 3 → R)

(MvPolynomial.eval P) W.polynomialZ =
  P 1 ^ 2 + W.a₁ * P 0 * P 1 + 2 * W.a₃ * P 1 * P 2 - (W.a₂ * P 0 ^ 2 + 2 * W.a₄ * P 0 * P 2 + 3 * W.a₆ * P 2 ^ 2)


theorem hasFTaylorSeriesUpToOn_top_iff :
    HasFTaylorSeriesUpToOn ∞ f p s ↔ ∀ n : ℕ, HasFTaylorSeriesUpToOn n f p s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{p : E → FormalMultilinearSeries 𝕜 E F}

HasFTaylorSeriesUpToOn ⊤ f p s ↔ ∀ (n : ℕ), HasFTaylorSeriesUpToOn (↑n) f p s


protected theorem Antitone.Ioo (hf : Antitone f) (hg : Monotone g) :
    Monotone fun x => Ioo (f x) (g x)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f g : α → β}
(hf : Antitone f)
(hg : Monotone g)


/-- A structure carrying a diagram of cones over the functors `F.obj j`.
-/
structure DiagramOfCones where
  /-- For each object, a cone. -/
  obj : ∀ j : J, Cone (F.obj j)
  /-- For each map, a map of cones. -/
  map : ∀ {j j' : J} (f : j ⟶ j'), (Cones.postcompose (F.map f)).obj (obj j) ⟶ obj j'
  id : ∀ j : J, (map (𝟙 j)).hom = 𝟙 _ := by aesop_cat
  comp : ∀ {j₁ j₂ j₃ : J} (f : j₁ ⟶ j₂) (g : j₂ ⟶ j₃),
    (map (f ≫ g)).hom = (map f).hom ≫ (map g).hom := by aesop_cat

(self : CategoryTheory.Limits.DiagramOfCones F)

(self.map (f ≫ g)).hom = (self.map f).hom ≫ (self.map g).hom


theorem map₂Right'_nil_cons : map₂Right' f [] (b :: bs) = (f none b :: bs.map (f none), [])

{α : Type u}
{β : Type v}
{γ : Type w}
(f : Option α → β → γ)
(b : β)
(bs : List β)

List.map₂Right' f [] (b :: bs) = (f none b :: List.map (f none) bs, [])


lemma IsLocallyFiniteMeasure.withDensity_ofReal {f : α → ℝ} (hf : Continuous f) :
    IsLocallyFiniteMeasure (μ.withDensity fun x ↦ .ofReal (f x))

MeasureTheory.IsLocallyFiniteMeasure (μ.withDensity fun x => ENNReal.ofReal (f x))


/-- Bessel's inequality for finite sums. -/
theorem Orthonormal.sum_inner_products_le {s : Finset ι} (hv : Orthonormal 𝕜 v) :
    ∑ i ∈ s, ‖⟪v i, x⟫‖ ^ 2 ≤ ‖x‖ ^ 2

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


/-- Induct on two `EReal`s by performing case splits on the sign of one whenever the other is
infinite. This version eliminates some cases by assuming that the relation is symmetric. -/
@[elab_as_elim]
theorem induction₂_symm {P : EReal → EReal → Prop} (symm : ∀ {x y}, P x y → P y x)
    (top_top : P ⊤ ⊤) (top_pos : ∀ x : ℝ, 0 < x → P ⊤ x) (top_zero : P ⊤ 0)
    (top_neg : ∀ x : ℝ, x < 0 → P ⊤ x) (top_bot : P ⊤ ⊥) (pos_bot : ∀ x : ℝ, 0 < x → P x ⊥)
    (coe_coe : ∀ x y : ℝ, P x y) (zero_bot : P 0 ⊥) (neg_bot : ∀ x : ℝ, x < 0 → P x ⊥)
    (bot_bot : P ⊥ ⊥) : ∀ x y, P x y

{P : EReal → EReal → Prop}
(symm : ∀ {x y : EReal}, P x y → P y x)
(top_top : P ⊤ ⊤)
(top_pos : ∀ (x : ℝ), 0 < x → P ⊤ ↑x)
(top_zero : P ⊤ 0)
(top_neg : ∀ x < 0, P ⊤ ↑x)
(top_bot : P ⊤ ⊥)
(pos_bot : ∀ (x : ℝ), 0 < x → P ↑x ⊥)
(coe_coe : ∀ (x y : ℝ), P ↑x ↑y)
(zero_bot : P 0 ⊥)
(neg_bot : ∀ x < 0, P ↑x ⊥)
(bot_bot : P ⊥ ⊥)
(x y : EReal)


@[to_additive]
theorem IsUpperSet.div_left (ht : IsUpperSet t) : IsLowerSet (s / t)

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


@[simp, rclike_simps]
theorem imLm_coe : (imLm : K → ℝ) = im


/-- If the products `W ⨯ X` and `Y ⨯ Z` exist, then every pair of isomorphisms `f : W ≅ Y` and
    `g : X ≅ Z` induces an isomorphism `prod.mapIso f g : W ⨯ X ≅ Y ⨯ Z`. -/
@[simps]
def prod.mapIso {W X Y Z : C} [HasBinaryProduct W X] [HasBinaryProduct Y Z] (f : W ≅ Y)
    (g : X ≅ Z) : W ⨯ X ≅ Y ⨯ Z

(CategoryTheory.Limits.prod.mapIso f g).inv = CategoryTheory.Limits.prod.map f.inv g.inv


@[simp] theorem erase_nil [BEq α] (a : α) : [].erase a = []


@[to_additive]
theorem exponent_min' (n : ℕ) (hpos : 0 < n) (hG : ∀ g : G, g ^ n = 1) : exponent G ≤ n

{G : Type u}
[AddMonoid G]
(n : ℕ)
(hpos : 0 < n)
(hG : ∀ (g : G), n • g = 0)


@[simp] lemma den_pos (q : ℚ≥0) : 0 < q.den


theorem to_re {p : α → Prop} (hp : ComputablePred p) : RePred p

{α : Type u_1}
[Primcodable α]
{p : α → Prop}
(hp : ComputablePred p)


@[simp]
theorem floor_int : (Int.floor : ℤ → ℤ) = id


theorem isOpen_iff (U : Set (PrimeSpectrum R)) : IsOpen U ↔ ∃ s, Uᶜ = zeroLocus s

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

IsOpen U ↔ ∃ s, Uᶜ = PrimeSpectrum.zeroLocus s


@[simp]
theorem functorPushforward_id (R : Sieve X) : R.functorPushforward (𝟭 _) = R

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

CategoryTheory.Sieve.functorPushforward (CategoryTheory.Functor.id C) R = R


@[simp]
theorem count_lt_count_succ_iff {n : ℕ} : count p n < count p (n + 1) ↔ p n

{p : ℕ → Prop}
[DecidablePred p]
{n : ℕ}

Nat.count p n < Nat.count p (n + 1) ↔ p n


@[simp]
protected theorem sub_iff_right :
    a₂ ≡ b₂ [PMOD p] → (a₁ - a₂ ≡ b₁ - b₂ [PMOD p] ↔ a₁ ≡ b₁ [PMOD p])

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


/-- Restriction of a function to a function on subtypes. -/
@[simps]
def map {p : α → Prop} {q : β → Prop} (f : α → β) (h : ∀ a, p a → q (f a)) :
    Subtype p → Subtype q

{α : Sort u_1}
{β : Sort u_2}
{p : α → Prop}
{q : β → Prop}
(f : α → β)
(h : ∀ (a : α), p a → q (f a))

∀ (a : Subtype p), ↑(Subtype.map f h a) = f ↑a


theorem toLp_compMeasurePreserving {g : β → E} (hg : Memℒp g p μb) (hf : MeasurePreserving f μ μb) :
    compMeasurePreserving f hf (hg.toLp g) = (hg.comp_measurePreserving hf).toLp _

(hf : MeasureTheory.MeasurePreserving f μ μb)

(MeasureTheory.Lp.compMeasurePreserving f hf) (MeasureTheory.Memℒp.toLp g hg) = MeasureTheory.Memℒp.toLp (g ∘ f) ⋯


/-- A product of distinguished triangles is distinguished -/
lemma productTriangle_distinguished {J : Type*} (T : J → Triangle C)
    (hT : ∀ j, T j ∈ distTriang C)
    [HasProduct (fun j => (T j).obj₁)] [HasProduct (fun j => (T j).obj₂)]
    [HasProduct (fun j => (T j).obj₃)] [HasProduct (fun j => (T j).obj₁⟦(1 : ℤ)⟧)] :
    productTriangle T ∈ distTriang C

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

(T : J → CategoryTheory.Pretriangulated.Triangle C)

(hT : ∀ (j : J), T j ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₁]

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₂]

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₃]

[CategoryTheory.Limits.HasProduct fun j => (CategoryTheory.shiftFunctor C 1).obj (T j).obj₁]

CategoryTheory.Pretriangulated.productTriangle T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles


@[simp]
theorem ceil_sub_ofNat (a : α) (n : ℕ) [n.AtLeastTwo] :
    ⌈a - (no_index (OfNat.ofNat n))⌉ = ⌈a⌉ - OfNat.ofNat n

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(a : α)
(n : ℕ)
[n.AtLeastTwo]

⌈a - OfNat.ofNat n⌉ = ⌈a⌉ - OfNat.ofNat n


@[simp]
theorem coe_ofInvolutive {σ σ' : R →+* R} [RingHomInvPair σ σ'] [RingHomInvPair σ' σ]
    {_ : Module R M} (f : M →ₛₗ[σ] M) (hf : Involutive f) : ⇑(ofInvolutive f hf) = f

{R : Type u_1}
{M : Type u_8}
[Semiring R]
[AddCommMonoid M]
{σ σ' : R →+* R}
[RingHomInvPair σ σ']
[RingHomInvPair σ' σ]

∀ {x : Module R M} (f : M →ₛₗ[σ] M) (hf : Function.Involutive ⇑f), ⇑(LinearEquiv.ofInvolutive f hf) = ⇑f


@[simp]
theorem derivative_one : derivative (1 : R[X]) = 0


theorem StrictMono.strictMonoOn_IicExtend {f : Iic b → β} (hf : StrictMono f) :
    StrictMonoOn (IicExtend f) (Iic b)

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[Preorder β]
{b : α}
{f : ↑(Set.Iic b) → β}
(hf : StrictMono f)

StrictMonoOn (Set.IicExtend f) (Set.Iic b)


lemma exact_of_g_is_cokernel (hS : IsColimit (CokernelCofork.ofπ S.g S.zero))
    [S.HasHomology] : S.Exact

(hS : CategoryTheory.Limits.IsColimit (CategoryTheory.Limits.CokernelCofork.ofπ S.g ⋯))


@[simp] theorem forIn_eq [Monad m] (l : AssocList α β) (init : δ)
    (f : (α × β) → δ → m (ForInStep δ)) : forIn l init f = forIn l.toList init f

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_4}
{δ : Type u_1}
[Monad m]
(l : Batteries.AssocList α β)
(init : δ)
(f : α × β → δ → m (ForInStep δ))


theorem ContinuousOn.continuousWithinAt {f : α → β} {s : Set α} {x : α} (hf : ContinuousOn f s)
    (hx : x ∈ s) : ContinuousWithinAt f s x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{s : Set α}
{x : α}
(hf : ContinuousOn f s)
(hx : x ∈ s)


theorem isSt_iff_tendsto {x : ℝ*} {r : ℝ} : IsSt x r ↔ x.Tendsto (𝓝 r)


theorem disjoint_symm (d : Disjoint l₁ l₂) : Disjoint l₂ l₁

∀ {α : Type u_1} {l₁ l₂ : List α}, l₁.Disjoint l₂ → l₂.Disjoint l₁


theorem mem_addWellApproximable_iff (δ : ℕ → ℝ) (x : UnitAddCircle) :
    x ∈ addWellApproximable UnitAddCircle δ ↔
      {n : ℕ | ∃ m < n, gcd m n = 1 ∧ ‖x - ↑((m : ℝ) / n)‖ < δ n}.Infinite

x ∈ addWellApproximable UnitAddCircle δ ↔ {n | ∃ m < n, gcd m n = 1 ∧ ‖x - ↑(↑m / ↑n)‖ < δ n}.Infinite


@[to_additive (attr := simp)]
theorem noncommProd_cons (s : Multiset α) (a : α) (comm) :
    noncommProd (a ::ₘ s) comm = a * noncommProd s (comm.mono fun _ => mem_cons_of_mem)

(comm : {x | x ∈ a ::ₘ s}.Pairwise Commute)

(a ::ₘ s).noncommProd comm = a * s.noncommProd ⋯


theorem implies_congr {p₁ p₂ : Sort u} {q₁ q₂ : Sort v} (h₁ : p₁ = p₂) (h₂ : q₁ = q₂) : (p₁ → q₁) = (p₂ → q₂)


/-- The diagram `K.homology i ⟶ K.opcycles i ⟶ K.cycles j ⟶ K.homology j` is exact
when `c.Rel i j`. -/
lemma composableArrows₃_exact [CategoryWithHomology C] :
    (composableArrows₃ K i j).Exact

{C : Type u_1}
{ι : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{c : ComplexShape ι}
(K : HomologicalComplex C c)
(i j : ι)
(hij : c.Rel i j)
[CategoryTheory.CategoryWithHomology C]

(HomologicalComplex.HomologySequence.composableArrows₃ K i j).Exact


/-- Known as Fatou's lemma -/
theorem lintegral_liminf_le {f : ℕ → α → ℝ≥0∞} (h_meas : ∀ n, Measurable (f n)) :
    ∫⁻ a, liminf (fun n => f n a) atTop ∂μ ≤ liminf (fun n => ∫⁻ a, f n a ∂μ) atTop

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : ℕ → α → ℝ≥0∞}
(h_meas : ∀ (n : ℕ), Measurable (f n))

∫⁻ (a : α), Filter.liminf (fun n => f n a) Filter.atTop ∂μ ≤ Filter.liminf (fun n => ∫⁻ (a : α), f n a ∂μ) Filter.atTop


@[simp]
theorem Basis.smulTower_apply {ι : Type v₁} {ι' : Type w₁}
    (b : Basis ι R S) (c : Basis ι' S A) (ij) :
    (b.smulTower c) ij = b ij.1 • c ij.2

{R : Type u}
{S : Type v}
{A : Type w}
[Semiring R]
[Semiring S]
[AddCommMonoid A]
[Module R S]
[Module S A]
[Module R A]
[IsScalarTower R S A]
{ι : Type v₁}
{ι' : Type w₁}
(b : Basis ι R S)
(c : Basis ι' S A)
(ij : ι × ι')


theorem comp_continuousOn_iff {α : Type*} [TopologicalSpace α] (e : M₁ ≃SL[σ₁₂] M₂) {f : α → M₁}
    {s : Set α} : ContinuousOn (e ∘ f) s ↔ ContinuousOn f s

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{σ₂₁ : R₂ →+* R₁}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
{α : Type u_9}
[TopologicalSpace α]
(e : M₁ ≃SL[σ₁₂] M₂)
{f : α → M₁}
{s : Set α}

ContinuousOn (⇑e ∘ f) s ↔ ContinuousOn f s


/-- Given a pushout square assembled from a pushout square on the left and
a commuting square on the right, the right square is a pushout square.

The objects in the statement fit into the following diagram:
```
X₁₁ - h₁₁ -> X₁₂ - h₁₂ -> X₁₃
|            |            |
v₁₁          v₁₂          v₁₃
↓            ↓            ↓
X₂₁ - h₂₁ -> X₂₂ - h₂₂ -> X₂₃
```
-/
theorem of_left {X₁₁ X₁₂ X₁₃ X₂₁ X₂₂ X₂₃ : C} {h₁₁ : X₁₁ ⟶ X₁₂} {h₁₂ : X₁₂ ⟶ X₁₃} {h₂₁ : X₂₁ ⟶ X₂₂}
    {h₂₂ : X₂₂ ⟶ X₂₃} {v₁₁ : X₁₁ ⟶ X₂₁} {v₁₂ : X₁₂ ⟶ X₂₂} {v₁₃ : X₁₃ ⟶ X₂₃}
    (s : IsPushout (h₁₁ ≫ h₁₂) v₁₁ v₁₃ (h₂₁ ≫ h₂₂)) (p : h₁₂ ≫ v₁₃ = v₁₂ ≫ h₂₂)
    (t : IsPushout h₁₁ v₁₁ v₁₂ h₂₁) : IsPushout h₁₂ v₁₂ v₁₃ h₂₂

{X₁₁ X₁₂ X₁₃ X₂₁ X₂₂ X₂₃ : C}

{h₁₁ : X₁₁ ⟶ X₁₂}

{h₁₂ : X₁₂ ⟶ X₁₃}

{h₂₁ : X₂₁ ⟶ X₂₂}

{h₂₂ : X₂₂ ⟶ X₂₃}

{v₁₁ : X₁₁ ⟶ X₂₁}

{v₁₂ : X₁₂ ⟶ X₂₂}

{v₁₃ : X₁₃ ⟶ X₂₃}

(s : CategoryTheory.IsPushout (h₁₁ ≫ h₁₂) v₁₁ v₁₃ (h₂₁ ≫ h₂₂))

(p : h₁₂ ≫ v₁₃ = v₁₂ ≫ h₂₂)

(t : CategoryTheory.IsPushout h₁₁ v₁₁ v₁₂ h₂₁)

CategoryTheory.IsPushout h₁₂ v₁₂ v₁₃ h₂₂


theorem dist_eq (x y : CompleteCopy s) :
    dist x y = dist x.1 y.1 + abs (1 / infDist x.1 sᶜ - 1 / infDist y.1 sᶜ)

{α : Type u_1}
[MetricSpace α]
{s : TopologicalSpace.Opens α}
(x y : s.CompleteCopy)

dist x y = dist ↑x ↑y + |1 / Metric.infDist (↑x) (↑s)ᶜ - 1 / Metric.infDist (↑y) (↑s)ᶜ|


lemma restrictFullyFaithful_homEquiv_apply {X : C} {Y : D} (f : L.obj X ⟶ Y) :
    (adj.restrictFullyFaithful hiC hiD comm1 comm2).homEquiv X Y f =
      hiC.preimage (adj.unit.app (iC.obj X) ≫ R'.map (comm1.hom.app X) ≫
        R'.map (iD.map f) ≫ comm2.hom.app Y)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{C' : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C']
{D' : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D']
{iC : CategoryTheory.Functor C C'}
{iD : CategoryTheory.Functor D D'}
{L' : CategoryTheory.Functor C' D'}
{R' : CategoryTheory.Functor D' C'}
(adj : L' ⊣ R')
(hiC : iC.FullyFaithful)
(hiD : iD.FullyFaithful)
{L : CategoryTheory.Functor C D}
{R : CategoryTheory.Functor D C}
(comm1 : iC.comp L' ≅ L.comp iD)
(comm2 : iD.comp R' ≅ R.comp iC)
{X : C}
{Y : D}
(f : L.obj X ⟶ Y)

((adj.restrictFullyFaithful hiC hiD comm1 comm2).homEquiv X Y) f =
  hiC.preimage
    (CategoryTheory.CategoryStruct.comp (adj.unit.app (iC.obj X))
      (CategoryTheory.CategoryStruct.comp (R'.map (comm1.hom.app X))
        (CategoryTheory.CategoryStruct.comp (R'.map (iD.map f)) (comm2.hom.app Y))))


theorem TopologicalSpace.IsTopologicalBasis.exists_mem_of_ne [T1Space X] {b : Set (Set X)}
    (hb : IsTopologicalBasis b) {x y : X} (h : x ≠ y) : ∃ a ∈ b, x ∈ a ∧ y ∉ a

(hb : TopologicalSpace.IsTopologicalBasis b)


@[reassoc]
theorem app_naturality {F G : C ⥤ D ⥤ E} (T : F ⟶ G) (X : C) {Y Z : D} (f : Y ⟶ Z) :
    (F.obj X).map f ≫ (T.app X).app Z = (T.app X).app Y ≫ (G.obj X).map f

{F G : CategoryTheory.Functor C (CategoryTheory.Functor D E)}

CategoryTheory.CategoryStruct.comp ((F.obj X).map f) ((T.app X).app Z) =
  CategoryTheory.CategoryStruct.comp ((T.app X).app Y) ((G.obj X).map f)


theorem subset_normalClosure : s ⊆ normalClosure s


theorem Base.ncard_eq_ncard_of_base (hB₁ : M.Base B₁) (hB₂ : M.Base B₂) : B₁.ncard = B₂.ncard

{α : Type u_1}
{M : Matroid α}
{B₁ B₂ : Set α}
(hB₁ : M.Base B₁)
(hB₂ : M.Base B₂)


theorem mul_zeta_apply {f : ArithmeticFunction ℕ} {x : ℕ} : (f * ζ) x = ∑ i ∈ divisors x, f i

(f * ArithmeticFunction.zeta) x = ∑ i ∈ x.divisors, f i


@[ext]
theorem to_zero_ext {X : C} (f g : X ⟶ 0) : f = g

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


/-- The `k`th coefficient of `Polynomial.taylor r f` is `(Polynomial.hasseDeriv k f).eval r`. -/
theorem taylor_coeff (n : ℕ) : (taylor r f).coeff n = (hasseDeriv n f).eval r

{R : Type u_1}
[Semiring R]
(r : R)
(f : Polynomial R)
(n : ℕ)

((Polynomial.taylor r) f).coeff n = Polynomial.eval r ((Polynomial.hasseDeriv n) f)


theorem commutator_apply : ⁅D1, D2⁆ a = D1 (D2 a) - D2 (D1 a)

{R : Type u_1}
[CommRing R]
{A : Type u_2}
[CommRing A]
[Algebra R A]
{D1 D2 : Derivation R A A}
(a : A)


theorem map_mul (f₁ f₂ : M →ₗ[R] M) (g₁ g₂ : N →ₗ[R] N) :
    map (f₁ * f₂) (g₁ * g₂) = map f₁ g₁ * map f₂ g₂

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
(f₁ f₂ : M →ₗ[R] M)
(g₁ g₂ : N →ₗ[R] N)

TensorProduct.map (f₁ * f₂) (g₁ * g₂) = TensorProduct.map f₁ g₁ * TensorProduct.map f₂ g₂


@[simp]
theorem fst_natCast [AddMonoidWithOne R] [AddMonoid M] (n : ℕ) : (n : tsze R M).fst = n

{R : Type u}
{M : Type v}
[AddMonoidWithOne R]
[AddMonoid M]
(n : ℕ)


lemma nonsingularLift_some (X Y : R) :
    W.NonsingularLift ⟦![X, Y, 1]⟧ ↔ W.toAffine.Nonsingular X Y

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Projective R)
(X Y : R)


@[simps]
instance left' (f g : a ⟶ b) [BicategoricalCoherence f g] :
    BicategoricalCoherence f (𝟙 a ≫ g)


lemma sized_compls (hn : n ≤ Fintype.card α) :
    (𝒜ᶜˢ : Set (Finset α)).Sized n ↔ (𝒜 : Set (Finset α)).Sized (Fintype.card α - n)

{α : Type u_2}
[DecidableEq α]
[Fintype α]
{𝒜 : Finset (Finset α)}
{n : ℕ}
(hn : n ≤ Fintype.card α)

Set.Sized n ↑𝒜.compls ↔ Set.Sized (Fintype.card α - n) ↑𝒜


lemma isUnit_dblU_of_Y_eq {P Q : Fin 3 → F} (hP : W.Nonsingular P) (hPz : P z ≠ 0) (hQz : Q z ≠ 0)
    (hx : P x * Q z ^ 2 = Q x * P z ^ 2) (hy : P y * Q z ^ 3 = Q y * P z ^ 3)
    (hy' : P y * Q z ^ 3 = W.negY Q * P z ^ 3) : IsUnit (W.dblU P)


theorem min_rec (hx : x ≤ y → p x) (hy : y ≤ x → p y) : p (min x y)

{α : Type u_2}
[LinearOrder α]
{p : α → Prop}
{x y : α}
(hx : x ≤ y → p x)
(hy : y ≤ x → p y)


@[to_additive (attr := simp)]
theorem map_id_id : map (.id M) (.id N) = .id (M ∗ N)

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

Monoid.Coprod.map (MonoidHom.id M) (MonoidHom.id N) = MonoidHom.id (Monoid.Coprod M N)


/-- Reinterpret a `⨆`-homomorphism as an `⨅`-homomorphism between the dual orders. -/
@[simps]
protected def dual : sSupHom α β ≃ sInfHom αᵒᵈ βᵒᵈ

{α : Type u_2}
{β : Type u_3}
[SupSet α]
[SupSet β]
(f : sInfHom αᵒᵈ βᵒᵈ)

∀ (a : α), (sSupHom.dual.symm f) a = (⇑OrderDual.ofDual ∘ ⇑f ∘ ⇑OrderDual.toDual) a


/-- A natural isomorphism between the functor `map (𝟭 C)` and `𝟭 (WithInitial C)`. -/
@[simps!]
def mapId (C : Type*) [Category C] : map (𝟭 C) ≅ 𝟭 (WithInitial C)

(C : Type u_1)
[CategoryTheory.Category.{u_2, u_1} C]
(X : CategoryTheory.WithInitial C)

(CategoryTheory.WithInitial.mapId C).hom.app X =
  (match X with
    | CategoryTheory.WithInitial.of x => CategoryTheory.Iso.refl (CategoryTheory.WithInitial.of x)
    | CategoryTheory.WithInitial.star => CategoryTheory.Iso.refl CategoryTheory.WithInitial.star).hom


theorem finsuppRight_apply (t : M ⊗[R] (ι →₀ N)) (i : ι) :
    finsuppRight R M N ι t i = lTensor M (Finsupp.lapply i) t

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_4}
[DecidableEq ι]
(t : M ⊗[R] (ι →₀ N))
(i : ι)

((TensorProduct.finsuppRight R M N ι) t) i = (LinearMap.lTensor M (Finsupp.lapply i)) t


/-- A category has finite coproducts if there exists a colimit for every diagram
with shape `Discrete J`, where we have `[Fintype J]`.

We require this condition only for `J = Fin n` in the definition, then deduce a version for any
`J : Type*` as a corollary of this definition.
-/
class HasFiniteCoproducts : Prop where
  /-- `C` has all finite coproducts -/
  out (n : ℕ) : HasColimitsOfShape (Discrete (Fin n)) C

[self : CategoryTheory.Limits.HasFiniteCoproducts C]

CategoryTheory.Limits.HasColimitsOfShape (CategoryTheory.Discrete (Fin n)) C


@[to_additive]
theorem relindex_eq_zero_of_le_right (hKL : K ≤ L) (hHK : H.relindex K = 0) : H.relindex L = 0

{G : Type u_1}
[Group G]
{H K L : Subgroup G}
(hKL : K ≤ L)
(hHK : H.relindex K = 0)


/-- For a topology generated by a basis, it suffices to check the sheaf condition on the basis
presieves only.
-/
theorem isSheaf_pretopology [HasPullbacks C] (K : Pretopology C) :
    IsSheaf (K.toGrothendieck C) P ↔ ∀ {X : C} (R : Presieve X), R ∈ K X → IsSheafFor P R

{P : CategoryTheory.Functor Cᵒᵖ (Type w)}

CategoryTheory.Presieve.IsSheaf (CategoryTheory.Pretopology.toGrothendieck C K) P ↔
  ∀ {X : C}, ∀ R ∈ K.coverings X, CategoryTheory.Presieve.IsSheafFor P R


/-- **Hölder inequality**: The scalar product of two functions is bounded by the product of their
`L^p` and `L^q` norms when `p` and `q` are conjugate exponents. Version for sums over finite sets,
with `ℝ≥0`-valued functions. -/
theorem inner_le_Lp_mul_Lq (f g : ι → ℝ≥0) {p q : ℝ} (hpq : p.IsConjExponent q) :
    ∑ i ∈ s, f i * g i ≤ (∑ i ∈ s, f i ^ p) ^ (1 / p) * (∑ i ∈ s, g i ^ q) ^ (1 / q)

{ι : Type u}
(s : Finset ι)
(f g : ι → ℝ≥0)
{p q : ℝ}
(hpq : p.IsConjExponent q)


lemma iSup_generateFrom (s : ι → Set (Set α)) :
    ⨆ i, generateFrom (s i) = generateFrom (⋃ i, s i)

{α : Type u_1}
{ι : Sort u_6}
(s : ι → Set (Set α))

⨆ i, MeasurableSpace.generateFrom (s i) = MeasurableSpace.generateFrom (⋃ i, s i)


/-- If `P` is a prime ideal of `R`, then `P.R[x]` is a prime ideal of `R[x]`. -/
theorem isPrime_map_C_iff_isPrime (P : Ideal R) :
    IsPrime (map (C : R →+* R[X]) P : Ideal R[X]) ↔ IsPrime P

(Ideal.map Polynomial.C P).IsPrime ↔ P.IsPrime


@[simp]
theorem germ_toOpen (U : Opens (PrimeSpectrum.Top R)) (x : U) (f : R) :
    (structureSheaf R).presheaf.germ x (toOpen R U f) = toStalk R x f

(U : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

((AlgebraicGeometry.Spec.structureSheaf R).presheaf.germ x) ((AlgebraicGeometry.StructureSheaf.toOpen R U) f) =
  (AlgebraicGeometry.StructureSheaf.toStalk R ↑x) f


lemma Pi.induced_restrict (S : Set ι) :
    induced (S.restrict) Pi.topologicalSpace =
    ⨅ i ∈ S, induced (eval i) (T i)

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

TopologicalSpace.induced S.restrict Pi.topologicalSpace = ⨅ i ∈ S, TopologicalSpace.induced (Function.eval i) (T i)


theorem IsCofilteredOrEmpty.isPreconnected [IsCofilteredOrEmpty C] : IsPreconnected C

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


@[to_additive (attr := simp)]
theorem coe_mulLeft (x : X) : ⇑(ContinuousMap.mulLeft x) = fun y => x * y

{X : Type u_5}
[TopologicalSpace X]
[Mul X]
[ContinuousMul X]
(x : X)


theorem cardinal_mk_le_sigma_polynomial :
    #L ≤ #(Σ p : R[X], { x : L // x ∈ p.aroots L })

(R L : Type u)
[CommRing R]
[CommRing L]
[IsDomain L]
[Algebra R L]
[NoZeroSMulDivisors R L]
[Algebra.IsAlgebraic R L]

#L ≤ #((p : R[X]) × { x // x ∈ p.aroots L })


/-- Multiplicative congruence relations preserve finite product. -/
@[to_additive "Additive congruence relations preserve finite sum."]
protected theorem finset_prod {ι M : Type*} [CommMonoid M] (c : Con M) (s : Finset ι)
    {f g : ι → M} (h : ∀ i ∈ s, c (f i) (g i)) :
    c (s.prod f) (s.prod g)

{ι : Type u_1}
{M : Type u_2}
[CommMonoid M]
(c : Con M)
(s : Finset ι)
{f g : ι → M}
(h : ∀ i ∈ s, c (f i) (g i))


@[simp]
theorem inf_toSubalgebra (S T : StarSubalgebra R A) :
    (S ⊓ T).toSubalgebra = S.toSubalgebra ⊓ T.toSubalgebra

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


@[to_additive (attr := simp)]
theorem mulSupport_inv : (mulSupport fun x => (f x)⁻¹) = mulSupport f

{α : Type u_1}
{G : Type u_9}
[DivisionMonoid G]
(f : α → G)

(Function.mulSupport fun x => (f x)⁻¹) = Function.mulSupport f


theorem Subsemigroup.toAddSubsemigroup'_closure (S : Set (Multiplicative A)) :
    Subsemigroup.toAddSubsemigroup' (Subsemigroup.closure S) =
      AddSubsemigroup.closure (Multiplicative.ofAdd ⁻¹' S)

{A : Type u_5}
[Add A]
(S : Set (Multiplicative A))

Subsemigroup.toAddSubsemigroup' (Subsemigroup.closure S) = AddSubsemigroup.closure (⇑Multiplicative.ofAdd ⁻¹' S)


theorem map_restrict_of_zero [Zero γ] {g : β → γ} (hg : g 0 = 0) (f : α →ₛ β) (s : Set α) :
    (f.restrict s).map g = (f.map g).restrict s

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[MeasurableSpace α]
[Zero β]
[Zero γ]
{g : β → γ}
(hg : g 0 = 0)
(f : MeasureTheory.SimpleFunc α β)
(s : Set α)

MeasureTheory.SimpleFunc.map g (f.restrict s) = (MeasureTheory.SimpleFunc.map g f).restrict s


theorem USize.toNat_sub (x y : USize) :
    (x - y).toNat = (USize.size - y.toNat + x.toNat) % USize.size


theorem uncurry_id_eq_ev : uncurry (𝟙 (A ⟶[C] X)) = (ihom.ev A).app X

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

CategoryTheory.MonoidalClosed.uncurry (CategoryTheory.CategoryStruct.id ((CategoryTheory.ihom A).obj X)) =
  (CategoryTheory.ihom.ev A).app X


@[to_additive Summable.of_add_one_of_neg_add_one]
lemma Multipliable.of_add_one_of_neg_add_one {f : ℤ → M}
    (hf₁ : Multipliable fun n : ℕ ↦ f (n + 1)) (hf₂ : Multipliable fun n : ℕ ↦ f (-(n + 1))) :
    Multipliable f

(hf₁ : Multipliable fun n => f (↑n + 1))

(hf₂ : Multipliable fun n => f (-(↑n + 1)))


@[simp, norm_cast]
theorem coe_le_coe [LE α] {p : α → Prop} {x y : Subtype p} : (x : α) ≤ y ↔ x ≤ y

{α : Type u_2}
[LE α]
{p : α → Prop}
{x y : Subtype p}

↑x ≤ ↑y ↔ x ≤ y


@[simp]
theorem funMap_sum_inl {n : ℕ} (f : L₁.Functions n) :
    @funMap (L₁.sum L₂) S _ n (Sum.inl f) = funMap f

{L₁ : FirstOrder.Language}
{L₂ : FirstOrder.Language}
{S : Type u_3}
[L₁.Structure S]
[L₂.Structure S]
{n : ℕ}
(f : L₁.Functions n)

FirstOrder.Language.Structure.funMap (Sum.inl f) = FirstOrder.Language.Structure.funMap f


theorem integrableOn_rpow_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : -1 < s) :
    IntegrableOn (fun x : ℝ => x ^ s * exp (-b * x ^ 2)) (Ioi 0)

MeasureTheory.IntegrableOn (fun x => x ^ s * rexp (-b * x ^ 2)) (Set.Ioi 0) MeasureTheory.volume


theorem dist_le_add_of_nonempty_closedBall_inter_closedBall
    (h : (closedBall x ε₁ ∩ closedBall y ε₂).Nonempty) : dist x y ≤ ε₁ + ε₂

(h : (Metric.closedBall x ε₁ ∩ Metric.closedBall y ε₂).Nonempty)


/-- Reinterpret a lattice homomorphism as a lattice homomorphism between the dual lattices. -/
@[simps]
protected def dual : LatticeHom α β ≃ LatticeHom αᵒᵈ βᵒᵈ

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
(f : LatticeHom α β)

(LatticeHom.dual f).toSupHom = InfHom.dual f.toInfHom


/-- The categorical data that is involved in a `1`-hypercover of an object `S`. This
consists of a family of morphisms `f i : X i ⟶ S` for `i : I₀`, and for each
tuple `(i₁, i₂)` of elements in `I₀`, a family of objects `Y j` indexed by
a type `I₁ i₁ i₂`, which are equipped with a map to the fibre product of `X i₁`
and `X i₂`, which is phrased here as the data of the two projections
`p₁ : Y j ⟶ X i₁`, `p₂ : Y j ⟶ X i₂` and the relation `p₁ j ≫ f i₁ = p₂ j ≫ f i₂`.
(See `GrothendieckTopology.OneHypercover` for the topological conditions.) -/
structure PreOneHypercover (S : C) where
  /-- the index type of the covering of `S` -/
  I₀ : Type w
  /-- the objects in the covering of `S` -/
  X (i : I₀) : C
  /-- the morphisms in the covering of `S` -/
  f (i : I₀) : X i ⟶ S
  /-- the index type of the coverings of the fibre products -/
  I₁ (i₁ i₂ : I₀) : Type w
  /-- the objects in the coverings of the fibre products  -/
  Y ⦃i₁ i₂ : I₀⦄ (j : I₁ i₁ i₂) : C
  /-- the first projection `Y j ⟶ X i₁` -/
  p₁ ⦃i₁ i₂ : I₀⦄ (j : I₁ i₁ i₂) : Y j ⟶ X i₁
  /-- the second projection `Y j ⟶ X i₂` -/
  p₂ ⦃i₁ i₂ : I₀⦄ (j : I₁ i₁ i₂) : Y j ⟶ X i₂
  w ⦃i₁ i₂ : I₀⦄ (j : I₁ i₁ i₂) : p₁ j ≫ f i₁ = p₂ j ≫ f i₂

(self : CategoryTheory.PreOneHypercover S)

CategoryTheory.CategoryStruct.comp (self.p₁ j) (self.f i₁) = CategoryTheory.CategoryStruct.comp (self.p₂ j) (self.f i₂)


lemma eventuallyConst_iff_tendsto [Nonempty β] :
    EventuallyConst f l ↔ ∃ x, Tendsto f l (pure x)

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
{f : α → β}
[Nonempty β]

Filter.EventuallyConst f l ↔ ∃ x, Filter.Tendsto f l (pure x)


theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) :
    HasFPowerSeriesAt (f + g) (pf + pg) x

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{pf pg : FormalMultilinearSeries 𝕜 E F}
{x : E}
(hf : HasFPowerSeriesAt f pf x)
(hg : HasFPowerSeriesAt g pg x)


@[simp] lemma image_add_right_Ioo (a b c : α) : (Ioo a b).image (· + c) = Ioo (a + c) (b + c)

{α : Type u_2}
[OrderedCancelAddCommMonoid α]
[ExistsAddOfLE α]
[LocallyFiniteOrder α]
[DecidableEq α]
(a b c : α)

Finset.image (fun x => x + c) (Finset.Ioo a b) = Finset.Ioo (a + c) (b + c)


@[simp] theorem Function.Embedding.sigmaSet_preimage {s : ι → Set α}
    (h : Pairwise (Disjoint on s)) (i : ι) (r : Set α) :
    Sigma.mk i ⁻¹' (Function.Embedding.sigmaSet h ⁻¹' r) = r ∩ s i

{α : Type u_1}
{ι : Type u_2}
{s : ι → Set α}
(h : Pairwise (Disjoint on s))
(i : ι)
(r : Set α)

↑(Sigma.mk i ⁻¹' (⇑(Function.Embedding.sigmaSet h) ⁻¹' r)) = r ∩ s i


theorem continuous_edist : Continuous fun p : α × α => edist p.1 p.2


theorem degrees_rename (f : σ → τ) (φ : MvPolynomial σ R) :
    (rename f φ).degrees ⊆ φ.degrees.map f

{R : Type u}
{σ : Type u_1}
{τ : Type u_2}
[CommSemiring R]
(f : σ → τ)
(φ : MvPolynomial σ R)

((MvPolynomial.rename f) φ).degrees ⊆ Multiset.map f φ.degrees


theorem forall_mem_of_forall_mem_union_right (h : ∀ x ∈ l₁ ∪ l₂, p x) : ∀ x ∈ l₂, p x

{α : Type u_1}
{l₁ l₂ : List α}
{p : α → Prop}
[DecidableEq α]
(h : ∀ (x : α), x ∈ l₁ ∪ l₂ → p x)
(x : α)


theorem insert_self_properDivisors (h : n ≠ 0) : insert n (properDivisors n) = divisors n


lemma indicator_eq_one_iff_mem : indicator s 1 i = (1 : M₀) ↔ i ∈ s

{ι : Type u_1}
(M₀ : Type u_4)
[MulZeroOneClass M₀]
{s : Set ι}
{i : ι}
[Nontrivial M₀]


protected theorem mul_div_cancel_left (m : Nat) {n : Nat} (H : 0 < n) : n * m / n = m


lemma div_nonpos_of_nonpos_of_nonneg [MulPosMono α] (ha : a ≤ 0) (hb : 0 ≤ b) : a / b ≤ 0

{α : Type u_1}
[Semifield α]
[LinearOrder α]
[PosMulReflectLT α]
[ZeroLEOneClass α]
{a b : α}
[MulPosMono α]
(ha : a ≤ 0)
(hb : 0 ≤ b)


theorem foldl_succ (f : α → Fin (n+1) → α) (x) :
    foldl (n+1) f x = foldl n (fun x i => f x i.succ) (f x 0)

{α : Sort u_1}
{n : Nat}
(f : α → Fin (n + 1) → α)
(x : α)

Fin.foldl (n + 1) f x = Fin.foldl n (fun x i => f x i.succ) (f x 0)


@[ext] theorem AddMonoidWithOne.ext ⦃inst₁ inst₂ : AddMonoidWithOne R⦄
    (h_add : local_hAdd[R, inst₁] = local_hAdd[R, inst₂])
    (h_one : (letI := inst₁; One.one : R) = (letI := inst₂; One.one : R)) :
    inst₁ = inst₂

{R : Type u}
⦃inst₁ inst₂ : AddMonoidWithOne R⦄
(h_add : HAdd.hAdd = HAdd.hAdd)
(h_one : One.one = One.one)


theorem eventually_norm_sub_lt (x₀ : E) {ε : ℝ} (ε_pos : 0 < ε) :
    ∀ᶠ x in 𝓝 x₀, ‖x - x₀‖ < ε

{E : Type u_1}
[SeminormedAddCommGroup E]
(x₀ : E)
{ε : ℝ}
(ε_pos : 0 < ε)


lemma strictMono (x : LTSeries α) : StrictMono x

{α : Type u_1}
[Preorder α]
(x : LTSeries α)


{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
(x : α)
[AddGroup β]
[TopologicalAddGroup β]
(f : α →C_c β)


@[simp]
theorem sortedUniv_toFinset (α) [Fintype α] [Encodable α] [DecidableEq α] :
    (sortedUniv α).toFinset = Finset.univ

(α : Type u_2)
[Fintype α]
[Encodable α]
[DecidableEq α]

(Encodable.sortedUniv α).toFinset = Finset.univ


/-- The quadratic character is multiplicative. -/
theorem quadraticCharFun_mul (a b : F) :
    quadraticCharFun F (a * b) = quadraticCharFun F a * quadraticCharFun F b

{F : Type u_1}
[Field F]
[Fintype F]
[DecidableEq F]
(a b : F)


/-- Let `B : PowerBasis S A` be such that `IsIntegral R B.gen`, and let `x : A` be an element
with integral coordinates in the base `B.basis`. Then `IsIntegral R ((B.basis.repr (x ^ n) i)` for
all `i` and all `n` if `minpoly S B.gen = (minpoly R B.gen).map (algebraMap R S)`. This is the case
if `R` is a GCD domain and `S` is its fraction ring. -/
theorem repr_pow_isIntegral [IsDomain S] {x : A} (hx : ∀ i, IsIntegral R (B.basis.repr x i))
    (hmin : minpoly S B.gen = (minpoly R B.gen).map (algebraMap R S)) (n : ℕ) :
    ∀ i, IsIntegral R (B.basis.repr (x ^ n) i)

(hx : ∀ (i : Fin B.dim), IsIntegral R ((B.basis.repr x) i))

(hmin : minpoly S B.gen = Polynomial.map (algebraMap R S) (minpoly R B.gen))


protected theorem injective (e : α ≃ β) : Injective e


/-- The `Finset` of prime factors of an `n`-smooth number is contained in the `Finset`
of primes below `n`. -/
lemma primeFactors_subset_of_mem_smoothNumbers {m n : ℕ} (hms : m ∈ n.smoothNumbers) :
    m.primeFactors ⊆ n.primesBelow


lemma StrictMonoOn.mapsTo_Ico (h : StrictMonoOn f (Icc a b)) :
    MapsTo f (Ico a b) (Ico (f a) (f b))

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[PartialOrder α]
[Preorder β]
{a b : α}
(h : StrictMonoOn f (Set.Icc a b))

Set.MapsTo f (Set.Ico a b) (Set.Ico (f a) (f b))


theorem measurable_prod_mk_right {y : β} : Measurable fun x : α => (x, y)

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}
{y : β}


@[simp] theorem add_eq_add : add p q = p + q


@[simp, norm_cast] lemma cast_lt : (p : K) < q ↔ p < q

{p q : ℚ}
{K : Type u_5}
[LinearOrderedField K]


lemma densityProcess_mono_kernel_left {κ' : Kernel α (γ × β)} (hκκ' : κ ≤ κ')
    (hκ'ν : fst κ' ≤ ν) (n : ℕ) (a : α) (x : γ) (s : Set β) :
    densityProcess κ ν n a x s ≤ densityProcess κ' ν n a x s

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

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

κ.densityProcess ν n a x s ≤ κ'.densityProcess ν n a x s


theorem le_vanishingIdeal_zeroLocus (I : Ideal R) : I ≤ vanishingIdeal (zeroLocus I)

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

I ≤ PrimeSpectrum.vanishingIdeal (PrimeSpectrum.zeroLocus ↑I)


{α : Type u_1}
[Preorder α]
[PredOrder α]
[NoMinOrder α]
(a : α)


@[to_additive]
theorem mulIndicator_mul_eq_left {f g : α → M} (h : Disjoint (mulSupport f) (mulSupport g)) :
    (mulSupport f).mulIndicator (f * g) = f

(h : Disjoint (Function.support f) (Function.support g))

(Function.support f).indicator (f + g) = f


theorem ofCauchy_add (a b) : (⟨a + b⟩ : ℝ) = ⟨a⟩ + ⟨b⟩

{ cauchy := a + b } = { cauchy := a } + { cauchy := b }


@[simp] theorem id_comp (f : G →+c[a, b] H) : .comp .id f = f

{G : Type u_1}
{H : Type u_2}
[Add G]
[Add H]
{a : G}
{b : H}
(f : AddConstMap G H a b)


lemma evaluation_naturality_apply {V : Opens Y} (x : (Opens.map f.1.base).obj V)
    (a : Y.presheaf.obj (op V)) :
    residueFieldMap f x.val (Y.evaluation ⟨f.val.base x, x.property⟩ a) =
      X.evaluation x (f.val.c.app (op V) a)

{X Y : AlgebraicGeometry.LocallyRingedSpace}

{V : TopologicalSpace.Opens ↑Y.toTopCat}

(x : ↥((TopologicalSpace.Opens.map f.val.base).obj V))

(AlgebraicGeometry.LocallyRingedSpace.residueFieldMap f ↑x) ((Y.evaluation ⟨f.val.base ↑x, ⋯⟩) a) =
  (X.evaluation x) ((f.val.c.app (Opposite.op V)) a)


theorem bind_congr {l : List α} {f g : α → List β} (h : ∀ x ∈ l, f x = g x) :
    List.bind l f = List.bind l g

{α : Type u}
{β : Type v}
{l : List α}
{f g : α → List β}
(h : ∀ (x : α), x ∈ l → f x = g x)


/-- A prefunctor from a quiver `B` to a bicategory `C` can be lifted to a pseudofunctor from
`free_bicategory B` to `C`.
-/
@[simps]
def lift : Pseudofunctor (FreeBicategory B) C

{B : Type u₁}
[Quiver B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : B ⥤q C)

∀ {a b : CategoryTheory.FreeBicategory B} {f g : a ⟶ b} (a_1 : Quot CategoryTheory.FreeBicategory.Rel),
  (CategoryTheory.FreeBicategory.lift F).map₂ a_1 = Quot.lift (CategoryTheory.FreeBicategory.liftHom₂ F) ⋯ a_1


@[fun_prop, measurability]
theorem measurable_swap : Measurable (Prod.swap : α × β → β × α)

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}


lemma jacobiMatrix_apply (i j : P.rels) :
    P.jacobiMatrix i j = MvPolynomial.pderiv (P.map i) (P.relation j)

(P : Algebra.PreSubmersivePresentation R S)

P.jacobiMatrix i j = (MvPolynomial.pderiv (P.map i)) (P.relation j)


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

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}

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


@[simp]
theorem coe_mk' (f : A →ₐ[R] B) (h) : (mk f h : A → B) = f

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
{B : Type u_3}
[Semiring B]
[TopologicalSpace B]
[Algebra R A]
[Algebra R B]
(f : A →ₐ[R] B)
(h : Continuous (↑↑f.toRingHom).toFun)


theorem isCompact_basicOpen (f : R) : IsCompact (basicOpen f : Set (PrimeSpectrum R))


theorem one_fin_two : (1 : Matrix (Fin 2) (Fin 2) α) = !![1, 0; 0, 1]


lemma measurable_densityProcess_right (κ : Kernel α (γ × β)) (ν : Kernel α γ) (n : ℕ)
    {s : Set β} (a : α) (hs : MeasurableSet s) :
    Measurable (fun x ↦ densityProcess κ ν n a x s)

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

Measurable fun x => κ.densityProcess ν n a x s


theorem mk'_cancel (a : R) (b c : M) :
    mk' S (a * c) (b * c) = mk' S a b

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
(a : R)
(b c : ↥M)

IsLocalization.mk' S (a * ↑c) (b * c) = IsLocalization.mk' S a b


@[reassoc (attr := simp)]
theorem toImagePresheaf_ι (f : F' ⟶ F) : toImagePresheaf f ≫ (imagePresheaf f).ι = f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F F' : Cᵒᵖ ⥤ Type w}
(f : F' ⟶ F)

CategoryTheory.GrothendieckTopology.toImagePresheaf f ≫ (CategoryTheory.GrothendieckTopology.imagePresheaf f).ι = f


theorem adjugate_conjTranspose [StarRing α] (A : Matrix n n α) : A.adjugateᴴ = adjugate Aᴴ

{n : Type v}
{α : Type w}
[DecidableEq n]
[Fintype n]
[CommRing α]
[StarRing α]
(A : Matrix n n α)


/-- The complement of an open set as a closed set. -/
@[simps]
def Opens.compl (s : Opens α) : Closeds α

{α : Type u_2}
[TopologicalSpace α]
(s : TopologicalSpace.Opens α)


@[simp]
theorem coe_homothetyAffine (c : P1) : ⇑(homothetyAffine c : k →ᵃ[k] _) = homothety c

{k : Type u_2}
{V1 : Type u_3}
{P1 : Type u_4}
[CommRing k]
[AddCommGroup V1]
[AffineSpace V1 P1]
[Module k V1]
(c : P1)

⇑(AffineMap.homothetyAffine c) = AffineMap.homothety c


/-- Combine finitely supported functions over `{a // P a}` and `{a // ¬P a}`, by case-splitting on
`P a`. -/
@[simps]
def piecewise (f : Subtype P →₀ M) (g : {a // ¬ P a} →₀ M) : α →₀ M

{α : Type u_1}
{M : Type u_13}
[Zero M]
{P : α → Prop}
[DecidablePred P]
(f : Subtype P →₀ M)
(g : { a // ¬P a } →₀ M)
(a : α)

(f.piecewise g) a = if h : P a then f ⟨a, h⟩ else g ⟨a, h⟩


/-- The value at a unit of a Dirichlet character with target a normed field has norm `1`. -/
@[simp] lemma unit_norm_eq_one (a : (ZMod n)ˣ) : ‖χ a‖ = 1

{F : Type u_1}
[NormedField F]
{n : ℕ}
(χ : DirichletCharacter F n)
(a : (ZMod n)ˣ)


theorem AffineMap.slope_comp {F PF : Type*} [AddCommGroup F] [Module k F] [AddTorsor F PF]
    (f : PE →ᵃ[k] PF) (g : k → PE) (a b : k) : slope (f ∘ g) a b = f.linear (slope g a b)

{k : Type u_1}
{E : Type u_2}
{PE : Type u_3}
[Field k]
[AddCommGroup E]
[Module k E]
[AddTorsor E PE]
{F : Type u_4}
{PF : Type u_5}
[AddCommGroup F]
[Module k F]
[AddTorsor F PF]
(f : PE →ᵃ[k] PF)
(g : k → PE)
(a b : k)

slope (⇑f ∘ g) a b = f.linear (slope g a b)


@[to_additive (attr := simp)]
theorem center_toSubmonoid : (center G).toSubmonoid = Submonoid.center G

(AddSubgroup.center G).toAddSubmonoid = AddSubmonoid.center G


@[simp] lemma succAbove_succ_self (j : Fin n) : j.succ.succAbove j = j.castSucc


@[simp]
theorem image_div_divisors_eq_divisors (n : ℕ) :
    image (fun x : ℕ => n / x) n.divisors = n.divisors

Finset.image (fun x => n / x) n.divisors = n.divisors


theorem _root_.Char.utf8Size_pos (c : Char) : 0 < c.utf8Size


theorem IsPrimitive.isUnit_iff_isUnit_map_of_injective : IsUnit f ↔ IsUnit (map φ f)

{R : Type u_1}
[CommRing R]
{S : Type u_2}
[CommRing S]
[IsDomain S]
{φ : R →+* S}
(hinj : Function.Injective ⇑φ)
{f : R[X]}
(hf : f.IsPrimitive)


theorem RingHom.Finite.to_isIntegral (h : f.Finite) : f.IsIntegral

{R : Type u_1}
{S : Type u_4}
[CommRing R]
[CommRing S]
{f : R →+* S}
(h : f.Finite)


@[to_additive] theorem of_mulHom (f : H →ₙ* G)
    (hf : ∀ ⦃a b c d : H⦄, a * b = c * d → f a = f c ∧ f b = f d → a = c ∧ b = d)
    [UniqueProds G] : UniqueProds H


theorem DifferentiableWithinAt.div (hc : DifferentiableWithinAt 𝕜 c s x)
    (hd : DifferentiableWithinAt 𝕜 d s x) (hx : d x ≠ 0) :
    DifferentiableWithinAt 𝕜 (fun x => c x / d x) s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{s : Set 𝕜}
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{c d : 𝕜 → 𝕜'}
(hc : DifferentiableWithinAt 𝕜 c s x)
(hd : DifferentiableWithinAt 𝕜 d s x)
(hx : d x ≠ 0)


/-- Multiplying by all the matrices in `listTransvecCol M` kills all the coefficients in the
last column but the last one. -/
theorem listTransvecCol_mul_last_col (hM : M (inr unit) (inr unit) ≠ 0) (i : Fin r) :
    ((listTransvecCol M).prod * M) (inl i) (inr unit) = 0

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

((Matrix.Pivot.listTransvecCol M).prod * M) (Sum.inl i) (Sum.inr ()) = 0


theorem eq_toLinearMap_symm_comp (f : M₃ →ₛₗ[σ₃₁] M₁) (g : M₃ →ₛₗ[σ₃₂] M₂) :
    f = e₁₂.symm.toLinearMap.comp g ↔ e₁₂.toLinearMap.comp f = g

{R₁ : Type u_2}
{R₂ : Type u_3}
{R₃ : Type u_4}
{M₁ : Type u_9}
{M₂ : Type u_10}
{M₃ : Type u_11}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
{module_M₁ : Module R₁ M₁}
{module_M₂ : Module R₂ M₂}
{module_M₃ : Module R₃ M₃}
{σ₁₂ : R₁ →+* R₂}
{σ₂₁ : R₂ →+* R₁}
{σ₃₂ : R₃ →+* R₂}
{σ₃₁ : R₃ →+* R₁}
[RingHomCompTriple σ₃₂ σ₂₁ σ₃₁]
{re₁₂ : RingHomInvPair σ₁₂ σ₂₁}
{re₂₁ : RingHomInvPair σ₂₁ σ₁₂}
{e₁₂ : M₁ ≃ₛₗ[σ₁₂] M₂}
[RingHomCompTriple σ₃₁ σ₁₂ σ₃₂]
(f : M₃ →ₛₗ[σ₃₁] M₁)
(g : M₃ →ₛₗ[σ₃₂] M₂)

f = (↑e₁₂.symm).comp g ↔ (↑e₁₂).comp f = g


@[to_additive (attr := simp)]
theorem lift_coe (x : α) : lift f x = f x

{α : Type u}
{β : Type v}
[Mul α]
[MulOneClass β]
(f : α →ₙ* β)
(x : α)


theorem boxProd_neighborFinset (x : α × β)
    [Fintype (G.neighborSet x.1)] [Fintype (H.neighborSet x.2)] [Fintype ((G □ H).neighborSet x)] :
    (G □ H).neighborFinset x =
      (G.neighborFinset x.1 ×ˢ {x.2}).disjUnion ({x.1} ×ˢ H.neighborFinset x.2)
        (Finset.disjoint_product.mpr <| Or.inl <| neighborFinset_disjoint_singleton _ _)

{α : Type u_1}
{β : Type u_2}
{G : SimpleGraph α}
{H : SimpleGraph β}
(x : α × β)
[Fintype ↑(G.neighborSet x.1)]
[Fintype ↑(H.neighborSet x.2)]
[Fintype ↑((G □ H).neighborSet x)]

(G □ H).neighborFinset x = (G.neighborFinset x.1 ×ˢ {x.2}).disjUnion ({x.1} ×ˢ H.neighborFinset x.2) ⋯


@[reassoc (attr := simp)]
theorem ι_colimMap {F G : J ⥤ C} [HasColimit F] [HasColimit G] (α : F ⟶ G) (j : J) :
    colimit.ι F j ≫ colimMap α = α.app j ≫ colimit.ι G j

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F G : J ⥤ C}
[CategoryTheory.Limits.HasColimit F]
[CategoryTheory.Limits.HasColimit G]
(α : F ⟶ G)
(j : J)

CategoryTheory.Limits.colimit.ι F j ≫ CategoryTheory.Limits.colimMap α = α.app j ≫ CategoryTheory.Limits.colimit.ι G j


@[simp] theorem ite_true_decide_same (p : Prop) [h : Decidable p] (b : Bool) :
  (if p then decide p else b) = (decide p || b)


theorem HasDerivAt.div (hc : HasDerivAt c c' x) (hd : HasDerivAt d d' x) (hx : d x ≠ 0) :
    HasDerivAt (fun y => c y / d y) ((c' * d x - c x * d') / d x ^ 2) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{c d : 𝕜 → 𝕜'}
{c' d' : 𝕜'}
(hc : HasDerivAt c c' x)
(hd : HasDerivAt d d' x)
(hx : d x ≠ 0)


theorem sub_eq_of_add_eq (hb : b ≠ ∞) (hc : a + b = c) : c - b = a

{a b c : ℝ≥0∞}
(hb : b ≠ ⊤)
(hc : a + b = c)


theorem subset_infs {s t : Set α} :
    ↑u ⊆ s ⊼ t → ∃ s' t' : Finset α, ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ s' ⊼ t'

{α : Type u_2}
[DecidableEq α]
[SemilatticeInf α]
{u : Finset α}
{s t : Set α}

↑u ⊆ s ⊼ t → ∃ s' t', ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ s' ⊼ t'


/-- `Projective` implies `Stonean`. -/
@[simps!]
def toStonean (X : CompHaus.{u}) [Projective X] :
    Stonean

(X : CompHaus)
[CategoryTheory.Projective X]


theorem diff_mem_nhdsWithin_compl {x : α} {s : Set α} (hs : s ∈ 𝓝 x) (t : Set α) :
    s \ t ∈ 𝓝[tᶜ] x

{α : Type u_1}
[TopologicalSpace α]
{x : α}
{s : Set α}
(hs : s ∈ 𝓝 x)
(t : Set α)


@[simp]
theorem preimage_neg_Ioo : -Ioo a b = Ioo (-b) (-a)

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


@[simp]
theorem continuousLinearEquivOfBilin_apply (coercive : IsCoercive B) (v w : V) :
    ⟪coercive.continuousLinearEquivOfBilin v, w⟫_ℝ = B v w

{V : Type u}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[CompleteSpace V]
{B : V →L[ℝ] V →L[ℝ] ℝ}
(coercive : IsCoercive B)
(v w : V)

⟪coercive.continuousLinearEquivOfBilin v, w⟫_ℝ = (B v) w


@[to_additive (attr := simp)]
lemma _root_.Function.const_mul [Mul β] (a b : β) : const α a * const α b = const α (a * b)

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

Function.const α a + Function.const α b = Function.const α (a + b)


/-- If an isometric self-homeomorphism of a normed vector space over `ℝ` fixes `x` and `y`,
then it fixes the midpoint of `[x, y]`. This is a lemma for a more general Mazur-Ulam theorem,
see below. -/
theorem midpoint_fixed {x y : PE} :
    ∀ e : PE ≃ᵢ PE, e x = x → e y = y → e (midpoint ℝ x y) = midpoint ℝ x y

{E : Type u_1}
{PE : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MetricSpace PE]
[NormedAddTorsor E PE]
{x y : PE}
(e : PE ≃ᵢ PE)


lemma mul_log_nonpos {x : ℝ} (hx₀ : 0 ≤ x) (hx₁ : x ≤ 1) : x * log x ≤ 0


theorem nat_gcd_helper_dvd_left (x y : ℕ) (h : y % x = 0) : Nat.gcd x y = x


/-- If `f : R^n → R^m` is an `R`-linear map and `I ⊆ R` is an ideal, then the image of `I^n` is
    contained in `I^m`. -/
theorem map_pi {ι : Type*} [Finite ι] {ι' : Type w} (x : ι → R) (hi : ∀ i, x i ∈ I)
    (f : (ι → R) →ₗ[R] ι' → R) (i : ι') : f x i ∈ I

{R : Type u}
[CommRing R]
(I : Ideal R)
{ι : Type u_1}
[Finite ι]
{ι' : Type w}
(x : ι → R)
(hi : ∀ (i : ι), x i ∈ I)
(f : (ι → R) →ₗ[R] ι' → R)
(i : ι')


lemma baseChange_polynomial : (W.baseChange B).toAffine.polynomial =
    (W.baseChange A).toAffine.polynomial.map (mapRingHom f)

{R : Type r}
[CommRing R]
(W : WeierstrassCurve.Affine R)
{S : Type s}
[CommRing S]
[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)

(WeierstrassCurve.baseChange W B).toAffine.polynomial =
  Polynomial.map (Polynomial.mapRingHom ↑f) (WeierstrassCurve.baseChange W A).toAffine.polynomial


@[to_additive]
theorem lift.range_eq_closure : (lift f).range = Subgroup.closure (Set.range f)

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

(FreeAddGroup.lift f).range = AddSubgroup.closure (Set.range f)


theorem bsup_lt_ord_lift {o : Ordinal} {f : ∀ a < o, Ordinal} {c : Ordinal}
    (ho : Cardinal.lift.{v, u} o.card < c.cof) (hf : ∀ i hi, f i hi < c) : bsup.{u, v} o f < c

{f : (a : Ordinal.{u}) → a < o → Ordinal.{max u v}}

(hf : ∀ (i : Ordinal.{u}) (hi : i < o), f i hi < c)


/--
If the Frobenius morphism at `A` is an isomorphism, then the exponential comparison transformation
(at `A`) is an isomorphism.
-/
theorem expComparison_iso_of_frobeniusMorphism_iso (h : L ⊣ F) (A : C)
    [i : IsIso (frobeniusMorphism F h A)] : IsIso (expComparison F A)

[CategoryTheory.Limits.PreservesLimitsOfShape (CategoryTheory.Discrete CategoryTheory.Limits.WalkingPair) F]

[i : CategoryTheory.IsIso (CategoryTheory.frobeniusMorphism F h A)]

CategoryTheory.IsIso (CategoryTheory.expComparison F A)


theorem coe_toUnitHom (χ : MulChar R R') (a : Rˣ) : ↑(χ.toUnitHom a) = χ a

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommMonoidWithZero R']
(χ : MulChar R R')
(a : Rˣ)


theorem mdifferentiable_id : MDifferentiable I I (@id M)

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


@[simp]
theorem mergeSort_singleton (a : α) : [a].mergeSort r = [a]

{α : Type u}
(r : α → α → Prop)
[DecidableRel r]
(a : α)


theorem ofReal_cpow_of_nonpos {x : ℝ} (hx : x ≤ 0) (y : ℂ) :
    (x : ℂ) ^ y = (-x : ℂ) ^ y * exp (π * I * y)

↑x ^ y = (-↑x) ^ y * Complex.exp (↑π * Complex.I * y)


theorem roots_X_pow_char_sub_C_pow {y : R} {m : ℕ} :
    ((X ^ p - C y) ^ m).roots = (m * p) • {(frobeniusEquiv R p).symm y}

{R : Type u_1}
[CommRing R]
[IsDomain R]
{p : ℕ}
[ExpChar R p]
[PerfectRing R p]
{y : R}
{m : ℕ}

((Polynomial.X ^ p - Polynomial.C y) ^ m).roots = (m * p) • {(frobeniusEquiv R p).symm y}


lemma d₁_eq' {i₁ i₁' : I₁} (h : c₁.Rel i₁ i₁') (i₂ : I₂) (i₁₂ : I₁₂) :
    K.d₁ c₁₂ i₁ i₂ i₁₂ = ComplexShape.ε₁ c₁ c₂ c₁₂ ⟨i₁, i₂⟩ • ((K.d i₁ i₁').f i₂ ≫
      K.ιTotalOrZero c₁₂ i₁' i₂ i₁₂)

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Preadditive C]
{I₁ : Type u_2}
{I₂ : Type u_3}
{I₁₂ : Type u_4}
{c₁ : ComplexShape I₁}
{c₂ : ComplexShape I₂}
(K : HomologicalComplex₂ C c₁ c₂)
(c₁₂ : ComplexShape I₁₂)
[DecidableEq I₁₂]
[TotalComplexShape c₁ c₂ c₁₂]
[K.HasTotal c₁₂]
{i₁ i₁' : I₁}
(h : c₁.Rel i₁ i₁')
(i₂ : I₂)
(i₁₂ : I₁₂)

K.d₁ c₁₂ i₁ i₂ i₁₂ = c₁.ε₁ c₂ c₁₂ (i₁, i₂) • (K.d i₁ i₁').f i₂ ≫ K.ιTotalOrZero c₁₂ i₁' i₂ i₁₂


theorem Cauchy.mono' {f g : Filter α} (h_c : Cauchy f) (_ : NeBot g) (h_le : g ≤ f) : Cauchy g

{α : Type u}
[uniformSpace : UniformSpace α]
{f g : Filter α}
(h_c : Cauchy f)


/-- Induction principle on a type with a `SuccOrder` for all elements above a given element `m`. -/
@[elab_as_elim]
theorem Succ.rec {P : α → Prop} {m : α} (h0 : P m) (h1 : ∀ n, m ≤ n → P n → P (succ n)) ⦃n : α⦄
    (hmn : m ≤ n) : P n

(h1 : ∀ (n : α), m ≤ n → P n → P (Order.succ n))


@[simp]
theorem reverse_cons : reverse (x ::ᵥ xs) = (reverse xs).snoc x

{α : Type u_1}
{n : ℕ}
(xs : Mathlib.Vector α n)
{x : α}


@[simp]
theorem homCongr_symm {X₁ Y₁ X₂ Y₂ : C} (α : X₁ ≅ X₂) (β : Y₁ ≅ Y₂) :
    (α.homCongr β).symm = α.symm.homCongr β.symm

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


@[simp]
lemma unitsMap_self (n : ℕ) : unitsMap (dvd_refl n) = MonoidHom.id _

ZMod.unitsMap ⋯ = MonoidHom.id (ZMod n)ˣ


theorem uniformSpace_eq_iInf_precomp_of_cover {δ : ι → Type*} (φ : Π i, δ i → α)
    (h_cover : ∃ I : Set ι, I.Finite ∧ ⋃ i ∈ I, range (φ i) = univ) :
    𝒰(α, β, _) = ⨅ i, .comap (ofFun ∘ (· ∘ φ i) ∘ toFun) 𝒰(δ i, β, _)

(h_cover : ∃ I, I.Finite ∧ ⋃ i ∈ I, Set.range (φ i) = Set.univ)

UniformFun.uniformSpace α β =
  ⨅ i, UniformSpace.comap (⇑UniformFun.ofFun ∘ (fun x => x ∘ φ i) ∘ ⇑UniformFun.toFun) (UniformFun.uniformSpace (δ i) β)


theorem option_get {f : α → Option β} {h : ∀ a, (f a).isSome} :
    Primrec f → Primrec fun a => (f a).get (h a)

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{f : α → Option β}
{h : ∀ (a : α), (f a).isSome = true}

Primrec f → Primrec fun a => (f a).get ⋯


@[to_additive]
theorem le_mul_self : a ≤ b * a

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


@[simp]
theorem coeff_mk (n : ℕ) (f : ℕ → R) : coeff R n (mk f) = f n

{R : Type u_1}
[Semiring R]
(n : ℕ)
(f : ℕ → R)

(PowerSeries.coeff R n) (PowerSeries.mk f) = f n


/-- The function `fun x => (x - c)⁻¹` is integrable on `a..b` if and only if
`a = b` or `c ∉ [a, b]`. -/
@[simp]
theorem intervalIntegrable_sub_inv_iff {a b c : ℝ} :
    IntervalIntegrable (fun x => (x - c)⁻¹) volume a b ↔ a = b ∨ c ∉ [[a, b]]

IntervalIntegrable (fun x => (x - c)⁻¹) MeasureTheory.volume a b ↔ a = b ∨ c ∉ [[a, b]]


/-- `Prod.fst` maps neighborhood of `x : X × Y` within the section `Prod.snd ⁻¹' {x.2}`
to `𝓝 x.1`. -/
theorem map_fst_nhdsWithin (x : X × Y) : map Prod.fst (𝓝[Prod.snd ⁻¹' {x.2}] x) = 𝓝 x.1

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
(x : X × Y)

Filter.map Prod.fst (𝓝[Prod.snd ⁻¹' {x.2}] x) = 𝓝 x.1


@[simp]
theorem prodComm_symm : (prodComm X Y).symm = prodComm Y X

(X : Type u_1)
(Y : Type u_2)
[TopologicalSpace X]
[TopologicalSpace Y]

(Homeomorph.prodComm X Y).symm = Homeomorph.prodComm Y X


/-- A graded version of `NonUnitalNonAssocSemiring`. -/
class GNonUnitalNonAssocSemiring [Add ι] [∀ i, AddCommMonoid (A i)] extends
  GradedMonoid.GMul A where
  /-- Multiplication from the right with any graded component's zero vanishes. -/
  mul_zero : ∀ {i j} (a : A i), mul a (0 : A j) = 0
  /-- Multiplication from the left with any graded component's zero vanishes. -/
  zero_mul : ∀ {i j} (b : A j), mul (0 : A i) b = 0
  /-- Multiplication from the right between graded components distributes with respect to
  addition. -/
  mul_add : ∀ {i j} (a : A i) (b c : A j), mul a (b + c) = mul a b + mul a c
  /-- Multiplication from the left between graded components distributes with respect to
  addition. -/
  add_mul : ∀ {i j} (a b : A i) (c : A j), mul (a + b) c = mul a c + mul b c

[self : DirectSum.GNonUnitalNonAssocSemiring A]


theorem not_exists_eq : (¬ ∃ x, s x) = (∀ x, ¬ s x)


lemma closure_sUnion (S : Set (Set α)) : closure (⋃₀ S) = ⋃ s ∈ S, closure s

{α : Type u_3}
[TopologicalSpace α]
[AlexandrovDiscrete α]
(S : Set (Set α))


protected lemma Monotone.iInf (hf : ∀ i, Monotone (f i)) : Monotone (⨅ i, f i)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_9}
[Preorder α]
[CompleteLattice β]
{f : ι → α → β}
(hf : ∀ (i : ι), Monotone (f i))


protected lemma EventuallyLE.iInter [Finite ι] {s t : ι → Set α}
    (h : ∀ i, s i ≤ᶠ[l] t i) : (⋂ i, s i) ≤ᶠ[l] ⋂ i, t i

{α : Type u}
{ι : Sort x}
{l : Filter α}
[Finite ι]
{s t : ι → Set α}
(h : ∀ (i : ι), s i ≤ᶠ[l] t i)


@[simp]
theorem coe_mk' (f : A →ₐ[R] B) (h) :
    ((⟨f, h⟩ : A →⋆ₐ[R] B) : A → B) = f

(h : ∀ (x : A), (↑↑f.toRingHom).toFun (star x) = star ((↑↑f.toRingHom).toFun x))


lemma Spec.locallyRingedSpaceObj_presheaf_map (R : CommRingCat.{u}) {U V} (i : U ⟶ V) :
    (Spec.locallyRingedSpaceObj R).presheaf.map i =
    (structureSheaf R).1.map i

{U V : (TopologicalSpace.Opens ↑↑(AlgebraicGeometry.Spec.locallyRingedSpaceObj R).toPresheafedSpace)ᵒᵖ}

(AlgebraicGeometry.Spec.locallyRingedSpaceObj R).presheaf.map i = (AlgebraicGeometry.Spec.structureSheaf ↑R).val.map i


/-- The Schnirelmann density of `A` is `1` if and only if `A` contains all the positive naturals. -/
lemma schnirelmannDensity_eq_one_iff : schnirelmannDensity A = 1 ↔ {0}ᶜ ⊆ A

{A : Set ℕ}
[DecidablePred fun x => x ∈ A]


lemma pow_rpow_inv_natCast {n : ℕ} (hn : n ≠ 0) (x : ℝ≥0∞) : (x ^ n) ^ (n⁻¹ : ℝ) = x


@[to_additive]
theorem range_eq_image_mulTSupport_or (f : X → α) :
    range f = f '' mulTSupport f ∨ range f = insert 1 (f '' mulTSupport f)

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

Set.range f = f '' tsupport f ∨ Set.range f = insert 0 (f '' tsupport f)


/-- If a function `f` has a finite power series `p` on a ball and `g` is a continuous linear map,
then `g ∘ f` has the finite power series `g ∘ p` on the same ball. -/
theorem ContinuousLinearMap.comp_hasFiniteFPowerSeriesOnBall (g : F →L[𝕜] G)
    (h : HasFiniteFPowerSeriesOnBall f p x n r) :
    HasFiniteFPowerSeriesOnBall (g ∘ f) (g.compFormalMultilinearSeries p) x n r

HasFiniteFPowerSeriesOnBall (⇑g ∘ f) (g.compFormalMultilinearSeries p) x n r


theorem map_sup (f : A →⋆ₐ[R] B) (S T : StarSubalgebra R A) : map f (S ⊔ T) = map f S ⊔ map f T

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
[Semiring B]
[Algebra R B]
[StarRing B]
[StarModule R B]
(f : A →⋆ₐ[R] B)
(S T : StarSubalgebra R A)

StarSubalgebra.map f (S ⊔ T) = StarSubalgebra.map f S ⊔ StarSubalgebra.map f T


theorem AECover.integrable_of_integral_norm_tendsto [l.NeBot] [l.IsCountablyGenerated]
    {φ : ι → Set α} (hφ : AECover μ l φ) {f : α → E} (I : ℝ) (hfi : ∀ i, IntegrableOn f (φ i) μ)
    (htendsto : Tendsto (fun i => ∫ x in φ i, ‖f x‖ ∂μ) l (𝓝 I)) : Integrable f μ

(hfi : ∀ (i : ι), MeasureTheory.IntegrableOn f (φ i) μ)

(htendsto : Filter.Tendsto (fun i => ∫ (x : α) in φ i, ‖f x‖ ∂μ) l (𝓝 I))


@[simp]
theorem opAddEquiv_toEquiv [Add α] : ((opAddEquiv : α ≃+ αᵐᵒᵖ) : α ≃ αᵐᵒᵖ) = opEquiv


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


@[simp]
theorem denselyOrdered_iff [LT α] [LT β] :
    DenselyOrdered (α ⊕ β) ↔ DenselyOrdered α ∧ DenselyOrdered β

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


theorem ContinuousWithinAt.upperSemicontinuousWithinAt {f : α → γ} (h : ContinuousWithinAt f s x) :
    UpperSemicontinuousWithinAt f s x

{α : Type u_1}
[TopologicalSpace α]
{x : α}
{s : Set α}
{γ : Type u_3}
[LinearOrder γ]
[TopologicalSpace γ]
[OrderTopology γ]
{f : α → γ}
(h : ContinuousWithinAt f s x)


theorem coe_weightSpaceOf_zero (x : L) :
    ↑(weightSpaceOf M (0 : R) x) = ⨆ k, LinearMap.ker (toEnd R L M x ^ k)

{R : Type u_2}
{L : Type u_3}
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsNilpotent R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(x : L)

↑(LieModule.weightSpaceOf M 0 x) = ⨆ k, LinearMap.ker ((LieModule.toEnd R L M) x ^ k)


/-- The composition of `C^n` functions is `C^n`. -/
theorem ContMDiff.comp {g : M' → M''} (hg : ContMDiff I' I'' n g) (hf : ContMDiff I I' n f) :
    ContMDiff I I'' n (g ∘ f)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{E'' : Type u_8}
[NormedAddCommGroup E'']
[NormedSpace 𝕜 E'']
{H'' : Type u_9}
[TopologicalSpace H'']
{I'' : ModelWithCorners 𝕜 E'' H''}
{M'' : Type u_10}
[TopologicalSpace M'']
[ChartedSpace H'' M'']
{f : M → M'}
{n : ℕ∞}
{g : M' → M''}
(hg : ContMDiff I' I'' n g)
(hf : ContMDiff I I' n f)


theorem exists_seq_cover_iff_countable {p : Set α → Prop} (h : ∃ s, p s) :
    (∃ s : ℕ → Set α, (∀ n, p (s n)) ∧ ⋃ n, s n = univ) ↔
      ∃ S : Set (Set α), S.Countable ∧ (∀ s ∈ S, p s) ∧ ⋃₀ S = univ

{α : Type u}
{p : Set α → Prop}
(h : ∃ s, p s)

(∃ s, (∀ (n : ℕ), p (s n)) ∧ ⋃ n, s n = Set.univ) ↔ ∃ S, S.Countable ∧ (∀ s ∈ S, p s) ∧ ⋃₀ S = Set.univ


theorem universally_le (P : MorphismProperty C) : P.universally ≤ P

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


@[simp]
theorem smulRight_apply (f : MultilinearMap R M₁ R) (z : M₂) (m : ∀ i, M₁ i) :
    f.smulRight z m = f m • z

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[CommSemiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
(f : MultilinearMap R M₁ R)
(z : M₂)
(m : (i : ι) → M₁ i)


theorem revLex (ha : WellFounded r) (hb : WellFounded s) : WellFounded (RevLex r s)

{α : Sort u}
{β : Sort v}
{r : α → α → Prop}
{s : β → β → Prop}
(ha : WellFounded r)
(hb : WellFounded s)


@[simp]
theorem mk'_eq_mk' {p : Submodule R M} (x : M) :
    @Quotient.mk' _ (quotientRel p) x = (mk : M → M ⧸ p) x

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

Quotient.mk' x = Submodule.Quotient.mk x


@[simp]
theorem mem_keys_kerase_of_ne {a₁ a₂} {l : List (Sigma β)} (h : a₁ ≠ a₂) :
    a₁ ∈ (kerase a₂ l).keys ↔ a₁ ∈ l.keys

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

a₁ ∈ (List.kerase a₂ l).keys ↔ a₁ ∈ l.keys


@[simp]
theorem lift_tmul (f : A →ₐ[R] C) (g : B →ₐ[R] C)
    (h_anti_commutes : ∀ ⦃i j⦄ (a : 𝒜 i) (b : ℬ j), f a * g b = (-1 : ℤˣ)^(j * i) • (g b * f a))
    (a : A) (b : B) :
    lift 𝒜 ℬ f g h_anti_commutes (a ᵍ⊗ₜ b) = f a * g b

(h_anti_commutes : ∀ ⦃i j : ι⦄ (a : ↥(𝒜 i)) (b : ↥(ℬ j)), f ↑a * g ↑b = (-1) ^ (j * i) • (g ↑b * f ↑a))

(GradedTensorProduct.lift 𝒜 ℬ f g h_anti_commutes) (a ᵍ⊗ₜ[R] b) = f a * g b


/-- In an algebraic language, any injective homomorphism is an embedding. -/
@[simps!]
def ofInjective [L.IsAlgebraic] {f : M →[L] N} (hf : Function.Injective f) : M ↪[L] N

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
[L.IsAlgebraic]
{f : L.Hom M N}
(hf : Function.Injective ⇑f)

∀ (a : M), (FirstOrder.Language.Embedding.ofInjective hf) a = f a


@[simp]
theorem destutter_singleton : destutter R [a] = [a]

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


@[simp]
theorem mem_permutations' {s t : List α} : s ∈ permutations' t ↔ s ~ t


@[simp] theorem mod_zero : ∀ a : Int, mod a 0 = a


theorem center_le_radical : center R L ≤ radical R L

(R : Type u)
(L : Type v)
[CommRing R]
[LieRing L]
[LieAlgebra R L]

LieAlgebra.center R L ≤ LieAlgebra.radical R L


theorem image_const_add_uIcc : (fun x => a + x) '' [[b, c]] = [[a + b, a + c]]

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


@[simp, norm_cast]
theorem coe_smul [Monoid γ] [∀ i, AddMonoid (β i)] [∀ i, DistribMulAction γ (β i)] (b : γ)
    (v : Π₀ i, β i) : ⇑(b • v) = b • ⇑v

{ι : Type u}
{γ : Type w}
{β : ι → Type v}
[Monoid γ]
[(i : ι) → AddMonoid (β i)]
[(i : ι) → DistribMulAction γ (β i)]
(b : γ)
(v : Π₀ (i : ι), β i)


theorem atBot_hasCountableBasis_of_archimedean [LinearOrderedRing R] [Archimedean R] :
    (atBot : Filter R).HasCountableBasis (fun _ : ℤ => True) fun m => Iic m

{R : Type u_2}
[LinearOrderedRing R]
[Archimedean R]

Filter.atBot.HasCountableBasis (fun x => True) fun m => Set.Iic ↑m


theorem exists_countable_dense_no_zero_top :
    ∃ s : Set ℝ≥0∞, s.Countable ∧ Dense s ∧ 0 ∉ s ∧ ∞ ∉ s

∃ s, s.Countable ∧ Dense s ∧ 0 ∉ s ∧ ⊤ ∉ s


theorem hasBasis_nhdsSet_Iic_Iic (a : α) [NeBot (𝓝[>] a)] :
    HasBasis (𝓝ˢ (Iic a)) (a < ·) Iic

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
(a : α)
[(𝓝[>] a).NeBot]

(𝓝ˢ (Set.Iic a)).HasBasis (fun x => a < x) Set.Iic


@[simp]
theorem isAtomic_dual_iff_isCoatomic [OrderTop α] : IsAtomic αᵒᵈ ↔ IsCoatomic α

{α : Type u_2}
[PartialOrder α]
[OrderTop α]


lemma card_eq_card_finite_toFinset {s : Set α} (hs : s.Finite) : Nat.card s = hs.toFinset.card

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


protected theorem Decidable.exists_ne [Nontrivial α] [DecidableEq α] (x : α) : ∃ y, y ≠ x

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


/-- A bimodule object for a pair of monoid objects, all internal to some monoidal category. -/
structure Bimod (A B : Mon_ C) where
  X : C
  actLeft : A.X ⊗ X ⟶ X
  one_actLeft : (A.one ▷ X) ≫ actLeft = (λ_ X).hom := by aesop_cat
  left_assoc :
    (A.mul ▷ X) ≫ actLeft = (α_ A.X A.X X).hom ≫ (A.X ◁ actLeft) ≫ actLeft := by aesop_cat
  actRight : X ⊗ B.X ⟶ X
  actRight_one : (X ◁ B.one) ≫ actRight = (ρ_ X).hom := by aesop_cat
  right_assoc :
    (X ◁ B.mul) ≫ actRight = (α_ X B.X B.X).inv ≫ (actRight ▷ B.X) ≫ actRight := by
    aesop_cat
  middle_assoc :
    (actLeft ▷ B.X) ≫ actRight = (α_ A.X X B.X).hom ≫ (A.X ◁ actRight) ≫ actLeft := by
    aesop_cat

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{A B : Mon_ C}
(self : Bimod A B)

A.mul ▷ self.X ≫ self.actLeft = (α_ A.X A.X self.X).hom ≫ A.X ◁ self.actLeft ≫ self.actLeft


theorem Tendsto.atTop_of_mul_const {c : α} (hc : 0 < c) (hf : Tendsto (fun x => f x * c) l atTop) :
    Tendsto f l atTop

(hf : Filter.Tendsto (fun x => f x * c) l Filter.atTop)


theorem surjOn_iff_exists_map_subtype :
    SurjOn f s t ↔ ∃ (t' : Set β) (g : s → t'), t ⊆ t' ∧ Surjective g ∧ ∀ x : s, f x = g x

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}

Set.SurjOn f s t ↔ ∃ t' g, t ⊆ t' ∧ Function.Surjective g ∧ ∀ (x : ↑s), f ↑x = ↑(g x)


/-- If a compact operator preserves a complete submodule, its restriction to that submodule is
compact.

Note that, following mathlib's convention in linear algebra, `restrict` designates the restriction
of an endomorphism `f : E →ₗ E` to an endomorphism `f' : ↥V →ₗ ↥V`. To prove that the restriction
`f' : ↥U →ₛₗ ↥V` of a compact operator `f : E →ₛₗ F` is compact, apply
`IsCompactOperator.codRestrict` to `f ∘ U.subtypeL`, which is compact by
`IsCompactOperator.comp_clm`. -/
theorem IsCompactOperator.restrict' [T0Space M₂] {f : M₂ →ₗ[R₂] M₂}
    (hf : IsCompactOperator f) {V : Submodule R₂ M₂} (hV : ∀ v ∈ V, f v ∈ V)
    [hcomplete : CompleteSpace V] : IsCompactOperator (f.restrict hV)

{R₂ : Type u_2}
[Semiring R₂]
{M₂ : Type u_5}
[UniformSpace M₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
[T0Space M₂]
{f : M₂ →ₗ[R₂] M₂}
(hf : IsCompactOperator ⇑f)
{V : Submodule R₂ M₂}
(hV : ∀ v ∈ V, f v ∈ V)
[hcomplete : CompleteSpace ↥V]


/-- Category structure on the oplax natural transformations between OplaxFunctors. -/
@[simps]
instance category (F G : OplaxFunctor B C) : Category (F ⟶ G)

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F G : CategoryTheory.OplaxFunctor B C)

∀ {X Y Z : F ⟶ G} (Γ : CategoryTheory.OplaxNatTrans.Modification X Y)
  (Δ : CategoryTheory.OplaxNatTrans.Modification Y Z), CategoryTheory.CategoryStruct.comp Γ Δ = Γ.vcomp Δ


theorem forIn_eq_bindList [Monad m] [LawfulMonad m]
    (f : α → β → m (ForInStep β)) (l : List α) (init : β) :
    forIn l init f = ForInStep.run <$> (ForInStep.yield init).bindList f l

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

forIn l init f = ForInStep.run <$> ForInStep.bindList f l (ForInStep.yield init)


theorem restriction_iff_exists : (N ≤r M) ↔ ∃ R, R ⊆ M.E ∧ N = M ↾ R

N.Restriction M ↔ ∃ R ⊆ M.E, N = M.restrict R


@[simp] theorem empty_right (s : Set X) : SeparatedNhds s ∅

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


lemma mk_eq {x y : X} : mk x = mk y ↔ ∀ s : Setoid X, T2Space (Quotient s) → s.Rel x y

{X : Type u_1}
[TopologicalSpace X]
{x y : X}

t2Quotient.mk x = t2Quotient.mk y ↔ ∀ (s : Setoid X), T2Space (Quotient s) → s.Rel x y


protected theorem Decidable.or_not_of_imp [Decidable a] (h : a → b) : b ∨ ¬a


@[simp, norm_cast]
theorem hasSum_ofReal {f : α → ℝ} {x : ℝ} : HasSum (fun x => (f x : ℂ)) x ↔ HasSum f x

HasSum (fun x => ↑(f x)) ↑x ↔ HasSum f x


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

{α : Type u_1}
[MeasurableSpace α]
{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[MeasurableSpace E]
[BorelSpace E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{φ : α → F →L[𝕜] E}
(hφ : Measurable φ)
(v : F)


@[to_additive]
theorem norm_div_eq_zero_iff : ‖a / b‖ = 0 ↔ a = b

{E : Type u_6}
[NormedAddGroup E]
{a b : E}


theorem indep_iSup_of_directed_le {Ω} {m : ι → MeasurableSpace Ω} {m' m0 : MeasurableSpace Ω}
    {κ : Kernel α Ω} {μ : Measure α} [IsMarkovKernel κ] (h_indep : ∀ i, Indep (m i) m' κ μ)
    (h_le : ∀ i, m i ≤ m0) (h_le' : m' ≤ m0) (hm : Directed (· ≤ ·) m) :
    Indep (⨆ i, m i) m' κ μ

(h_indep : ∀ (i : ι), ProbabilityTheory.Kernel.Indep (m i) m' κ μ)

(hm : Directed (fun x x_1 => x ≤ x_1) m)

ProbabilityTheory.Kernel.Indep (⨆ i, m i) m' κ μ


theorem coe_πs (o : Ordinal) (f : LocallyConstant (π C (ord I · < o)) ℤ) :
    πs C o f = f ∘ ProjRestrict C (ord I · < o)

(f : LocallyConstant ↑(Profinite.NobelingProof.π C fun x => Profinite.NobelingProof.ord I x < o) ℤ)

⇑((Profinite.NobelingProof.πs C o) f) =
  ⇑f ∘ Profinite.NobelingProof.ProjRestrict C fun x => Profinite.NobelingProof.ord I x < o


@[simp]
theorem trop_zsmul [AddGroup R] (x : R) (n : ℤ) : trop (n • x) = trop x ^ n

{R : Type u}
[AddGroup R]
(x : R)
(n : ℤ)

Tropical.trop (n • x) = Tropical.trop x ^ n


@[simp]
theorem top_ne_coe : ⊤ ≠ (a : WithTop α)


theorem vecMul_smul [Fintype n] [Monoid R] [NonUnitalNonAssocSemiring S] [DistribMulAction R S]
    [IsScalarTower R S S] (M : Matrix n m S) (b : R) (v : n → S) :
    (b • v) ᵥ* M = b • v ᵥ* M

{m : Type u_2}
{n : Type u_3}
{R : Type u_7}
{S : Type u_8}
[Fintype n]
[Monoid R]
[NonUnitalNonAssocSemiring S]
[DistribMulAction R S]
[IsScalarTower R S S]
(M : Matrix n m S)
(b : R)
(v : n → S)


/-- If the angle between three points is `-π / 2`, the first two points are not equal. -/
theorem left_ne_of_oangle_eq_neg_pi_div_two {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ = (-π / 2 : ℝ)) :
    p₁ ≠ p₂

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


theorem inv_eq_iff_mul_eq_one {φ ψ : k⟦X⟧} (h : constantCoeff k ψ ≠ 0) :
    ψ⁻¹ = φ ↔ φ * ψ = 1

(h : (PowerSeries.constantCoeff k) ψ ≠ 0)

ψ⁻¹ = φ ↔ φ * ψ = 1


theorem iInf_mono' {g : ι' → α} (h : ∀ i', ∃ i, f i ≤ g i') : iInf f ≤ iInf g

{α : Type u_1}
{ι : Sort u_5}
{ι' : Sort u_6}
[CompleteLattice α]
{f : ι → α}
{g : ι' → α}
(h : ∀ (i' : ι'), ∃ i, f i ≤ g i')


theorem lt_next (s : Substring) (i : String.Pos) (h : i.1 < s.bsize) :
    i.1 < (s.next i).1

(s : Substring)
(i : String.Pos)
(h : i.byteIdx < s.bsize)


/-- Every function is Lipschitz on the empty set (with any Lipschitz constant). -/
@[simp]
theorem lipschitzOnWith_empty (K : ℝ≥0) (f : α → β) : LipschitzOnWith K f ∅

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(K : ℝ≥0)
(f : α → β)


/-- Assumes left covariance. -/
theorem Left.mul_nonneg [PosMulMono α] (ha : 0 ≤ a) (hb : 0 ≤ b) : 0 ≤ a * b

{α : Type u_1}
{a b : α}
[MulZeroClass α]
[Preorder α]
[PosMulMono α]
(ha : 0 ≤ a)
(hb : 0 ≤ b)


/-- An auxiliary version of the layer cake formula (Cavalieri's principle, tail probability
formula), with a measurability assumption that would also essentially follow from the
integrability assumptions.
Compared to `lintegral_comp_eq_lintegral_meas_le_mul_of_measurable_of_sigmaFinite`, we remove
the sigma-finite assumption.

See `MeasureTheory.lintegral_comp_eq_lintegral_meas_le_mul` and
`MeasureTheory.lintegral_comp_eq_lintegral_meas_lt_mul` for the main formulations of the layer
cake formula. -/
theorem lintegral_comp_eq_lintegral_meas_le_mul_of_measurable (μ : Measure α)
    (f_nn : 0 ≤ f) (f_mble : Measurable f)
    (g_intble : ∀ t > 0, IntervalIntegrable g volume 0 t) (g_mble : Measurable g)
    (g_nn : ∀ t > 0, 0 ≤ g t) :
    ∫⁻ ω, ENNReal.ofReal (∫ t in (0)..f ω, g t) ∂μ =
      ∫⁻ t in Ioi 0, μ {a : α | t ≤ f a} * ENNReal.ofReal (g t)

(g_intble : ∀ t > 0, IntervalIntegrable g MeasureTheory.volume 0 t)

∫⁻ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) ∂μ =
  ∫⁻ (t : ℝ) in Set.Ioi 0, μ {a | t ≤ f a} * ENNReal.ofReal (g t)


@[to_additive]
theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fintype.card α) :
    IsCyclic α

{α : Type u}
[AddGroup α]
[Fintype α]
(x : α)
(hx : addOrderOf x = Fintype.card α)


theorem tangentMapWithin_congr (h : ∀ x ∈ s, f x = f₁ x) (p : TangentBundle I M) (hp : p.1 ∈ s)
    (hs : UniqueMDiffWithinAt I s p.1) :
    tangentMapWithin I I' f s p = tangentMapWithin I I' f₁ s p

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f f₁ : M → M'}
{s : Set M}
[Is : SmoothManifoldWithCorners I M]
[I's : SmoothManifoldWithCorners I' M']
(h : ∀ x ∈ s, f x = f₁ x)
(p : TangentBundle I M)
(hp : p.proj ∈ s)
(hs : UniqueMDiffWithinAt I s p.proj)


lemma succAbove_succ_of_lt (p i : Fin n) (h : p < i) : succAbove p.succ i = i.succ


theorem ceil_sub_self_eq (ha : fract a ≠ 0) : (⌈a⌉ : α) - a = 1 - fract a

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
{a : α}
(ha : Int.fract a ≠ 0)


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

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


theorem isSimpleOrder_iff_isAtom_top [PartialOrder α] [BoundedOrder α] :
    IsSimpleOrder α ↔ IsAtom (⊤ : α)

{α : Type u_2}
[PartialOrder α]
[BoundedOrder α]


/-- **Chebyshev's Sum Inequality**: When `f` and `g` antivary together (eg one is monotone, the
other is antitone), the scalar product of their sum is less than the size of the set times their
scalar product. -/
theorem AntivaryOn.card_smul_sum_le_sum_smul_sum (hfg : AntivaryOn f g s) :
    (s.card • ∑ i ∈ s, f i • g i) ≤ (∑ i ∈ s, f i) • ∑ i ∈ s, g i

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{s : Finset ι}
{f : ι → α}
{g : ι → β}
(hfg : AntivaryOn f g ↑s)

s.card • ∑ i ∈ s, f i • g i ≤ (∑ i ∈ s, f i) • ∑ i ∈ s, g i


@[to_additive (attr := simp)]
theorem preimage_mul_left_singleton : (a * ·) ⁻¹' {b} = {a⁻¹ * b}


@[simp]
theorem units_sq (u : ℤˣ) : u ^ 2 = 1


@[simp]
theorem mem_insert {a a'} {b' : β a'} (s : AList β) : a ∈ insert a' b' s ↔ a = a' ∨ a ∈ s

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a a' : α}
{b' : β a'}
(s : AList β)

a ∈ AList.insert a' b' s ↔ a = a' ∨ a ∈ s


@[to_additive]
theorem mulSupport_curry' (f : α × β → M) :
    (mulSupport fun a b ↦ f (a, b)) = (mulSupport f).image Prod.fst

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

(Function.mulSupport fun a b => f (a, b)) = Prod.fst '' Function.mulSupport f


/-- The identity function as a closure operator. -/
@[simps!]
def id : ClosureOperator α

∀ (x : α), (ClosureOperator.id α).IsClosed x = True


theorem Factors.ramificationIdx_ne_zero (P : (factors (map (algebraMap R S) p)).toFinset) :
    ramificationIdx (algebraMap R S) p P ≠ 0

(P : { x // x ∈ (UniqueFactorizationMonoid.factors (Ideal.map (algebraMap R S) p)).toFinset })

Ideal.ramificationIdx (algebraMap R S) p ↑P ≠ 0


theorem extChartAt_target_subset_range (x : M) : (extChartAt I x).target ⊆ 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]
(I : ModelWithCorners 𝕜 E H)
[ChartedSpace H M]
(x : M)


@[simp]
theorem mvPolynomial_aeval_coe (S : Subalgebra R A) (x : σ → S) (p : MvPolynomial σ R) :
    aeval (fun i => (x i : A)) p = aeval x p

{R : Type u_1}
{A : Type u_2}
{σ : Type u_4}
[CommSemiring R]
[CommSemiring A]
[Algebra R A]
(S : Subalgebra R A)
(x : σ → ↥S)
(p : MvPolynomial σ R)

(MvPolynomial.aeval fun i => ↑(x i)) p = ↑((MvPolynomial.aeval x) p)


theorem isUnit_det_transpose (h : IsUnit A.det) : IsUnit Aᵀ.det

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(A : Matrix n n α)
(h : IsUnit A.det)


theorem ord_cof_eq (r : α → α → Prop) [IsWellOrder α r] :
    ∃ S, Unbounded r S ∧ type (Subrel r S) = (cof (type r)).ord

{α : Type u_1}
(r : α → α → Prop)
[IsWellOrder α r]

∃ S, Set.Unbounded r S ∧ Ordinal.type (Subrel r S) = (Ordinal.type r).cof.ord


/-- Category structure on the oplax natural transformations between OplaxFunctors. -/
@[simps]
instance category (F G : OplaxFunctor B C) : Category (F ⟶ G)

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F G : CategoryTheory.OplaxFunctor B C)
(η : F ⟶ G)

CategoryTheory.CategoryStruct.id η = CategoryTheory.OplaxNatTrans.Modification.id η


theorem coeff_apply_le (h : IsAdjoinRootMonic S f) (z : S) (i : ℕ) (hi : natDegree f ≤ i) :
    h.coeff z i = 0

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRootMonic S f)
(z : S)
(i : ℕ)
(hi : f.natDegree ≤ i)


/-- A class for `𝕜`-algebras with a partial order where the ordering is compatible with the
(quasi)spectrum. -/
class NonnegSpectrumClass (𝕜 A : Type*) [OrderedCommSemiring 𝕜] [NonUnitalRing A] [PartialOrder A]
    [Module 𝕜 A] : Prop where
  quasispectrum_nonneg_of_nonneg : ∀ a : A, 0 ≤ a → ∀ x ∈ quasispectrum 𝕜 a, 0 ≤ x

{𝕜 : Type u_3}
{A : Type u_4}
[OrderedCommSemiring 𝕜]
[NonUnitalRing A]
[PartialOrder A]
[Module 𝕜 A]
[self : NonnegSpectrumClass 𝕜 A]
(a : A)


/-- The natural isomorphism `toKaroubi (SimplicialObject C) ≅ N₁ ⋙ Γ₂`. -/
@[simps! inv]
def Γ₂N₁ : toKaroubi _ ≅ (N₁ : SimplicialObject C ⥤ _) ⋙ Γ₂


@[to_additive]
theorem div_const [Div γ] [MeasurableDiv γ] (h : IdentDistrib f g μ ν) (c : γ) :
    IdentDistrib (fun x => f x / c) (fun x => g x / c) μ ν

(h : ProbabilityTheory.IdentDistrib f g μ ν)

ProbabilityTheory.IdentDistrib (fun x => f x - c) (fun x => g x - c) μ ν


protected theorem rel_equiv : _root_.Equivalence (FilteredColimit.Rel.{v, u} F)

{J : Type v}
[CategoryTheory.Category.{w, v} J]
(F : J ⥤ Type u)
[CategoryTheory.IsFilteredOrEmpty J]


/-- Bifunctor. This typeclass asserts that a lawless bitraversable bifunctor is lawful. -/
class LawfulBitraversable (t : Type u → Type u → Type u) [Bitraversable t] extends
  LawfulBifunctor t : Prop where
  -- Porting note: need to specify `m := Id` because `id` no longer has a `Monad` instance
  id_bitraverse : ∀ {α β} (x : t α β), bitraverse (m := Id) pure pure x = pure x
  comp_bitraverse :
    ∀ {F G} [Applicative F] [Applicative G] [LawfulApplicative F] [LawfulApplicative G]
      {α α' β β' γ γ'} (f : β → F γ) (f' : β' → F γ') (g : α → G β) (g' : α' → G β') (x : t α α'),
      bitraverse (Comp.mk ∘ map f ∘ g) (Comp.mk ∘ map f' ∘ g') x =
        Comp.mk (bitraverse f f' <$> bitraverse g g' x)
  bitraverse_eq_bimap_id :
    ∀ {α α' β β'} (f : α → β) (f' : α' → β') (x : t α α'),
      bitraverse (m := Id) (pure ∘ f) (pure ∘ f') x = pure (bimap f f' x)
  binaturality :
    ∀ {F G} [Applicative F] [Applicative G] [LawfulApplicative F] [LawfulApplicative G]
      (η : ApplicativeTransformation F G) {α α' β β'} (f : α → F β) (f' : α' → F β') (x : t α α'),
      η (bitraverse f f' x) = bitraverse (@η _ ∘ f) (@η _ ∘ f') x

{t : Type u → Type u → Type u}
[Bitraversable t]
[self : LawfulBitraversable t]
{α β : Type u}
(x : t α β)


lemma setOf_apply_symm_eq_image_setOf {α β} (e : α ≃ β) (p : α → Prop) :
    {b | p (e.symm b)} = e '' {a | p a}

{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)
(p : α → Prop)


lemma quasiIso_iff_of_arrow_mk_iso (φ : S₁ ⟶ S₂) (φ' : S₃ ⟶ S₄) (e : Arrow.mk φ ≅ Arrow.mk φ') :
    QuasiIso φ ↔ QuasiIso φ'

{S₁ S₂ S₃ S₄ : CategoryTheory.ShortComplex C}

(e : CategoryTheory.Arrow.mk φ ≅ CategoryTheory.Arrow.mk φ')

CategoryTheory.ShortComplex.QuasiIso φ ↔ CategoryTheory.ShortComplex.QuasiIso φ'


theorem dz_val : ↑(d a1) = az a * az a - 1

↑(Pell.d a1) = Pell.az a * Pell.az a - 1


@[to_additive]
theorem pi_bot : (pi Set.univ fun i => (⊥ : Subgroup (f i))) = ⊥

{η : Type u_7}
{f : η → Type u_8}
[(i : η) → AddGroup (f i)]

(AddSubgroup.pi Set.univ fun i => ⊥) = ⊥


@[simp]
theorem tensor_apply {W X Y Z : Type u} (f : W ⟶ X) (g : Y ⟶ Z) (p : W ⊗ Y) :
    (f ⊗ g) p = (f p.1, g p.2)


@[simp]
theorem skewAdjointLieSubalgebraEquiv_symm_apply (f : skewAdjointLieSubalgebra B) :
    ↑((skewAdjointLieSubalgebraEquiv B e).symm f) = e.symm.lieConj f

{R : Type u}
{M : Type v}
[CommRing R]
[AddCommGroup M]
[Module R M]
(B : LinearMap.BilinForm R M)
{N : Type w}
[AddCommGroup N]
[Module R N]
(e : N ≃ₗ[R] M)
(f : ↥(skewAdjointLieSubalgebra B))

↑((skewAdjointLieSubalgebraEquiv B e).symm f) = e.symm.lieConj ↑f


lemma invOf_smul_eq_iff : ⅟c • x = y ↔ x = c • y

{α : Type u_1}
{β : Type u_2}
[Monoid α]
[MulAction α β]
{c : α}
{x y : β}
[Invertible c]


/-- Multiplying the second vector passed to `oangle` by a nonzero real does not change twice the
angle. -/
@[simp]
theorem two_zsmul_oangle_smul_right_of_ne_zero (x y : V) {r : ℝ} (hr : r ≠ 0) :
    (2 : ℤ) • o.oangle x (r • y) = (2 : ℤ) • o.oangle x y

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

2 • o.oangle x (r • y) = 2 • o.oangle x y


theorem rel_iff {x y z w : α} : Rel α (x, y) (z, w) ↔ x = z ∧ y = w ∨ x = w ∧ y = z

Sym2.Rel α (x, y) (z, w) ↔ x = z ∧ y = w ∨ x = w ∧ y = z


@[to_additive (attr := simp 1001)]
-- Porting note: increase priority so that the left-hand side doesn't simplify
theorem preimage_mul_closedBall (a b : E) (r : ℝ) :
    (b * ·) ⁻¹' closedBall a r = closedBall (a / b) r

{E : Type u_6}
[SeminormedAddCommGroup E]
(a b : E)
(r : ℝ)

(fun x => b + x) ⁻¹' Metric.closedBall a r = Metric.closedBall (a - b) r


theorem right_bot_eq_right_quot (H : Subgroup G) :
    Quotient (H.1 : Set G) (⊥ : Subgroup G) = _root_.Quotient (QuotientGroup.rightRel H)

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

Doset.Quotient ↑H.toSubmonoid ↑⊥ = Quotient (QuotientGroup.rightRel H)


theorem inf_covBy_of_covBy_sup_right : b ⋖ a ⊔ b → a ⊓ b ⋖ a

{α : Type u_1}
[Lattice α]
[IsLowerModularLattice α]
{a b : α}


theorem Stable.inter_left [IsNoetherianRing R] [Module.Finite R M] (hF : F.Stable) :
    (F' ⊓ F).Stable

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
{I : Ideal R}
{F : I.Filtration M}
(F' : I.Filtration M)
[IsNoetherianRing R]
[Module.Finite R M]
(hF : F.Stable)


/-- Functor translating a commutative monoid object in a functor category
to a functor into the category of commutative monoid objects.
-/
@[simps!]
def functor : CommMon_ (C ⥤ D) ⥤ C ⥤ CommMon_ D

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

∀ {X Y : CommMon_ (C ⥤ D)} (f : X ⟶ Y) (X_1 : C),
  ((CategoryTheory.Monoidal.CommMonFunctorCategoryEquivalence.functor.map f).app X_1).hom = f.hom.app X_1


theorem inv_strictAnti : StrictAnti (Inv.inv : ℝ≥0∞ → ℝ≥0∞)


protected theorem eta (s : Stream' α) : (head s::tail s) = s


@[simp] lemma infClosed_preimage_ofDual {s : Set α} :
    InfClosed (ofDual ⁻¹' s) ↔ SupClosed s

InfClosed (⇑OrderDual.ofDual ⁻¹' s) ↔ SupClosed s


/-- All values are accessible under the well-founded `<`. -/
theorem apply : ∀ a : α, Acc (· < ·) a

{α : Type u}
[LT α]
[WellFoundedLT α]
(a : α)


@[simp]
theorem iInf_neg {p : Prop} {f : p → α} (hp : ¬p) : ⨅ h : p, f h = ⊤

{α : Type u_1}
[CompleteLattice α]
{p : Prop}
{f : p → α}
(hp : ¬p)


@[simp]
theorem eventually_top {p : α → Prop} : (∀ᶠ x in ⊤, p x) ↔ ∀ x, p x


/-- The neighbourhood filter of an invertible element consists of all sets containing that
element. -/
theorem nhds_coe_units (γ : Γ₀ˣ) : 𝓝 (γ : Γ₀) = pure (γ : Γ₀)

{Γ₀ : Type u_2}
[LinearOrderedCommGroupWithZero Γ₀]
(γ : Γ₀ˣ)

𝓝 ↑γ = pure ↑γ


theorem StrictAntiOn.comp_strictMonoOn [Preorder α] [Preorder β] [Preorder γ] {g : β → γ}
    {f : α → β} {s : Set α} {t : Set β} (hg : StrictAntiOn g t) (hf : StrictMonoOn f s)
    (hs : Set.MapsTo f s t) : StrictAntiOn (g ∘ f) s

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Preorder α]
[Preorder β]
[Preorder γ]
{g : β → γ}
{f : α → β}
{s : Set α}
{t : Set β}
(hg : StrictAntiOn g t)
(hf : StrictMonoOn f s)
(hs : Set.MapsTo f s t)


theorem mk_compl_finset_of_infinite {α : Type*} [Infinite α] (s : Finset α) :
    #((↑s)ᶜ : Set α) = #α

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


@[to_additive dite_pos]
lemma one_lt_dite [LT α] (ha : ∀ h, 1 < a h) (hb : ∀ h, 1 < b h) : 1 < dite p a b

{α : Type u_2}
[One α]
{p : Prop}
[Decidable p]
{a : p → α}
{b : ¬p → α}
[LT α]
(ha : ∀ (h : p), 1 < a h)
(hb : ∀ (h : ¬p), 1 < b h)


theorem unit_map_eq (u : Rˣ) : (Units.map (v : R →* Γ₀) u : Γ₀) = v u

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedCommMonoidWithZero Γ₀]
(v : Valuation R Γ₀)
(u : Rˣ)


@[simp]
theorem inl_neg [Neg R] [SubNegZeroMonoid M] (r : R) : (inl (-r) : tsze R M) = -inl r

{R : Type u}
(M : Type v)
[Neg R]
[SubNegZeroMonoid M]
(r : R)

TrivSqZeroExt.inl (-r) = -TrivSqZeroExt.inl r


@[simp]
theorem symm_toHomotopyEquiv (h : X ≃ₜ Y) : h.symm.toHomotopyEquiv = h.toHomotopyEquiv.symm

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
(h : X ≃ₜ Y)


theorem inr_le_inr_iff [LE α] [LE β] {a b : β} : toLex (inr a : α ⊕ β) ≤ toLex (inr b) ↔ a ≤ b

{α : Type u_1}
{β : Type u_2}
[LE α]
[LE β]
{a b : β}

toLex (Sum.inr a) ≤ toLex (Sum.inr b) ↔ a ≤ b


theorem tan_eq_of_two_nsmul_eq {θ ψ : Angle} (h : (2 : ℕ) • θ = (2 : ℕ) • ψ) : tan θ = tan ψ


@[simp]
theorem mk_eq_mk : mk x = mk y ↔ (x ~ᵢ y)

{X : Type u_1}
[TopologicalSpace X]
{x y : X}

SeparationQuotient.mk x = SeparationQuotient.mk y ↔ (x ~ᵢ y)


theorem unbounded_lt_iff_unbounded_le [Preorder α] [NoMaxOrder α] :
    Unbounded (· < ·) s ↔ Unbounded (· ≤ ·) s

{α : Type u_1}
{s : Set α}
[Preorder α]
[NoMaxOrder α]

Set.Unbounded (fun x x_1 => x < x_1) s ↔ Set.Unbounded (fun x x_1 => x ≤ x_1) s


theorem zero_apply [Zero β] : (0 : C_c(α, β)) x = 0

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
(x : α)
[Zero β]


@[simp] theorem map_inr (f : α → α') (g : β → β') (x : β) : (inr x).map f g = inr (g x)

{α : Type u_1}
{α' : Type u_2}
{β : Type u_3}
{β' : Type u_4}
(f : α → α')
(g : β → β')
(x : β)


theorem K'.elim_rev (a b c d) : K'.elim a b c d K'.rev = b

Turing.PartrecToTM2.K'.elim a b c d Turing.PartrecToTM2.K'.rev = b


@[simp]
theorem coe_inclusion (h : p ≤ p') (x : p) : (inclusion h x : M) = x

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{p p' : Submodule R M}
(h : p ≤ p')
(x : ↥p)


@[simp]
theorem supported_le_supported_iff [Nontrivial R] : supported R s ≤ supported R t ↔ s ⊆ t

{σ : Type u_1}
{R : Type u}
[CommSemiring R]
{s t : Set σ}
[Nontrivial R]

MvPolynomial.supported R s ≤ MvPolynomial.supported R t ↔ s ⊆ t


/-- For a functor `F : C ⥤ D` and an object `d : D`, we obtain a contravariant functor from the
category of structured arrows `d ⟶ F.obj c` to the category of costructured arrows
`F.op.obj c ⟶ (op d)`.
-/
@[simps]
def toCostructuredArrow (F : C ⥤ D) (d : D) :
    (StructuredArrow d F)ᵒᵖ ⥤ CostructuredArrow F.op (op d)

(X : (CategoryTheory.StructuredArrow d F)ᵒᵖ)

(CategoryTheory.StructuredArrow.toCostructuredArrow F d).obj X =
  CategoryTheory.CostructuredArrow.mk (Opposite.unop X).hom.op


theorem factorial_mul_factorial_dvd_factorial_add (i j : ℕ) : i ! * j ! ∣ (i + j)!


@[simp] theorem runCatch_lift {α : Type u} [Monad m] [LawfulMonad m] (x : m α) : runCatch (ExceptCpsT.lift x : ExceptCpsT α m α) = x

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


theorem Sum.isConnected_iff [TopologicalSpace β] {s : Set (α ⊕ β)} :
    IsConnected s ↔
      (∃ t, IsConnected t ∧ s = Sum.inl '' t) ∨ ∃ t, IsConnected t ∧ s = Sum.inr '' t

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
{s : Set (α ⊕ β)}


@[simp]
theorem adjoin_univ : adjoin R (Set.univ : Set A) = ⊤

(R : Type uR)
(A : Type uA)
[CommSemiring R]
[Semiring A]
[Algebra R A]


theorem length_eq_three {l : List α} : l.length = 3 ↔ ∃ a b c, l = [a, b, c]


@[simp]
theorem isBigO_abs_left : (fun x => |u x|) =O[l] g ↔ u =O[l] g

{α : Type u_1}
{F : Type u_4}
[Norm F]
{g : α → F}
{l : Filter α}
{u : α → ℝ}


@[simp]
theorem comapDomain'_zero [∀ i, Zero (β i)] (h : κ → ι) {h' : ι → κ}
    (hh' : Function.LeftInverse h' h) : comapDomain' h hh' (0 : Π₀ i, β i) = 0

{ι : Type u}
{β : ι → Type v}
{κ : Type u_1}
[(i : ι) → Zero (β i)]
(h : κ → ι)
{h' : ι → κ}
(hh' : Function.LeftInverse h' h)


/-- The inner product of two vectors, divided by the product of their
norms, has absolute value 1 if and only if they are nonzero and one is
a multiple of the other. One form of equality case for Cauchy-Schwarz. -/
theorem norm_inner_div_norm_mul_norm_eq_one_iff (x y : E) :
    ‖⟪x, y⟫ / (‖x‖ * ‖y‖)‖ = 1 ↔ x ≠ 0 ∧ ∃ r : 𝕜, r ≠ 0 ∧ y = r • x

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x y : E)

‖⟪x, y⟫_𝕜 / (↑‖x‖ * ↑‖y‖)‖ = 1 ↔ x ≠ 0 ∧ ∃ r, r ≠ 0 ∧ y = r • x


@[deprecated (since := "2024-06-16")]
lemma IsNontrivial.sum_eq_zero [IsDomain R'] {χ : MulChar R R'} (hχ : χ.IsNontrivial) :
    ∑ a, χ a = 0

{R : Type u_1}
[CommMonoid R]
[Fintype R]
{R' : Type u_2}
[CommRing R']
[IsDomain R']
{χ : MulChar R R'}
(hχ : χ.IsNontrivial)


/-- Constructor for objects of the category `Functor.LeftExtension L F`. -/
@[simps!]
def LeftExtension.mk (F' : D ⥤ H) {L : C ⥤ D} {F : C ⥤ H} (α : F ⟶ L ⋙ F') :
    LeftExtension L F

{C : Type u_1}
{H : Type u_3}
{D : Type u_5}
[CategoryTheory.Category.{u_7, u_1} C]
[CategoryTheory.Category.{u_8, u_3} H]
[CategoryTheory.Category.{u_9, u_5} D]
(F' : CategoryTheory.Functor D H)
{L : CategoryTheory.Functor C D}
{F : CategoryTheory.Functor C H}
(α : F ⟶ L.comp F')

(CategoryTheory.Functor.LeftExtension.mk F' α).hom = α


lemma geo_series_const (a : α) {x : α} (hx1 : |x| < 1) :
    IsCauSeq abs fun m ↦ ∑ n ∈ range m, (a * x ^ n)

{α : Type u_1}
[LinearOrderedField α]
[Archimedean α]
(a : α)
{x : α}
(hx1 : |x| < 1)

IsCauSeq abs fun m => ∑ n ∈ Finset.range m, a * x ^ n


theorem birkhoffSum_zero (f : α → α) (g : α → M) (x : α) : birkhoffSum f g 0 x = 0

{α : Type u_1}
{M : Type u_2}
[AddCommMonoid M]
(f : α → α)
(g : α → M)
(x : α)


theorem IsWide.eqToHom_mem {S : Subgroupoid C} (Sw : S.IsWide) {c d : C} (h : c = d) :
    eqToHom h ∈ S.arrows c d

{C : Type u}
[CategoryTheory.Groupoid C]
{S : CategoryTheory.Subgroupoid C}
(Sw : S.IsWide)
{c d : C}
(h : c = d)


/-- Provide the reverse of modus tollens (`mt`) as dot notation for implications. -/
protected theorem Function.mtr : (¬a → ¬b) → b → a


protected theorem IsClopen.isOpen (hs : IsClopen s) : IsOpen s

{X : Type u}
[TopologicalSpace X]
{s : Set X}
(hs : IsClopen s)