/-- A structure groupoid is a set of partial homeomorphisms of a topological space stable under
composition and inverse. They appear in the definition of the smoothness class of a manifold. -/
structure StructureGroupoid (H : Type u) [TopologicalSpace H] where
  /-- Members of the structure groupoid are partial homeomorphisms. -/
  members : Set (PartialHomeomorph H H)
  /-- Structure groupoids are stable under composition. -/
  trans' : ∀ e e' : PartialHomeomorph H H, e ∈ members → e' ∈ members → e ≫ₕ e' ∈ members
  /-- Structure groupoids are stable under inverse. -/
  symm' : ∀ e : PartialHomeomorph H H, e ∈ members → e.symm ∈ members
  /-- The identity morphism lies in the structure groupoid. -/
  id_mem' : PartialHomeomorph.refl H ∈ members
  /-- Let `e` be a partial homeomorphism. If for every `x ∈ e.source`, the restriction of e to some
  open set around `x` lies in the groupoid, then `e` lies in the groupoid. -/
  locality' : ∀ e : PartialHomeomorph H H,
    (∀ x ∈ e.source, ∃ s, IsOpen s ∧ x ∈ s ∧ e.restr s ∈ members) → e ∈ members
  /-- Membership in a structure groupoid respects the equivalence of partial homeomorphisms. -/
  mem_of_eqOnSource' : ∀ e e' : PartialHomeomorph H H, e ∈ members → e' ≈ e → e' ∈ members

{H : Type u}
[TopologicalSpace H]
(self : StructureGroupoid H)
(e : PartialHomeomorph H H)

e ∈ self.members → e.symm ∈ self.members


@[simp]
theorem inf_image [DecidableEq β] (s : Finset γ) (f : γ → β) (g : β → α) :
    (s.image f).inf g = s.inf (g ∘ f)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[SemilatticeInf α]
[OrderTop α]
[DecidableEq β]
(s : Finset γ)
(f : γ → β)
(g : β → α)

(Finset.image f s).inf g = s.inf (g ∘ f)


theorem Finite.seq {f : Set (α → β)} {s : Set α} (hf : f.Finite) (hs : s.Finite) :
    (f.seq s).Finite

{α : Type u}
{β : Type v}
{f : Set (α → β)}
{s : Set α}
(hf : f.Finite)
(hs : s.Finite)


theorem supDegree_eq_degree (p : R[X]) : p.toFinsupp.supDegree WithBot.some = p.degree

AddMonoidAlgebra.supDegree WithBot.some p.toFinsupp = p.degree


theorem IsOpen.measurableSet (h : IsOpen s) : MeasurableSet s

{α : Type u_1}
{s : Set α}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
(h : IsOpen s)


@[simp] theorem get_eq_getElem (a : Array α) (i : Fin _) : a.get i = a[i.1]

{α : Type u_1}
(a : Array α)
(i : Fin a.size)


@[simp]
theorem pointReflection_self (x : P) : pointReflection x x = x

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


@[simp]
theorem congr_one : congr (1 : M ≃ₗ[A] M) (1 : N ≃ₗ[R] N) = 1

{R : Type uR}
{A : Type uA}
{M : Type uM}
{N : Type uN}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
[AddCommMonoid N]
[Module R N]

TensorProduct.AlgebraTensorModule.congr 1 1 = 1


theorem star_add_self' : star a + a = ↑(2 * a.re)

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


@[to_additive]
theorem Finset.prod_fin_eq_prod_range [CommMonoid β] {n : ℕ} (c : Fin n → β) :
    ∏ i, c i = ∏ i ∈ Finset.range n, if h : i < n then c ⟨i, h⟩ else 1

{β : Type u_2}
[AddCommMonoid β]
{n : ℕ}
(c : Fin n → β)

∑ i : Fin n, c i = ∑ i ∈ Finset.range n, if h : i < n then c ⟨i, h⟩ else 0


protected theorem Balanced.convexHull (hs : Balanced 𝕜 s) : Balanced 𝕜 (convexHull ℝ s)

{𝕜 : Type u_1}
{E : Type u_3}
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
[Module ℝ E]
[SMulCommClass ℝ 𝕜 E]
(hs : Balanced 𝕜 s)


/-- Every polynomial is the sum of its weighted homogeneous components. -/
theorem sum_weightedHomogeneousComponent :
    (finsum fun m => weightedHomogeneousComponent w m φ) = φ

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
{σ : Type u_3}
[AddCommMonoid M]
(w : σ → M)
(φ : MvPolynomial σ R)

∑ᶠ (m : M), (MvPolynomial.weightedHomogeneousComponent w m) φ = φ


theorem unop_sSup (S : Set (Subalgebra R Aᵐᵒᵖ)) : (sSup S).unop = sSup (.op ⁻¹' S)

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Set (Subalgebra R Aᵐᵒᵖ))

(sSup S).unop = sSup (Subalgebra.op ⁻¹' S)


@[norm_cast, simp]
theorem isSquare_natCast_iff {n : ℕ} : IsSquare (n : ℤ) ↔ IsSquare n


@[to_additive]
theorem prod_trunc {M : Type*} [CommMonoid M] {a b : ℕ} (f : Fin (a + b) → M)
    (hf : ∀ j : Fin b, f (natAdd a j) = 1) :
    (∏ i : Fin (a + b), f i) = ∏ i : Fin a, f (castLE (Nat.le.intro rfl) i)

(hf : ∀ (j : Fin b), f (Fin.natAdd a j) = 1)

∏ i : Fin (a + b), f i = ∏ i : Fin a, f (Fin.castLE ⋯ i)


@[to_additive (attr := elab_as_elim, cases_eliminator, induction_eliminator)]
protected theorem ind {β : X[S⁻¹] → Prop}
    (c : ∀ (r : X) (s : S), β (r /ₒ s)) : ∀ q, β q

{R : Type u_1}
[AddMonoid R]
{S : AddSubmonoid R}
[AddOreLocalization.AddOreSet S]
{X : Type u_2}
[AddAction R X]
{β : AddOreLocalization S X → Prop}
(c : ∀ (r : X) (s : ↥S), β (r -ₒ s))
(q : AddOreLocalization S X)


@[to_additive (attr := simp)]
theorem norm_smul_Lp (c : Mᵈᵐᵃ) (f : Lp E p μ) : ‖c • f‖ = ‖f‖

[MeasureTheory.SMulInvariantMeasure M α μ]

‖c • f‖ = ‖f‖


theorem exists_subset_subsingleton_mem_of_forall_separating (p : Set α → Prop)
    {s : Set α} [h : HasCountableSeparatingOn α p s] (hs : s ∈ l)
    (hl : ∀ U, p U → U ∈ l ∨ Uᶜ ∈ l) : ∃ t, t ⊆ s ∧ t.Subsingleton ∧ t ∈ l

(hl : ∀ (U : Set α), p U → U ∈ l ∨ Uᶜ ∈ l)


/-- A relation isomorphism is an equivalence that is also a relation embedding. -/
structure RelIso {α β : Type*} (r : α → α → Prop) (s : β → β → Prop) extends α ≃ β where
  /-- Elements are related iff they are related after apply a `RelIso` -/
  map_rel_iff' : ∀ {a b}, s (toEquiv a) (toEquiv b) ↔ r a b

{α : Type u_5}
{β : Type u_6}
{r : α → α → Prop}
{s : β → β → Prop}
(self : r ≃r s)
{a b : α}

s (self.toEquiv a) (self.toEquiv b) ↔ r a b


theorem ListBlank.append_assoc {Γ} [Inhabited Γ] (l₁ l₂ : List Γ) (l₃ : ListBlank Γ) :
    ListBlank.append (l₁ ++ l₂) l₃ = ListBlank.append l₁ (ListBlank.append l₂ l₃)

{Γ : Type u_1}
[Inhabited Γ]
(l₁ l₂ : List Γ)
(l₃ : Turing.ListBlank Γ)

Turing.ListBlank.append (l₁ ++ l₂) l₃ = Turing.ListBlank.append l₁ (Turing.ListBlank.append l₂ l₃)


lemma mem_closure_self (M : Matroid α) (e : α) (he : e ∈ M.E := by aesop_mat) : e ∈ M.closure {e}

{α : Type u_2}
(M : Matroid α)
(e : α)
(he : e ∈ M.E := by aesop_mat)


theorem pos_iff : 0 < z ↔ 0 < re z ∧ im z = 0

0 < z ↔ 0 < RCLike.re z ∧ RCLike.im z = 0


/-- The sum and difference of two vectors are orthogonal if and only
if they have the same norm. -/
theorem real_inner_add_sub_eq_zero_iff (x y : F) : ⟪x + y, x - y⟫_ℝ = 0 ↔ ‖x‖ = ‖y‖

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


/-- A family indexed by a `Fintype` is affinely independent if and
only if no nontrivial weighted subtractions over `Finset.univ` (where
the sum of the weights is 0) are 0. -/
theorem affineIndependent_iff_of_fintype [Fintype ι] (p : ι → P) :
    AffineIndependent k p ↔
      ∀ w : ι → k, ∑ i, w i = 0 → Finset.univ.weightedVSub p w = (0 : V) → ∀ i, w i = 0

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
[Fintype ι]
(p : ι → P)

AffineIndependent k p ↔ ∀ (w : ι → k), ∑ i : ι, w i = 0 → (Finset.univ.weightedVSub p) w = 0 → ∀ (i : ι), w i = 0


theorem uniformContinuous_eval (h : ⋃₀ 𝔖 = univ) (x : α) :
    UniformContinuous ((Function.eval x : (α → β) → β) ∘ toFun 𝔖)

{α : Type u_1}
{β : Type u_2}
[UniformSpace β]
{𝔖 : Set (Set α)}
(h : ⋃₀ 𝔖 = Set.univ)
(x : α)

UniformContinuous (Function.eval x ∘ ⇑(UniformOnFun.toFun 𝔖))


@[simp]
theorem preimage_const_add_Icc : (fun x => a + x) ⁻¹' Icc b c = Icc (b - a) (c - a)

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

(fun x => a + x) ⁻¹' Set.Icc b c = Set.Icc (b - a) (c - a)


/-- A measurable function `α → StieltjesFunction` with limits 0 at -∞ and 1 at +∞ gives a measurable
function `α → Measure ℝ` by taking `StieltjesFunction.measure` at each point. -/
lemma StieltjesFunction.measurable_measure {f : α → StieltjesFunction}
    (hf : ∀ q, Measurable fun a ↦ f a q)
    (hf_bot : ∀ a, Tendsto (f a) atBot (𝓝 0))
    (hf_top : ∀ a, Tendsto (f a) atTop (𝓝 1)) :
    Measurable fun a ↦ (f a).measure

(hf : ∀ (q : ℝ), Measurable fun a => ↑(f a) q)

(hf_bot : ∀ (a : α), Filter.Tendsto (↑(f a)) Filter.atBot (𝓝 0))

(hf_top : ∀ (a : α), Filter.Tendsto (↑(f a)) Filter.atTop (𝓝 1))


/-- An **e-transform**. Turns `(s, t)` into `(s ∪ s • e, t ∩ e⁻¹ • t)`. This reduces the
product of the two sets. -/
@[to_additive (attr := simps) "An **e-transform**.
Turns `(s, t)` into `(s ∪ s +ᵥ e, t ∩ -e +ᵥ t)`. This reduces the sum of the two sets."]
def mulETransformRight : Finset α × Finset α

{α : Type u_1}
[DecidableEq α]
[AddGroup α]
(e : α)
(x : Finset α × Finset α)

(Finset.addETransformRight e x).1 = x.1 ∪ (AddOpposite.op e +ᵥ x.1)


@[simp] lemma greatestFib_fib : ∀ {n}, n ≠ 1 → greatestFib (fib n) = n


theorem IsLeast.dual (h : IsLeast s a) : IsGreatest (ofDual ⁻¹' s) (toDual a)

{α : Type u}
[Preorder α]
{s : Set α}
{a : α}
(h : IsLeast s a)

IsGreatest (⇑OrderDual.ofDual ⁻¹' s) (OrderDual.toDual a)


/-- A morphism between target objects `T ⟶ T'`
covariantly induces a functor between costructured arrows,
`CostructuredArrow S T ⥤ CostructuredArrow S T'`.

Ideally this would be described as a 2-functor from `D`
(promoted to a 2-category with equations as 2-morphisms)
to `Cat`.
-/
@[simps!]
def map (f : T ⟶ T') : CostructuredArrow S T ⥤ CostructuredArrow S T'

(X : CategoryTheory.Comma S (CategoryTheory.Functor.fromPUnit T))

((CategoryTheory.CostructuredArrow.map f).obj X).left = X.left


theorem kahler_eq_zero_iff (x y : E) : o.kahler x y = 0 ↔ x = 0 ∨ y = 0

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


theorem pentagon (W X Y Z : Dial C) :
    (tensorHom (associator W X Y).hom (𝟙 Z)) ≫ (associator W (tensorObj X Y) Z).hom ≫
      (tensorHom (𝟙 W) (associator X Y Z).hom) =
    (associator (tensorObj W X) Y Z).hom ≫ (associator W X (tensorObj Y Z)).hom

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Dial.tensorHom (W.associator X Y).hom (CategoryTheory.CategoryStruct.id Z))
    (CategoryTheory.CategoryStruct.comp (W.associator (X.tensorObj Y) Z).hom
      (CategoryTheory.Dial.tensorHom (CategoryTheory.CategoryStruct.id W) (X.associator Y Z).hom)) =
  CategoryTheory.CategoryStruct.comp ((W.tensorObj X).associator Y Z).hom (W.associator X (Y.tensorObj Z)).hom


@[simp]
theorem coe_symm_eq (x : I) : (σ x : ℝ) = 1 - x


lemma nsmul_inf' {α'} [LinearOrderedAddCommMonoid β] {s : Finset α'}
    (hs : s.Nonempty) (f : α' → β) (n : ℕ) :
    s.inf' hs (fun a => n • f a) = n • s.inf' hs f

{β : Type u_3}
{α' : Type u_7}
[LinearOrderedAddCommMonoid β]
{s : Finset α'}
(hs : s.Nonempty)
(f : α' → β)
(n : ℕ)

(s.inf' hs fun a => n • f a) = n • s.inf' hs f


@[to_additive two_smul_mem_of_index_two]
theorem sq_mem_of_index_two (h : H.index = 2) (a : G) : a ^ 2 ∈ H

{G : Type u_1}
[Group G]
{H : Subgroup G}
(h : H.index = 2)
(a : G)


@[to_additive (attr := simp)]
theorem div_empty (s : Finset α) : s / ∅ = ∅

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


@[reassoc]
theorem coprod.map_inl_inr_codiag {X Y : C} [HasBinaryCoproduct X Y]
    [HasBinaryCoproduct (X ⨿ Y) (X ⨿ Y)] :
    coprod.map coprod.inl coprod.inr ≫ codiag (X ⨿ Y) = 𝟙 (X ⨿ Y)

[CategoryTheory.Limits.HasBinaryCoproduct (X ⨿ Y) (X ⨿ Y)]

CategoryTheory.Limits.coprod.map CategoryTheory.Limits.coprod.inl CategoryTheory.Limits.coprod.inr ≫
    CategoryTheory.Limits.codiag (X ⨿ Y) =
  𝟙 (X ⨿ Y)


@[scoped simp]
theorem map_sub_ofNat' [AddGroupWithOne G] [AddGroup H] [AddConstMapClass F G H 1 b]
    (f : F) (x : G) (n : ℕ) [n.AtLeastTwo] :
    f (x - no_index (OfNat.ofNat n)) = f x - OfNat.ofNat n • b

{F : Type u_1}
{G : Type u_2}
{H : Type u_3}
[FunLike F G H]
{b : H}
[AddGroupWithOne G]
[AddGroup H]
[AddConstMapClass F G H 1 b]
(f : F)
(x : G)
(n : ℕ)
[n.AtLeastTwo]

f (x - OfNat.ofNat n) = f x - OfNat.ofNat n • b


theorem of_smul_of [DecidableEq ιA] [DecidableEq ιB] [GMonoid A] [Gmodule A M]
    {i j} (x : A i) (y : M j) :
    DirectSum.of A i x • of M j y = of M (i +ᵥ j) (GSMul.smul x y)

{ιA : Type u_1}
{ιB : Type u_2}
(A : ιA → Type u_3)
(M : ιB → Type u_4)
[AddMonoid ιA]
[VAdd ιA ιB]
[(i : ιA) → AddCommMonoid (A i)]
[(i : ιB) → AddCommMonoid (M i)]
[DecidableEq ιA]
[DecidableEq ιB]
[GradedMonoid.GMonoid A]
[DirectSum.Gmodule A M]
{i : ιA}
{j : ιB}
(x : A i)
(y : M j)

(DirectSum.of A i) x • (DirectSum.of M j) y = (DirectSum.of M (i +ᵥ j)) (GradedMonoid.GSMul.smul x y)


@[simp]
theorem lastFun_toSubtype {α} (p : α ⟹ «repeat» (n + 1) Prop) :
    lastFun (toSubtype p) = _root_.id

(p : α.Arrow (TypeVec.repeat (n + 1) Prop))

TypeVec.lastFun (TypeVec.toSubtype p) = id


/-- The sum over the values of a nontrivial additive character vanishes if the target ring
is a domain. -/
theorem sum_eq_zero_of_ne_one [IsDomain R'] {ψ : AddChar R R'} (hψ : ψ ≠ 1) : ∑ a, ψ a = 0

{R : Type u_1}
[AddGroup R]
[Fintype R]
{R' : Type u_2}
[CommRing R']
[IsDomain R']
{ψ : AddChar R R'}
(hψ : ψ ≠ 1)


protected theorem le_add_tsub_swap (hb : AddLECancellable b) : a ≤ b + a - b

{α : Type u_1}
[Preorder α]
[AddCommSemigroup α]
[Sub α]
[OrderedSub α]
{a b : α}
(hb : AddLECancellable b)


theorem any_iff_exists (p : α → Bool) (as : Array α) (start stop) :
    any as p start stop ↔ ∃ i : Fin as.size, start ≤ i.1 ∧ i.1 < stop ∧ p as[i]

{α : Type u_1}
(p : α → Bool)
(as : Array α)
(start stop : Nat)

as.any p start stop = true ↔ ∃ i, start ≤ ↑i ∧ ↑i < stop ∧ p as[i] = true


@[reassoc (attr := simp)]
lemma D₁_D₁ (i₁₂ i₁₂' i₁₂'' : I₁₂) : K.D₁ c₁₂ i₁₂ i₁₂' ≫ K.D₁ c₁₂ 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₁₂)


@[simp] lemma map_comp (g : β →o γ) (f : α →o β) : map (g.comp f) = (map g).comp (map f)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Preorder α]
[Preorder β]
[Preorder γ]
(g : β →o γ)
(f : α →o β)

Topology.WithUpperSet.map (g.comp f) = (Topology.WithUpperSet.map g).comp (Topology.WithUpperSet.map f)


@[to_additive]
theorem relindex_ne_zero_trans (hHK : H.relindex K ≠ 0) (hKL : K.relindex L ≠ 0) :
    H.relindex L ≠ 0

{G : Type u_1}
[AddGroup G]
{H K L : AddSubgroup G}
(hHK : H.relindex K ≠ 0)
(hKL : K.relindex L ≠ 0)


lemma pred_succ (a : ℤ) : pred (succ a) = a


@[simp] lemma map_addY : addY (W'.map f) (f ∘ P) (f ∘ Q) = f (W'.addY P Q)

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{S : Type u_1}
[CommRing S]
(f : R →+* S)
(P Q : Fin 3 → R)

WeierstrassCurve.Jacobian.addY (WeierstrassCurve.map W' f) (⇑f ∘ P) (⇑f ∘ Q) = f (W'.addY P Q)


/-- Given a finite set `s`, the product of `f i / g i` over `i ∈ s` equals the product of `f i`
over `i ∈ s` divided by the product of `g i` over `i ∈ s`. -/
@[to_additive
      "Given a finite set `s`, the sum of `f i / g i` over `i ∈ s` equals the sum of `f i`
      over `i ∈ s` minus the sum of `g i` over `i ∈ s`."]
theorem finprod_mem_div_distrib [DivisionCommMonoid G] (f g : α → G) (hs : s.Finite) :
    ∏ᶠ i ∈ s, f i / g i = (∏ᶠ i ∈ s, f i) / ∏ᶠ i ∈ s, g i

{α : Type u_1}
{G : Type u_4}
{s : Set α}
[DivisionCommMonoid G]
(f g : α → G)
(hs : s.Finite)

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


protected theorem sub_eq_add_neg (a b : Rat) : a - b = a + -b


@[simp]
theorem mulInitial_inv (X : C) [HasBinaryProduct X (⊥_ C)] : (mulInitial X).inv = initial.to _

[CategoryTheory.Limits.HasBinaryProduct X (⊥_ C)]

(CategoryTheory.Limits.mulInitial X).inv = CategoryTheory.Limits.initial.to (X ⨯ ⊥_ C)


@[to_additive (attr := simp)]
theorem fromLeftInv_eq_inv (x : S.leftInv) : (S.fromLeftInv x : M) = (x : M)⁻¹

{M : Type u_1}
[Group M]
(S : Submonoid M)
(x : ↥S.leftInv)


/-- Any morphism `Z ⟶ X⟦1⟧` is part of a distinguished triangle `X ⟶ Y ⟶ Z ⟶ X⟦1⟧` -/
lemma distinguished_cocone_triangle₂ {Z X : C} (h : Z ⟶ X⟦(1 : ℤ)⟧) :
    ∃ (Y : C) (f : X ⟶ Y) (g : Y ⟶ Z), Triangle.mk f g h ∈ distTriang C

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

(h : Z ⟶ (CategoryTheory.shiftFunctor C 1).obj X)

∃ Y f g, CategoryTheory.Pretriangulated.Triangle.mk f g h ∈ CategoryTheory.Pretriangulated.distinguishedTriangles


@[to_additive]
theorem comap_le_comap_of_surjective {f : G →* N} {K L : Subgroup N} (hf : Function.Surjective f) :
    K.comap f ≤ L.comap f ↔ K ≤ L

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

Subgroup.comap f K ≤ Subgroup.comap f L ↔ K ≤ L


@[to_additive]
theorem image_closure [Group H] {f : G → H} (hf : IsGroupHom f) (s : Set G) :
    f '' closure s = closure (f '' s)

{G : Type u_1}
{H : Type u_2}
[AddGroup G]
[AddGroup H]
{f : G → H}
(hf : IsAddGroupHom f)
(s : Set G)

f '' AddGroup.closure s = AddGroup.closure (f '' s)


@[elab_as_elim]
protected theorem induction_on₃ {δ : Quot r → Quot s → Quot t → Prop} (q₁ : Quot r)
    (q₂ : Quot s) (q₃ : Quot t) (h : ∀ a b c, δ (Quot.mk r a) (Quot.mk s b) (Quot.mk t c)) :
    δ q₁ q₂ q₃

(h : ∀ (a : α) (b : β) (c : γ), δ (Quot.mk r a) (Quot.mk s b) (Quot.mk t c))


theorem _root_.Set.biInter_finsetSigma' (s : Finset ι) (t : ∀ i, Finset (α i))
    (f : ∀ i, α i → Set β) : ⋂ i ∈ s, ⋂ j ∈ t i, f i j = ⋂ ij ∈ s.sigma t, f ij.1 ij.2

{ι : Type u_1}
{α : ι → Type u_2}
{β : Type u_3}
(s : Finset ι)
(t : (i : ι) → Finset (α i))
(f : (i : ι) → α i → Set β)

⋂ i ∈ s, ⋂ j ∈ t i, f i j = ⋂ ij ∈ s.sigma t, f ij.fst ij.snd


@[to_additive (attr := simp)]
lemma sup_inv [SemilatticeSup β] [OrderBot β] (s : Finset α) (f : α → β) :
    sup s⁻¹ f = sup s (f ·⁻¹)

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[Neg α]
[SemilatticeSup β]
[OrderBot β]
(s : Finset α)
(f : α → β)


@[to_additive (attr := simp)]
theorem map_equiv_top (f : M ≃* N) : (⊤ : Submonoid M).map f = ⊤

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
(f : M ≃* N)


theorem add_sub_le (a : Nat) {b c : Nat} (h : b ≤ c) : a + b - c = a - (c - b)


@[reassoc]
lemma pentagon_inv :
    tensorHom (𝟙 X₁) (associator X₂ X₃ X₄).inv ≫ (associator X₁ (tensorObj X₂ X₃) X₄).inv ≫
        tensorHom (associator X₁ X₂ X₃).inv (𝟙 X₄) =
    (associator X₁ X₂ (tensorObj X₃ X₄)).inv ≫ (associator (tensorObj X₁ X₂) X₃ X₄).inv

(X₁ X₂ X₃ X₄ : CategoryTheory.GradedObject I C)

[(CategoryTheory.GradedObject.Monoidal.tensorObj X₁ X₂).HasTensor X₃]

[X₁.HasTensor (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ X₃)]

[(CategoryTheory.GradedObject.Monoidal.tensorObj X₂ X₃).HasTensor X₄]

[X₂.HasTensor (CategoryTheory.GradedObject.Monoidal.tensorObj X₃ X₄)]

[(CategoryTheory.GradedObject.Monoidal.tensorObj (CategoryTheory.GradedObject.Monoidal.tensorObj X₁ X₂) X₃).HasTensor
    X₄]

[(CategoryTheory.GradedObject.Monoidal.tensorObj X₁ (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ X₃)).HasTensor
    X₄]

[X₁.HasTensor
    (CategoryTheory.GradedObject.Monoidal.tensorObj (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ X₃) X₄)]

[X₁.HasTensor
    (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ (CategoryTheory.GradedObject.Monoidal.tensorObj X₃ X₄))]

[(CategoryTheory.GradedObject.Monoidal.tensorObj X₁ X₂).HasTensor
    (CategoryTheory.GradedObject.Monoidal.tensorObj X₃ X₄)]

[X₁.HasGoodTensor₁₂Tensor (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ X₃) X₄]

[X₁.HasGoodTensorTensor₂₃ (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ X₃) X₄]

[(CategoryTheory.GradedObject.Monoidal.tensorObj X₁ X₂).HasGoodTensor₁₂Tensor X₃ X₄]

[(CategoryTheory.GradedObject.Monoidal.tensorObj X₁ X₂).HasGoodTensorTensor₂₃ X₃ X₄]

[X₁.HasGoodTensor₁₂Tensor X₂ (CategoryTheory.GradedObject.Monoidal.tensorObj X₃ X₄)]

[X₁.HasGoodTensorTensor₂₃ X₂ (CategoryTheory.GradedObject.Monoidal.tensorObj X₃ X₄)]

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.GradedObject.Monoidal.tensorHom (CategoryTheory.CategoryStruct.id X₁)
      (CategoryTheory.GradedObject.Monoidal.associator X₂ X₃ X₄).inv)
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.GradedObject.Monoidal.associator X₁ (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ X₃) X₄).inv
      (CategoryTheory.GradedObject.Monoidal.tensorHom (CategoryTheory.GradedObject.Monoidal.associator X₁ X₂ X₃).inv
        (CategoryTheory.CategoryStruct.id X₄))) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.GradedObject.Monoidal.associator X₁ X₂ (CategoryTheory.GradedObject.Monoidal.tensorObj X₃ X₄)).inv
    (CategoryTheory.GradedObject.Monoidal.associator (CategoryTheory.GradedObject.Monoidal.tensorObj X₁ X₂) X₃ X₄).inv


theorem iInf_sup_eq (f : ι → α) (a : α) : (⨅ i, f i) ⊔ a = ⨅ i, f i ⊔ a

{α : Type u}
{ι : Sort w}
[Order.Coframe α]
(f : ι → α)
(a : α)


lemma subset_compl_comm : s ⊆ tᶜ ↔ t ⊆ sᶜ

{α : Type u_1}
[Fintype α]
{s t : Finset α}
[DecidableEq α]

s ⊆ tᶜ ↔ t ⊆ sᶜ


@[simp]
theorem T_neg (n : ℤ) : T R (-n) = T R n

Polynomial.Chebyshev.T R (-n) = Polynomial.Chebyshev.T R n


lemma Odd.sub_odd (hm : Odd m) (hn : Odd n) : Even (m - n)


/-- The Grothendieck construction is functorial: a natural transformation `α : F ⟶ G` induces
a functor `Grothendieck.map : Grothendieck F ⥤ Grothendieck G`.
-/
@[simps!]
def map (α : F ⟶ G) : Grothendieck F ⥤ Grothendieck G

{F G : CategoryTheory.Functor C CategoryTheory.Cat}

((CategoryTheory.Grothendieck.map α).obj X).fiber = (α.app X.base).obj X.fiber


@[reassoc (attr := simp)]
theorem colimit_map_colimitObjIsoColimitCompEvaluation_hom [HasColimitsOfShape J C] (F : J ⥤ K ⥤ C)
    {i j : K} (f : i ⟶ j) :
    (colimit F).map f ≫ (colimitObjIsoColimitCompEvaluation _ _).hom =
      (colimitObjIsoColimitCompEvaluation _ _).hom ≫
        colimMap (whiskerLeft _ ((evaluation _ _).map f))

(CategoryTheory.Limits.colimit F).map f ≫ (CategoryTheory.Limits.colimitObjIsoColimitCompEvaluation F j).hom =
  (CategoryTheory.Limits.colimitObjIsoColimitCompEvaluation F i).hom ≫
    CategoryTheory.Limits.colimMap (CategoryTheory.whiskerLeft F ((CategoryTheory.evaluation K C).map f))


theorem IsPrefix.filter (p : α → Bool) ⦃l₁ l₂ : List α⦄ (h : l₁ <+: l₂) :
    l₁.filter p <+: l₂.filter p

{α : Type u_1}
(p : α → Bool)
⦃l₁ l₂ : List α⦄
(h : l₁ <+: l₂)


@[to_additive]
theorem inv_mul_eq_div : a⁻¹ * b = b / a

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


@[simp] theorem lex_inr_inl : ¬Lex r s (inr b) (inl a)

∀ {α : Type u_1} {r : α → α → Prop} {β : Type u_2} {s : β → β → Prop} {b : β} {a : α},
  ¬Sum.Lex r s (Sum.inr b) (Sum.inl a)


{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{s : 𝕜 → 𝕜}
{f : 𝕜 → E}
{U : Set 𝕜}
(hs : MeromorphicOn s U)
(hf : MeromorphicOn f U)


@[simp]
theorem coe_basisMonomials : (basisMonomials R : ℕ → R[X]) = fun s => monomial s 1

⇑(Polynomial.basisMonomials R) = fun s => (Polynomial.monomial s) 1


@[simp]
theorem zero_rpow_of_neg {y : ℝ} (h : y < 0) : (0 : ℝ≥0∞) ^ y = ⊤


theorem Antiperiodic.nat_even_mul_periodic [Semiring α] [InvolutiveNeg β] (h : Antiperiodic f c)
    (n : ℕ) : Periodic f (n * (2 * c))

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[Semiring α]
[InvolutiveNeg β]
(h : Function.Antiperiodic f c)
(n : ℕ)


theorem nodup_map_iff {f : α → β} {l : List α} (hf : Injective f) : Nodup (map f l) ↔ Nodup l

{α : Type u}
{β : Type v}
{f : α → β}
{l : List α}
(hf : Function.Injective f)


theorem colimit_isOpen_iff (F : J ⥤ TopCat.{max v u}) (U : Set ((colimit F : _) : Type max v u)) :
    IsOpen U ↔ ∀ j, IsOpen (colimit.ι F j ⁻¹' U)

(U : Set ↑(CategoryTheory.Limits.colimit F))

IsOpen U ↔ ∀ (j : J), IsOpen (⇑(CategoryTheory.Limits.colimit.ι F j) ⁻¹' U)


theorem Ultrafilter.lim_eq_iff_le_nhds [CompactSpace X] {x : X} {F : Ultrafilter X} :
    F.lim = x ↔ ↑F ≤ 𝓝 x

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]
[CompactSpace X]
{x : X}
{F : Ultrafilter X}


theorem gcd_pos_of_pos_right (m : Nat) {n : Nat} (npos : 0 < n) : 0 < gcd m n


@[simp]
theorem pi_zero (t : ∀ a, Multiset (β a)) : pi 0 t = {Pi.empty β}

{α : Type u_1}
[DecidableEq α]
{β : α → Type u_2}
(t : (a : α) → Multiset (β a))


/-- Data for the general version of the implicit function theorem. It holds two functions
`f : E → F` and `g : E → G` (named `leftFun` and `rightFun`) and a point `a` (named `pt`) such that

* both functions are strictly differentiable at `a`;
* the derivatives are surjective;
* the kernels of the derivatives are complementary subspaces of `E`. -/
-- Porting note(#5171): linter not yet ported @[nolint has_nonempty_instance]
structure ImplicitFunctionData (𝕜 : Type*) [NontriviallyNormedField 𝕜] (E : Type*)
    [NormedAddCommGroup E] [NormedSpace 𝕜 E] [CompleteSpace E] (F : Type*) [NormedAddCommGroup F]
    [NormedSpace 𝕜 F] [CompleteSpace F] (G : Type*) [NormedAddCommGroup G] [NormedSpace 𝕜 G]
    [CompleteSpace G] where
  leftFun : E → F
  leftDeriv : E →L[𝕜] F
  rightFun : E → G
  rightDeriv : E →L[𝕜] G
  pt : E
  left_has_deriv : HasStrictFDerivAt leftFun leftDeriv pt
  right_has_deriv : HasStrictFDerivAt rightFun rightDeriv pt
  left_range : range leftDeriv = ⊤
  right_range : range rightDeriv = ⊤
  isCompl_ker : IsCompl (ker leftDeriv) (ker rightDeriv)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
[CompleteSpace G]
(self : ImplicitFunctionData 𝕜 E F G)

HasStrictFDerivAt self.rightFun self.rightDeriv self.pt


@[simp] theorem bmod_bmod : bmod (bmod x m) m = bmod x m


protected theorem smul {α} [CommSemiring α] [Module α R] [SMulCommClass R α R]
    [NoZeroSMulDivisors α R] (a : α) {B : BilinForm R M} (hB : B.IsRefl) :
    (a • B).IsRefl

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{α : Type u_9}
[CommSemiring α]
[Module α R]
[SMulCommClass R α R]
[NoZeroSMulDivisors α R]
(a : α)
{B : LinearMap.BilinForm R M}
(hB : B.IsRefl)


/-- A comonoid object internal to a monoidal category.

When the monoidal category is preadditive, this is also sometimes called a "coalgebra object".
-/
structure Comon_ where
  /-- The underlying object of a comonoid object. -/
  X : C
  /-- The counit of a comonoid object. -/
  counit : X ⟶ 𝟙_ C
  /-- The comultiplication morphism of a comonoid object. -/
  comul : X ⟶ X ⊗ X
  counit_comul : comul ≫ (counit ▷ X) = (λ_ X).inv := by aesop_cat
  comul_counit : comul ≫ (X ◁ counit) = (ρ_ X).inv := by aesop_cat
  comul_assoc : comul ≫ (X ◁ comul) = comul ≫ (comul ▷ X) ≫ (α_ X X X).hom := by aesop_cat

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

self.comul ≫ self.X ◁ self.counit = (ρ_ self.X).inv


@[simp, mfld_simps]
theorem transHomeomorph_transHomeomorph (e : PartialHomeomorph X Y) (f' : Y ≃ₜ Z) (f'' : Z ≃ₜ Z') :
    (e.transHomeomorph f').transHomeomorph f'' = e.transHomeomorph (f'.trans f'')

{X : Type u_1}
{Y : Type u_3}
{Z : Type u_5}
{Z' : Type u_6}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
[TopologicalSpace Z']
(e : PartialHomeomorph X Y)
(f' : Y ≃ₜ Z)
(f'' : Z ≃ₜ Z')


theorem tr_move (p k₁ k₂ q) : tr (Λ'.move p k₁ k₂ q) =
    pop' k₁ (branch (fun s => s.elim true p) (goto fun _ => q)
      (push' k₂ <| goto fun _ => Λ'.move p k₁ k₂ q))

(p : Turing.PartrecToTM2.Γ' → Bool)
(k₁ k₂ : Turing.PartrecToTM2.K')
(q : Turing.PartrecToTM2.Λ')

Turing.PartrecToTM2.tr (Turing.PartrecToTM2.Λ'.move p k₁ k₂ q) =
  Turing.PartrecToTM2.pop' k₁
    (Turing.TM2.Stmt.branch (fun s => s.elim true p) (Turing.TM2.Stmt.goto fun x => q)
      (Turing.PartrecToTM2.push' k₂ (Turing.TM2.Stmt.goto fun x => Turing.PartrecToTM2.Λ'.move p k₁ k₂ q)))


@[simp, reassoc]
lemma comp_hom (f : F ⟶ G) (g : G ⟶ H) (a : A) : (f ≫ g).hom a = f.hom a ≫ g.hom a

{F G H : CategoryTheory.SingleFunctors C D A}


theorem max_eq_eval (l : MaxProducts C ho) :
    Linear_CC' C hsC ho (l.val.eval C) = l.val.Tail.eval (C' C ho)

(hsC : Profinite.NobelingProof.contained C (Order.succ o))

(ho : o < Ordinal.type fun x x_1 => x < x_1)

(l : ↑(Profinite.NobelingProof.GoodProducts.MaxProducts C ho))

(Profinite.NobelingProof.Linear_CC' C hsC ho) (Profinite.NobelingProof.Products.eval C ↑l) =
  Profinite.NobelingProof.Products.eval (Profinite.NobelingProof.C' C ho) (↑l).Tail


@[simp]
theorem nonempty_sUnion {S : Set (Set α)} : (⋃₀S).Nonempty ↔ ∃ s ∈ S, Set.Nonempty s


theorem hasSum_eval {α : Type*} {p : α → ContinuousMultilinearMap 𝕜 E F}
    {q : ContinuousMultilinearMap 𝕜 E F} (h : HasSum p q) (m : Π i, E i) :
    HasSum (fun a => p a m) (q m)


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

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

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

(CategoryTheory.ComonadIso.mk f f_ε f_δ).hom.toNatTrans = f.hom


theorem gc_ceil_coe : GaloisConnection (ceil : α → ℕ) (↑)

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


/-- Given a compact set `K` inside an open set `U`, there is an open neighborhood `V` of `1`
  such that `V * K ⊆ U`. -/
@[to_additive
  "Given a compact set `K` inside an open set `U`, there is an open neighborhood `V` of
  `0` such that `V + K ⊆ U`."]
theorem compact_open_separated_mul_left {K U : Set G} (hK : IsCompact K) (hU : IsOpen U)
    (hKU : K ⊆ U) : ∃ V ∈ 𝓝 (1 : G), V * K ⊆ U

{G : Type w}
[TopologicalSpace G]
[AddZeroClass G]
[ContinuousAdd G]
{K U : Set G}
(hK : IsCompact K)
(hU : IsOpen U)
(hKU : K ⊆ U)


@[simp]
theorem coe_id (α : Type*) : ((id : α → α) : α →. α) = PFun.id α


/-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it.
We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct
a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t`
agree on `V`. -/
theorem app_surjective_of_injective_of_locally_surjective {F G : Sheaf C X} (f : F ⟶ G)
    (U : Opens X) (hinj : ∀ x : U, Function.Injective ((stalkFunctor C x.1).map f.1))
    (hsurj : ∀ (t) (x : U), ∃ (V : Opens X) (_ : x.1 ∈ V) (iVU : V ⟶ U) (s : F.1.obj (op V)),
          f.1.app (op V) s = G.1.map iVU.op t) :
    Function.Surjective (f.1.app (op U))

(hinj : ∀ (x : ↥U), Function.Injective ⇑((TopCat.Presheaf.stalkFunctor C ↑x).map f.val))

(hsurj :
  ∀ (t : (CategoryTheory.forget C).obj (G.val.obj (Opposite.op U))) (x : ↥U),
    ∃ V, ∃ (_ : ↑x ∈ V), ∃ iVU s, (f.val.app (Opposite.op V)) s = (G.val.map iVU.op) t)

Function.Surjective ⇑(f.val.app (Opposite.op U))


@[to_additive]
theorem support_mulAntidiagonal_subset_mul : { a | (mulAntidiagonal hs ht a).Nonempty } ⊆ s * t

{α : Type u_1}
[OrderedCancelCommMonoid α]
{s t : Set α}
{hs : s.IsPWO}
{ht : t.IsPWO}

{a | (Finset.mulAntidiagonal hs ht a).Nonempty} ⊆ s * t


/-- The image of a von Neumann bounded set under a continuous multilinear map
is von Neumann bounded.

This version does not assume that the topologies on the domain and on the codomain
agree with the vector space structure in any way
but it assumes that `ι` is nonempty.
-/
theorem image_multilinear' [Nonempty ι] {s : Set (∀ i, E i)} (hs : IsVonNBounded 𝕜 s)
    (f : ContinuousMultilinearMap 𝕜 E F) : IsVonNBounded 𝕜 (f '' s)

{ι : Type u_1}
{𝕜 : Type u_2}
{F : Type u_3}
{E : ι → Type u_4}
[NormedField 𝕜]
[(i : ι) → AddCommGroup (E i)]
[(i : ι) → Module 𝕜 (E i)]
[(i : ι) → TopologicalSpace (E i)]
[AddCommGroup F]
[Module 𝕜 F]
[TopologicalSpace F]
[Nonempty ι]
{s : Set ((i : ι) → E i)}
(hs : Bornology.IsVonNBounded 𝕜 s)
(f : ContinuousMultilinearMap 𝕜 E F)


/-- Characterization of minimizers in the projection on a subspace.
Let `u` be a point in an inner product space, and let `K` be a nonempty subspace.
Then point `v` minimizes the distance `‖u - v‖` over points in `K` if and only if
for all `w ∈ K`, `⟪u - v, w⟫ = 0` (i.e., `u - v` is orthogonal to the subspace `K`)
-/
theorem norm_eq_iInf_iff_inner_eq_zero {u : E} {v : E} (hv : v ∈ K) :
    (‖u - v‖ = ⨅ w : K, ‖u - w‖) ↔ ∀ w ∈ K, ⟪u - v, w⟫ = 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(K : Submodule 𝕜 E)
{u v : E}
(hv : v ∈ K)

‖u - v‖ = ⨅ w, ‖u - ↑w‖ ↔ ∀ w ∈ K, ⟪u - v, w⟫_𝕜 = 0


theorem to_quotient (H : Subgroup G) [H.Normal] : IsPGroup p (G ⧸ H)

{p : ℕ}
{G : Type u_1}
[Group G]
(hG : IsPGroup p G)
(H : Subgroup G)
[H.Normal]


@[to_additive (attr := continuity)]
theorem continuous_mul_left (a : M) : Continuous fun b : M => a * b

{M : Type u_3}
[TopologicalSpace M]
[Mul M]
[ContinuousMul M]
(a : M)


@[to_additive]
theorem prod_eq_prod_diff_singleton_mul [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s)
    (f : α → β) : ∏ x ∈ s, f x = (∏ x ∈ s \ {i}, f x) * f i

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


/-- For `0 ≤ x`, the only problematic case in the equality `x ^ y * x ^ z = x ^ (y + z)` is for
`x = 0` and `y + z = 0`, where the right hand side is `1` while the left hand side can vanish.
The inequality is always true, though, and given in this lemma. -/
theorem le_rpow_add {x : ℝ} (hx : 0 ≤ x) (y z : ℝ) : x ^ y * x ^ z ≤ x ^ (y + z)


@[simp, reassoc]
theorem explicitCokernelπ_desc {X Y Z : SemiNormedGrp.{u}} {f : X ⟶ Y} {g : Y ⟶ Z}
    (w : f ≫ g = 0) : explicitCokernelπ f ≫ explicitCokernelDesc w = g

{X Y Z : SemiNormedGrp}
{f : X ⟶ Y}
{g : Y ⟶ Z}
(w : f ≫ g = 0)

SemiNormedGrp.explicitCokernelπ f ≫ SemiNormedGrp.explicitCokernelDesc w = g


@[simp]
theorem blocks_pos' (i : ℕ) (h : i < c.length) : 0 < c.blocks[i]

{n : ℕ}
(c : Composition n)
(i : ℕ)
(h : i < c.length)


theorem pow_one (a : R) : a ^ nat_lit 1 = a


theorem iIndepFun_iff_measure_inter_preimage_eq_mul {ι : Type*} {β : ι → Type*}
    (m : ∀ x, MeasurableSpace (β x)) (f : ∀ i, Ω → β i) :
    iIndepFun m f μ ↔
      ∀ (S : Finset ι) {sets : ∀ i : ι, Set (β i)} (_H : ∀ i, i ∈ S → MeasurableSet[m i] (sets i)),
        μ (⋂ i ∈ S, f i ⁻¹' sets i) = ∏ i ∈ S, μ (f i ⁻¹' sets i)

{Ω : Type u_1}
{_mΩ : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
{ι : Type u_10}
{β : ι → Type u_11}
(m : (x : ι) → MeasurableSpace (β x))
(f : (i : ι) → Ω → β i)

ProbabilityTheory.iIndepFun m f μ ↔
  ∀ (S : Finset ι) {sets : (i : ι) → Set (β i)},
    (∀ i ∈ S, MeasurableSet (sets i)) → μ (⋂ i ∈ S, f i ⁻¹' sets i) = ∏ i ∈ S, μ (f i ⁻¹' sets i)


@[simps]
instance (F : J ⥤ Cat.{v, v}) : Category (limit (F ⋙ Cat.objects))

(F : CategoryTheory.Functor J CategoryTheory.Cat)

{X Y Z : CategoryTheory.Limits.limit (F.comp CategoryTheory.Cat.objects)}

CategoryTheory.CategoryStruct.comp f g =
  CategoryTheory.Limits.Types.Limit.mk (CategoryTheory.Cat.HasLimits.homDiagram X Z)
    (fun j =>
      CategoryTheory.CategoryStruct.comp
        (CategoryTheory.Limits.limit.π (CategoryTheory.Cat.HasLimits.homDiagram X Y) j f)
        (CategoryTheory.Limits.limit.π (CategoryTheory.Cat.HasLimits.homDiagram Y Z) j g))
    ⋯


lemma lift_injective [IsDirected ι (· ≤ ·)]
    (injective : ∀ i, Function.Injective <| g i) :
    Function.Injective (lift R ι G f g Hg)

(Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) ((f i j hij) x) = (g i) x)

(injective : ∀ (i : ι), Function.Injective ⇑(g i))

Function.Injective ⇑(Module.DirectLimit.lift R ι G f g Hg)


@[simp]
theorem symm_trans_self (e : α ≃ᵐ β) : e.symm.trans e = refl β

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
(e : α ≃ᵐ β)


theorem val_congr {n : Nat} {a b : Fin n} (h : a = b) : (a : Nat) = (b : Nat)


/-- The Yoneda embedding for preadditive categories sends an object `Y` to the presheaf sending an
object `X` to the group of morphisms `X ⟶ Y`. At each point, we get an additional `End Y`-module
structure, see `preadditiveYonedaObj`.
-/
@[simps]
def preadditiveYoneda : C ⥤ Cᵒᵖ ⥤ AddCommGrp.{v}

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

CategoryTheory.preadditiveYoneda.obj Y =
  (CategoryTheory.preadditiveYonedaObj Y).comp (CategoryTheory.forget₂ (ModuleCat (CategoryTheory.End Y)) AddCommGrp)


/-- An element of a ring is algebraic over the ring `A` iff it is algebraic
over the field of fractions of `A`.
-/
theorem isAlgebraic_iff [Algebra A C] [Algebra K C] [IsScalarTower A K C] {x : C} :
    IsAlgebraic A x ↔ IsAlgebraic K x

(A : Type u_4)
(K : Type u_5)
(C : Type u_6)
[CommRing A]
[IsDomain A]
[Field K]
[Algebra A K]
[IsFractionRing A K]
[CommRing C]
[Algebra A C]
[Algebra K C]
[IsScalarTower A K C]
{x : C}


@[to_additive (attr := ext)]
theorem CommMonoid.ext {M : Type*} ⦃m₁ m₂ : CommMonoid M⦄
    (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) : m₁ = m₂

{M : Type u_1}
⦃m₁ m₂ : CommMonoid M⦄
(h_mul : HMul.hMul = HMul.hMul)


theorem PairwiseDisjoint.image_of_le (hs : s.PairwiseDisjoint f) {g : ι → ι} (hg : f ∘ g ≤ f) :
    (g '' s).PairwiseDisjoint f

{α : Type u_1}
{ι : Type u_4}
[PartialOrder α]
[OrderBot α]
{s : Set ι}
{f : ι → α}
(hs : s.PairwiseDisjoint f)
{g : ι → ι}
(hg : f ∘ g ≤ f)


theorem isSt_inj_real {r₁ r₂ s : ℝ} (h1 : IsSt r₁ s) (h2 : IsSt r₂ s) : r₁ = r₂

{r₁ r₂ s : ℝ}
(h1 : (↑r₁).IsSt s)
(h2 : (↑r₂).IsSt s)


@[simp]
theorem det_refl : LinearEquiv.det (LinearEquiv.refl R M) = 1

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


theorem fst_sumFinsuppAddEquivProdFinsupp {α β : Type*} (f : α ⊕ β →₀ M) (x : α) :
    (sumFinsuppAddEquivProdFinsupp f).1 x = f (Sum.inl x)

{M : Type u_5}
[AddMonoid M]
{α : Type u_13}
{β : Type u_14}
(f : α ⊕ β →₀ M)
(x : α)

(Finsupp.sumFinsuppAddEquivProdFinsupp f).1 x = f (Sum.inl x)


@[simp] theorem smul_eval (lc : LinearCombo) (i : Int) (v : Coeffs) :
    (i * lc).eval v = i * lc.eval v

(lc : Lean.Omega.LinearCombo)
(i : Int)
(v : Lean.Omega.Coeffs)


theorem continuous_fromLoop (i : N) : Continuous (@fromLoop N X _ x _ i)

{N : Type u_1}
{X : Type u_2}
[TopologicalSpace X]
{x : X}
[DecidableEq N]
(i : N)


theorem card_le : #(L.Term α) ≤ max ℵ₀ #(α ⊕ (Σi, L.Functions i))

Cardinal.mk (L.Term α) ≤ max Cardinal.aleph0 (Cardinal.mk (α ⊕ (i : ℕ) × L.Functions i))


/-- The functor `RightExtension L F ⥤ RightExtension (G ⋙ L) (G ⋙ F)`
obtained by precomposition. -/
@[simps!]
def RightExtension.precomp : RightExtension L F ⥤ RightExtension (G ⋙ L) (G ⋙ F)

{X Y : CategoryTheory.Comma ((CategoryTheory.whiskeringLeft C D H).obj L) (CategoryTheory.Functor.fromPUnit F)}

((CategoryTheory.Functor.RightExtension.precomp L F G).map φ).left = φ.left


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

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
{δ : Type u_6}
[Lattice α]
[Lattice β]
[Lattice γ]
[Lattice δ]
(f : LatticeHom γ δ)
(g : LatticeHom β γ)
(h : LatticeHom α β)


/-- The minimal distance to a set is Lipschitz in point with constant 1 -/
theorem lipschitz_infDist_pt : LipschitzWith 1 (infDist · s)

{α : Type u}
[PseudoMetricSpace α]
(s : Set α)

LipschitzWith 1 fun x => Metric.infDist x s


@[simp]
theorem preimage_const_mul_Icc_of_neg (a b : α) {c : α} (h : c < 0) :
    (c * ·) ⁻¹' Icc a b = Icc (b / c) (a / c)

{α : Type u_1}
[LinearOrderedField α]
(a b : α)
{c : α}
(h : c < 0)

(fun x => c * x) ⁻¹' Set.Icc a b = Set.Icc (b / c) (a / c)


/-- The constant map is multilinear when `ι` is empty. -/
@[simps! toMultilinearMap apply]
def constOfIsEmpty [IsEmpty ι] (m : M₂) : ContinuousMultilinearMap R M₁ M₂

(R : Type u)
{ι : Type v}
(M₁ : ι → Type w₁)
{M₂ : Type w₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
[(i : ι) → TopologicalSpace (M₁ i)]
[TopologicalSpace M₂]
[IsEmpty ι]
(m : M₂)

∀ (a : (i : ι) → M₁ i), (ContinuousMultilinearMap.constOfIsEmpty R M₁ m) a = m


{R : Type r}
[CommRing R]
(W : WeierstrassCurve R)


@[simp] theorem restrict_eq_self_iff : M ↾ R = M ↔ R = M.E

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


theorem toNNReal_sSup (s : Set ℝ≥0∞) (hs : ∀ r ∈ s, r ≠ ∞) :
    (sSup s).toNNReal = sSup (ENNReal.toNNReal '' s)


theorem init_add (x y : 𝕎 R) (n : ℕ) : init n (x + y) = init n (init n x + init n y)

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

WittVector.init n (x + y) = WittVector.init n (WittVector.init n x + WittVector.init n y)


@[simp]
theorem perm_inv_mapsTo_iff_mapsTo {f : Perm α} {s : Set α} [Finite s] :
    Set.MapsTo (f⁻¹ : _) s s ↔ Set.MapsTo f s s

{α : Type u}
{f : Equiv.Perm α}
{s : Set α}
[Finite ↑s]

Set.MapsTo (⇑f⁻¹) s s ↔ Set.MapsTo (⇑f) s s


/-- Every Schwartz function is continuous. -/
@[continuity]
protected theorem continuous (f : 𝓢(E, F)) : Continuous f

{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(f : SchwartzMap E F)


@[to_additive]
theorem map_comp (g : β → γ) (f : α → β) : map (g ∘ f) = (map g).comp (map f)

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

FreeMonoid.map (g ∘ f) = (FreeMonoid.map g).comp (FreeMonoid.map f)


/-- The inner product of a linear combination of a set of orthonormal vectors with one of those
vectors picks out the coefficient of that vector. -/
theorem Orthonormal.inner_left_finsupp {v : ι → E} (hv : Orthonormal 𝕜 v) (l : ι →₀ 𝕜) (i : ι) :
    ⟪Finsupp.total ι E 𝕜 v l, v i⟫ = conj (l i)

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

⟪(Finsupp.total ι E 𝕜 v) l, v i⟫_𝕜 = (starRingEnd 𝕜) (l i)


protected theorem lift_mk (f : α → β) (c) (a : α) : lift f c (mk a) = f a

{α : Sort u_1}
{β : Sort u_2}
(f : α → β)
(c : ∀ (a b : α), f a = f b)
(a : α)


theorem finite_biUnion_mem_iff {is : Set β} {s : β → Set α} (his : is.Finite) :
    (⋃ i ∈ is, s i) ∈ f ↔ ∃ i ∈ is, s i ∈ f

{α : Type u}
{β : Type v}
{f : Ultrafilter α}
{is : Set β}
{s : β → Set α}
(his : is.Finite)


@[simp]
theorem Ioc_union_Ioi_eq_Ioi (h : a ≤ b) : Ioc a b ∪ Ioi b = Ioi a

{α : Type u_1}
[LinearOrder α]
{a b : α}
(h : a ≤ b)


/-- If `E` is a normed space, `Lp.simpleFunc E p μ` is a normed space. Not declared as an
instance as it is (as of writing) used only in the construction of the Bochner integral. -/
protected theorem boundedSMul [Fact (1 ≤ p)] : BoundedSMul 𝕜 (Lp.simpleFunc E p μ)

{α : Type u_1}
{E : Type u_4}
{𝕜 : Type u_6}
[MeasurableSpace α]
[NormedAddCommGroup E]
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedRing 𝕜]
[Module 𝕜 E]
[BoundedSMul 𝕜 E]
[Fact (1 ≤ p)]

BoundedSMul 𝕜 ↥(MeasureTheory.Lp.simpleFunc E p μ)


@[simp]
theorem add_one_eq_succ (o : Ordinal) : o + 1 = succ o


theorem mapClusterPt_iff_ultrafilter {ι : Type*} (x : X) (F : Filter ι) (u : ι → X) :
    MapClusterPt x F u ↔ ∃ U : Ultrafilter ι, U ≤ F ∧ Tendsto u U (𝓝 x)

{X : Type u}
[TopologicalSpace X]
{ι : Type u_3}
(x : X)
(F : Filter ι)
(u : ι → X)

MapClusterPt x F u ↔ ∃ U, ↑U ≤ F ∧ Filter.Tendsto u (↑U) (𝓝 x)


theorem combine_sat' {s t : Constraint} {x y} (ws : s.sat' x y) (wt : t.sat' x y) :
    (s.combine t).sat' x y

{s t : Lean.Omega.Constraint}
{x y : Lean.Omega.Coeffs}
(ws : s.sat' x y = true)
(wt : t.sat' x y = true)


theorem smooth_fst : Smooth (I.prod J) I (@Prod.fst M N)

{𝕜 : 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]
{F : Type u_11}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_12}
[TopologicalSpace G]
{J : ModelWithCorners 𝕜 F G}
{N : Type u_13}
[TopologicalSpace N]
[ChartedSpace G N]


/-- Typeclass for maps satisfying `f (x + a) = f x + b`.

Note that `a` and `b` are `outParam`s,
so one should not add instances like
`[AddConstMapClass F G H a b] : AddConstMapClass F G H (-a) (-b)`. -/
class AddConstMapClass (F : Type*) (G H : outParam Type*) [Add G] [Add H]
    (a : outParam G) (b : outParam H) [FunLike F G H] : Prop where
  /-- A map of `AddConstMapClass` class semiconjugates shift by `a` to the shift by `b`:
  `∀ x, f (x + a) = f x + b`. -/
  map_add_const (f : F) (x : G) : f (x + a) = f x + b

{F : Type u_1}
{G : outParam (Type u_2)}
{H : outParam (Type u_3)}
[Add G]
[Add H]
{a : outParam G}
{b : outParam H}
[FunLike F G H]
[self : AddConstMapClass F G H a b]
(f : F)
(x : G)


theorem lt_iff_le_and_exists : p < q ↔ p ≤ q ∧ ∃ x ∈ q, x ∉ p

{A : Type u_1}
{B : Type u_2}
[i : SetLike A B]
{p q : A}


@[simp]
theorem inf_apply (f g : InfHom α β) (a : α) : (f ⊓ g) a = f a ⊓ g a

{α : Type u_3}
{β : Type u_4}
[Inf α]
[SemilatticeInf β]
(f g : InfHom α β)
(a : α)


@[to_additive (attr := simp)]
theorem iUnion_inv (s : ι → Set α) : (⋃ i, s i)⁻¹ = ⋃ i, (s i)⁻¹

{α : Type u_2}
{ι : Sort u_5}
[Neg α]
(s : ι → Set α)


theorem mul_single_apply_aux [Mul G] (f : MonoidAlgebra k G) {r : k} {x y z : G}
    (H : ∀ a, a * x = z ↔ a = y) : (f * single x r) z = f y * r

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[Mul G]
(f : MonoidAlgebra k G)
{r : k}
{x y z : G}
(H : ∀ (a : G), a * x = z ↔ a = y)

(f * MonoidAlgebra.single x r) z = f y * r


/-- The canonical `LeftHomologyData` of a short complex `S` in an abelian category, for
which the `H` field is `Abelian.coimage (kernel.ι S.g ≫ cokernel.π S.f)`. -/
@[simps]
noncomputable def ofAbelian : S.LeftHomologyData

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
(S : CategoryTheory.ShortComplex C)

(CategoryTheory.ShortComplex.LeftHomologyData.ofAbelian S).H =
  CategoryTheory.Abelian.coimage
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.kernel.ι S.g) (CategoryTheory.Limits.cokernel.π S.f))


theorem isUnit_den (r : ℚ) (h : ‖(r : ℚ_[p])‖ ≤ 1) : IsUnit (r.den : ℤ_[p])

{p : ℕ}
[hp_prime : Fact (Nat.Prime p)]
(r : ℚ)
(h : ‖↑r‖ ≤ 1)


@[to_additive]
theorem op_smul_inter_ne_empty_iff {s t : Set α} {x : αᵐᵒᵖ} :
    x • s ∩ t ≠ ∅ ↔ ∃ a b, (a ∈ s ∧ b ∈ t) ∧ a⁻¹ * b = MulOpposite.unop x

{α : Type u_2}
[Group α]
{s t : Set α}
{x : αᵐᵒᵖ}


theorem Filter.EventuallyEq.differentiableWithinAt_iff (h : f₀ =ᶠ[𝓝[s] x] f₁) (hx : f₀ x = f₁ x) :
    DifferentiableWithinAt 𝕜 f₀ s x ↔ DifferentiableWithinAt 𝕜 f₁ s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f₀ f₁ : E → F}
{x : E}
{s : Set E}
(h : f₀ =ᶠ[𝓝[s] x] f₁)
(hx : f₀ x = f₁ x)


theorem irreducible_mul_isUnit {a b : α} (h : IsUnit a) : Irreducible (b * a) ↔ Irreducible b

{α : Type u_1}
[Monoid α]
{a b : α}
(h : IsUnit a)


theorem coprime_one_right_iff (n : ℕ) : Coprime n 1 ↔ True


lemma polynomialY_eq : W'.polynomialY = C 2 * X 1 + C W'.a₁ * X 0 * X 2 + C W'.a₃ * X 2 ^ 3

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}

W'.polynomialY =
  MvPolynomial.C 2 * MvPolynomial.X y + MvPolynomial.C W'.a₁ * MvPolynomial.X x * MvPolynomial.X z +
    MvPolynomial.C W'.a₃ * MvPolynomial.X z ^ 3


/-- The diagram of the multifork attached to a presheaf
`F : Cᵒᵖ ⥤ A`, `S : C` and `E : PreOneHypercover S`. -/
@[simps]
def multicospanIndex (F : Cᵒᵖ ⥤ A) : MulticospanIndex A

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{A : Type u_1}
[CategoryTheory.Category.{u_2, u_1} A]
{S : C}
(E : CategoryTheory.PreOneHypercover S)
(F : CategoryTheory.Functor Cᵒᵖ A)
(j : E.I₁')

(E.multicospanIndex F).sndTo j = j.fst.2


private theorem add_comm' (x y : LocalizedModule S M) : x + y = y + x

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{M : Type v}
[AddCommMonoid M]
[Module R M]
(x y : LocalizedModule S M)


theorem space_bot : (⊥ : SimplicialComplex 𝕜 E).space = ∅

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]


/-- Induction principle for intervals of real numbers: if a proposition `P` is true
on `[x₀, r * x₀)` and if `P` for `[x₀, r^n * x₀)` implies `P` for `[r^n * x₀, r^(n+1) * x₀)`,
then `P` is true for all `x ≥ x₀`. -/
lemma Real.induction_Ico_mul {P : ℝ → Prop} (x₀ r : ℝ) (hr : 1 < r) (hx₀ : 0 < x₀)
    (base : ∀ x ∈ Set.Ico x₀ (r * x₀), P x)
    (step : ∀ n : ℕ, n ≥ 1 → (∀ z ∈ Set.Ico x₀ (r ^ n * x₀), P z) →
      (∀ z ∈ Set.Ico (r ^ n * x₀) (r ^ (n+1) * x₀), P z)) :
    ∀ x ≥ x₀, P x

(step : ∀ n ≥ 1, (∀ z ∈ Set.Ico x₀ (r ^ n * x₀), P z) → ∀ z ∈ Set.Ico (r ^ n * x₀) (r ^ (n + 1) * x₀), P z)


theorem Tendsto.nhds_atTop [NoMaxOrder X] {f : α → X} {l : Filter α} (h : Tendsto f l atTop) :
    Tendsto (𝓝 ∘ f) l (𝓝 atTop)

{α : Type u_1}
{X : Type u_2}
[TopologicalSpace X]
[PartialOrder X]
[OrderTopology X]
[NoMaxOrder X]
{f : α → X}
{l : Filter α}
(h : Filter.Tendsto f l Filter.atTop)

Filter.Tendsto (𝓝 ∘ f) l (𝓝 Filter.atTop)


lemma epi_of_isZero_cokernel {X Y : C} (f : X ⟶ Y) [HasCokernel f] (h : IsZero (cokernel f)) :
    Epi f

(h : CategoryTheory.Limits.IsZero (CategoryTheory.Limits.cokernel f))


@[ext]
theorem lieAlgebra_ext {x y : ⨁ i, L i}
    (h : ∀ i, lieAlgebraComponent R ι L i x = lieAlgebraComponent R ι L i y) : x = y

(h : ∀ (i : ι), (DirectSum.lieAlgebraComponent R ι L i) x = (DirectSum.lieAlgebraComponent R ι L i) y)


theorem orderIso_comp [Preorder α] [Preorder β] [Preorder γ] {f : α → β} {g : β → α}
    (h : IsOrderRightAdjoint f g) (e : β ≃o γ) : IsOrderRightAdjoint (e ∘ f) (g ∘ e.symm)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Preorder α]
[Preorder β]
[Preorder γ]
{f : α → β}
{g : β → α}
(h : IsOrderRightAdjoint f g)
(e : β ≃o γ)

IsOrderRightAdjoint (⇑e ∘ f) (g ∘ ⇑e.symm)


theorem zorn_superset_nonempty (S : Set (Set α))
    (H : ∀ c ⊆ S, IsChain (· ⊆ ·) c → c.Nonempty → ∃ lb ∈ S, ∀ s ∈ c, lb ⊆ s) (x)
    (hx : x ∈ S) : ∃ m ∈ S, m ⊆ x ∧ ∀ a ∈ S, a ⊆ m → a = m

(H : ∀ c ⊆ S, IsChain (fun x x_1 => x ⊆ x_1) c → c.Nonempty → ∃ lb ∈ S, ∀ s ∈ c, lb ⊆ s)


/-- A `StrictOrderedRing` is a ring with a partial order such that addition is strictly monotone
and multiplication by a positive number is strictly monotone. -/
class StrictOrderedRing (α : Type u) extends Ring α, OrderedAddCommGroup α, Nontrivial α where
  /-- In a strict ordered ring, `0 ≤ 1`. -/
  protected zero_le_one : 0 ≤ (1 : α)
  /-- The product of two positive elements is positive. -/
  protected mul_pos : ∀ a b : α, 0 < a → 0 < b → 0 < a * b

{α : Type u}
[self : StrictOrderedRing α]


/-- An injective presentation of an object `X` consists of a monomorphism `f : X ⟶ J`
to some injective object `J`.
-/
structure InjectivePresentation (X : C) where
  J : C
  injective : Injective J := by infer_instance
  f : X ⟶ J
  mono : Mono f := by infer_instance

(self : CategoryTheory.InjectivePresentation X)


/-- If the multiplicative supports of `f` and `g` are finite, then the product of `f i * g i` equals
the product of `f i` multiplied by the product of `g i`. -/
@[to_additive
      "If the additive supports of `f` and `g` are finite, then the sum of `f i + g i`
      equals the sum of `f i` plus the sum of `g i`."]
theorem finprod_mul_distrib (hf : (mulSupport f).Finite) (hg : (mulSupport g).Finite) :
    ∏ᶠ i, f i * g i = (∏ᶠ i, f i) * ∏ᶠ i, g i

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
{f g : α → M}
(hf : (Function.support f).Finite)
(hg : (Function.support g).Finite)

∑ᶠ (i : α), (f i + g i) = ∑ᶠ (i : α), f i + ∑ᶠ (i : α), g i


lemma mul_def (q r : ℚ≥0) : q * r = divNat (q.num * r.num) (q.den * r.den)

q * r = NNRat.divNat (q.num * r.num) (q.den * r.den)


theorem abs_max_sub_max_le_abs (a b c : α) : |max a c - max b c| ≤ |a - b|

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


theorem swap_comm (a b : α) : swap a b = swap b a

{α : Sort u_1}
[DecidableEq α]
(a b : α)


/-- If `E / F` and `K / E` are both separable extensions, then `K / F` is also separable. -/
theorem Algebra.IsSeparable.trans [Algebra E K] [IsScalarTower F E K]
    [Algebra.IsSeparable F E] [Algebra.IsSeparable E K] : Algebra.IsSeparable F K

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(K : Type w)
[Field K]
[Algebra F K]
[Algebra E K]
[IsScalarTower F E K]
[Algebra.IsSeparable F E]
[Algebra.IsSeparable E K]


/-- If `p : Set X → Prop` is stable under restriction and union, and each point `x`
  of a compact set `s` has a neighborhood `t` within `s` such that `p t`, then `p s` holds. -/
@[elab_as_elim]
theorem IsCompact.induction_on (hs : IsCompact s) {p : Set X → Prop} (he : p ∅)
    (hmono : ∀ ⦃s t⦄, s ⊆ t → p t → p s) (hunion : ∀ ⦃s t⦄, p s → p t → p (s ∪ t))
    (hnhds : ∀ x ∈ s, ∃ t ∈ 𝓝[s] x, p t) : p s

(hmono : ∀ ⦃s t : Set X⦄, s ⊆ t → p t → p s)

(hunion : ∀ ⦃s t : Set X⦄, p s → p t → p (s ∪ t))


theorem bind_defined {α β γ} (p : Set α) {f : α →. β} {g : β → α →. γ} (H1 : p ⊆ f.Dom)
    (H2 : ∀ x, p ⊆ (g x).Dom) : p ⊆ (f >>= g).Dom

{α : Type u_7}
{β γ : Type u_8}
(p : Set α)
{f : α →. β}
{g : β → α →. γ}
(H1 : p ⊆ f.Dom)
(H2 : ∀ (x : β), p ⊆ (g x).Dom)


lemma δ_comp {n₁ n₂ n₁₂ : ℤ} (z₁ : Cochain F G n₁) (z₂ : Cochain G K n₂) (h : n₁ + n₂ = n₁₂)
    (m₁ m₂ m₁₂ : ℤ) (h₁₂ : n₁₂ + 1 = m₁₂) (h₁ : n₁ + 1 = m₁) (h₂ : n₂ + 1 = m₂) :
    δ n₁₂ m₁₂ (z₁.comp z₂ h) = z₁.comp (δ n₂ m₂ z₂) (by rw [← h₁₂, ← h₂, ← h, add_assoc]) +
      n₂.negOnePow • (δ n₁ m₁ z₁).comp z₂
        (by rw [← h₁₂, ← h₁, ← h, add_assoc, add_comm 1, add_assoc])

(z₁ : CochainComplex.HomComplex.Cochain F G n₁)

(z₂ : CochainComplex.HomComplex.Cochain G K n₂)

CochainComplex.HomComplex.δ n₁₂ m₁₂ (z₁.comp z₂ h) =
  z₁.comp (CochainComplex.HomComplex.δ n₂ m₂ z₂) ⋯ + n₂.negOnePow • (CochainComplex.HomComplex.δ n₁ m₁ z₁).comp z₂ ⋯


@[simp]
theorem equivFunOnFintype_symm_coe [Fintype ι] (f : Π₀ i, β i) : equivFunOnFintype.symm f = f

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


theorem contDiffOn_iff_continuousOn_differentiableOn (hs : UniqueDiffOn 𝕜 s) :
    ContDiffOn 𝕜 n f s ↔
      (∀ m : ℕ, (m : ℕ∞) ≤ n → ContinuousOn (fun x => iteratedFDerivWithin 𝕜 m f s x) s) ∧
        ∀ m : ℕ, (m : ℕ∞) < n → DifferentiableOn 𝕜 (fun x => iteratedFDerivWithin 𝕜 m f s x) s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{n : ℕ∞}
(hs : UniqueDiffOn 𝕜 s)

ContDiffOn 𝕜 n f s ↔
  (∀ (m : ℕ), ↑m ≤ n → ContinuousOn (fun x => iteratedFDerivWithin 𝕜 m f s x) s) ∧
    ∀ (m : ℕ), ↑m < n → DifferentiableOn 𝕜 (fun x => iteratedFDerivWithin 𝕜 m f s x) s


theorem add_mulVec [Fintype n] (A B : Matrix m n α) (x : n → α) :
    (A + B) *ᵥ x = A *ᵥ x + B *ᵥ x

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonUnitalNonAssocSemiring α]
[Fintype n]
(A B : Matrix m n α)
(x : n → α)


theorem compare_of_injective_eq_compareOfLessAndEq (a b : α) [LinearOrder β]
    [DecidableEq α] (f : α → β) (inj : Injective f)
    [Decidable (LT.lt (self := PartialOrder.lift f inj |>.toLT) a b)] :
    compare (f a) (f b) =
      @compareOfLessAndEq _ a b (PartialOrder.lift f inj |>.toLT) _ _

{α : Type u_2}
{β : Type u_3}
(a b : α)
[LinearOrder β]
[DecidableEq α]
(f : α → β)
(inj : Function.Injective f)
[Decidable (a < b)]

compare (f a) (f b) = compareOfLessAndEq a b


theorem length_simple_mul_ne (w : W) (i : B) : ℓ (s i * w) ≠ ℓ w

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

cs.length (cs.simple i * w) ≠ cs.length w


theorem tendstoLocallyUniformlyOn_iff_forall_tendsto :
    TendstoLocallyUniformlyOn F f p s ↔
      ∀ x ∈ s, Tendsto (fun y : ι × α => (f y.2, F y.1 y.2)) (p ×ˢ 𝓝[s] x) (𝓤 β)

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{s : Set α}
{p : Filter ι}
[TopologicalSpace α]

TendstoLocallyUniformlyOn F f p s ↔ ∀ x ∈ s, Filter.Tendsto (fun y => (f y.2, F y.1 y.2)) (p ×ˢ 𝓝[s] x) (𝓤 β)


theorem stronglyMeasurable_stoppedValue_of_le (h : ProgMeasurable f u) (hτ : IsStoppingTime f τ)
    {n : ι} (hτ_le : ∀ ω, τ ω ≤ n) : StronglyMeasurable[f n] (stoppedValue u τ)

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[LinearOrder ι]
[MeasurableSpace ι]
[TopologicalSpace ι]
[OrderTopology ι]
[SecondCountableTopology ι]
[BorelSpace ι]
[TopologicalSpace β]
{u : ι → Ω → β}
{τ : Ω → ι}
{f : MeasureTheory.Filtration ι m}
(h : MeasureTheory.ProgMeasurable f u)
(hτ : MeasureTheory.IsStoppingTime f τ)
{n : ι}
(hτ_le : ∀ (ω : Ω), τ ω ≤ n)

MeasureTheory.StronglyMeasurable (MeasureTheory.stoppedValue u τ)


@[simp]
theorem binaryProductCone_fst (X Y : Type u) : (binaryProductCone X Y).fst = _root_.Prod.fst

(CategoryTheory.Limits.Types.binaryProductCone X Y).fst = Prod.fst


@[simp]
theorem shadow_singleton_empty : ∂ ({∅} : Finset (Finset α)) = ∅


protected theorem comp {t : ι → Ω → ι} [TopologicalSpace ι] [BorelSpace ι] [MetrizableSpace ι]
    (h : ProgMeasurable f u) (ht : ProgMeasurable f t) (ht_le : ∀ i ω, t i ω ≤ i) :
    ProgMeasurable f fun i ω => u (t i ω) ω

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[TopologicalSpace β]
[Preorder ι]
{u : ι → Ω → β}
{f : MeasureTheory.Filtration ι m}
[MeasurableSpace ι]
{t : ι → Ω → ι}
[TopologicalSpace ι]
[BorelSpace ι]
[TopologicalSpace.MetrizableSpace ι]
(h : MeasureTheory.ProgMeasurable f u)
(ht : MeasureTheory.ProgMeasurable f t)
(ht_le : ∀ (i : ι) (ω : Ω), t i ω ≤ i)

MeasureTheory.ProgMeasurable f fun i ω => u (t i ω) ω


/-- `R` is integrally closed iff it is the integral closure of itself in its field of fractions. -/
theorem isIntegrallyClosed_iff_isIntegralClosure : IsIntegrallyClosed R ↔ IsIntegralClosure R R K

{R : Type u_1}
[CommRing R]
(K : Type u_4)
[CommRing K]
[Algebra R K]
[IsFractionRing R K]


@[to_additive (attr := simp)]
theorem card_eq_iff_eq_top [Finite H] : Nat.card H = Nat.card G ↔ H = ⊤

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


theorem subsingleton_bot : Subsingleton (⊥ : LieSubalgebra R L)

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]


theorem lt_of_incomp_of_lt {α : Sort u} {lt : α → α → Prop} [IsStrictWeakOrder α lt]
    [DecidableRel lt] : ∀ {a b c}, ¬lt a b ∧ ¬lt b a → lt b c → lt a c

{α : Sort u}
{lt : α → α → Prop}
[IsStrictWeakOrder α lt]
[DecidableRel lt]
{a b c : α}


protected lemma Monotone.sInf (hs : ∀ f ∈ s, Monotone f) : Monotone (sInf s)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[CompleteLattice β]
{s : Set (α → β)}
(hs : ∀ f ∈ s, Monotone f)


lemma continuousAt_jacobiTheta₂' (z : ℂ) {τ : ℂ} (hτ : 0 < im τ) :
    ContinuousAt (fun p : ℂ × ℂ ↦ jacobiTheta₂' p.1 p.2) (z, τ)

ContinuousAt (fun p => jacobiTheta₂' p.1 p.2) (z, τ)


theorem prod_edist_eq_sup (f g : WithLp ∞ (α × β)) :
    edist f g = edist f.fst g.fst ⊔ edist f.snd g.snd

{α : Type u_2}
{β : Type u_3}
[EDist α]
[EDist β]
(f g : WithLp ⊤ (α × β))

edist f g = edist f.1 g.1 ⊔ edist f.2 g.2


theorem delayReflRight_zero (γ : Path x y) : delayReflRight 0 γ = γ.trans (Path.refl y)

{X : Type u}
[TopologicalSpace X]
{x y : X}
(γ : Path x y)

Path.delayReflRight 0 γ = γ.trans (Path.refl y)


theorem intCast_val (n : ℤ) : (n : ℤ√d) = ⟨n, 0⟩


@[simp]
theorem univ_sum_single_apply' [AddCommMonoid M] [Fintype α] (i : α) (m : M) :
    ∑ j : α, single j m i = m

{α : Type u_1}
{M : Type u_8}
[AddCommMonoid M]
[Fintype α]
(i : α)
(m : M)


theorem HasStrictFDerivAt.isBigO_sub_rev {f' : E ≃L[𝕜] F}
    (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) x) :
    (fun p : E × E => p.1 - p.2) =O[𝓝 (x, x)] fun p : E × E => f p.1 - f p.2

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


/-- Descend a continuous map, which is constant on the fibres, along a quotient map. -/
@[simps]
noncomputable def lift : C(Y, Z)

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : C(X, Y)}
(hf : QuotientMap ⇑f)
(g : C(X, Z))
(h : Function.FactorsThrough ⇑g ⇑f)

∀ (a : Y), (hf.lift g h) a = ((fun i => i.liftOn' ⇑g ⋯) ∘ ⇑hf.homeomorph.symm) a


theorem symm_mapsTo (h : e.IsImage s t) : MapsTo e.symm (e.target ∩ t) (e.source ∩ s)

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{e : PartialHomeomorph X Y}
{s : Set X}
{t : Set Y}
(h : e.IsImage s t)

Set.MapsTo (↑e.symm) (e.target ∩ t) (e.source ∩ s)


@[to_additive]
theorem pow_le_one_iff {x : M} {n : ℕ} (hn : n ≠ 0) : x ^ n ≤ 1 ↔ x ≤ 1

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


@[simp]
theorem iInter_exists {p : ι → Prop} {f : Exists p → Set α} :
    ⋂ x, f x = ⋂ (i) (h : p i), f ⟨i, h⟩

{α : Type u_1}
{ι : Sort u_4}
{p : ι → Prop}
{f : Exists p → Set α}

⋂ (x : Exists p), f x = ⋂ i, ⋂ (h : p i), f ⋯


theorem dist_lt_iff_of_nonempty_compact [Nonempty α] [CompactSpace α] :
    dist f g < C ↔ ∀ x : α, dist (f x) (g x) < C

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
{f g : BoundedContinuousFunction α β}
{C : ℝ}
[Nonempty α]
[CompactSpace α]

dist f g < C ↔ ∀ (x : α), dist (f x) (g x) < C


@[simp]
theorem coe_ofSurjective (f : F →ₛₗᵢ[σ₁₂] E₂) (hfr : Function.Surjective f) :
    ⇑(LinearIsometryEquiv.ofSurjective f hfr) = f

{R : Type u_1}
{R₂ : Type u_2}
{E₂ : Type u_6}
{F : Type u_9}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E₂]
[Module R₂ E₂]
[NormedAddCommGroup F]
[Module R F]
(f : F →ₛₗᵢ[σ₁₂] E₂)
(hfr : Function.Surjective ⇑f)

⇑(LinearIsometryEquiv.ofSurjective f hfr) = ⇑f


theorem archimedean_iff_rat_le : Archimedean α ↔ ∀ x : α, ∃ q : ℚ, x ≤ q


theorem IsCycle.pow_eq_pow_iff [Finite β] {f : Perm β} (hf : IsCycle f) {a b : ℕ} :
    f ^ a = f ^ b ↔ ∃ x, f x ≠ x ∧ (f ^ a) x = (f ^ b) x

{β : Type u_3}
[Finite β]
{f : Equiv.Perm β}
(hf : f.IsCycle)
{a b : ℕ}


/-- If `S` is a subset of `R`, and `S` is covering, then `R` is covering as well.

See <https://stacks.math.columbia.edu/tag/00Z5> (2), or discussion after [MM92] Chapter III,
Section 2, Definition 1.
-/
theorem superset_covering (Hss : S ≤ R) (sjx : S ∈ J X) : R ∈ J X

(J : CategoryTheory.GrothendieckTopology C)


theorem zorn_partialOrder₀ (s : Set α)
    (ih : ∀ c ⊆ s, IsChain (· ≤ ·) c → ∃ ub ∈ s, ∀ z ∈ c, z ≤ ub) :
    ∃ m ∈ s, ∀ z ∈ s, m ≤ z → z = m

(ih : ∀ c ⊆ s, IsChain (fun x x_1 => x ≤ x_1) c → ∃ ub ∈ s, ∀ z ∈ c, z ≤ ub)


@[simp]
theorem mem_Iic : x ∈ Iic b ↔ x ≤ b


/-- `sSup` and `Iic` form a Galois connection. -/
theorem gc_sSup_Iic [CompleteSemilatticeSup α] :
    GaloisConnection (sSup : Set α → α) (Iic : α → Set α)


theorem continuousOn_of_dominated {F : X → α → G} {bound : α → ℝ} {s : Set X}
    (hF_meas : ∀ x ∈ s, AEStronglyMeasurable (F x) μ)
    (h_bound : ∀ x ∈ s, ∀ᵐ a ∂μ, ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound μ)
    (h_cont : ∀ᵐ a ∂μ, ContinuousOn (fun x => F x a) s) :
    ContinuousOn (fun x => ∫ a, F x a ∂μ) s

(hF_meas : ∀ x ∈ s, MeasureTheory.AEStronglyMeasurable (F x) μ)

(h_bound : ∀ x ∈ s, ∀ᵐ (a : α) ∂μ, ‖F x a‖ ≤ bound a)

(bound_integrable : MeasureTheory.Integrable bound μ)

(h_cont : ∀ᵐ (a : α) ∂μ, ContinuousOn (fun x => F x a) s)

ContinuousOn (fun x => ∫ (a : α), F x a ∂μ) s


theorem map_le : map f I ≤ J ↔ f '' I ⊆ J

{R : Type u}
{L : Type v}
{L' : Type w₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
(f : L →ₗ⁅R⁆ L')
(I : LieIdeal R L)
(J : LieIdeal R L')


@[to_additive]
theorem Subgroup.isSubgroup [Group G] (K : Subgroup G) : IsSubgroup (K : Set G)

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


protected theorem IsFiniteMeasureOnCompacts.map (μ : Measure α) [IsFiniteMeasureOnCompacts μ]
    (f : α ≃ₜ β) : IsFiniteMeasureOnCompacts (Measure.map f μ)

(f : α ≃ₜ β)

MeasureTheory.IsFiniteMeasureOnCompacts (MeasureTheory.Measure.map (⇑f) μ)


@[simp]
theorem lift_comp_castAddHom : (ZMod.lift n f).comp (Int.castAddHom (ZMod n)) = f

(n : ℕ)
{A : Type u_2}
[AddGroup A]
(f : { f // f ↑n = 0 })

((ZMod.lift n) f).comp (Int.castAddHom (ZMod n)) = ↑f


/-- For `s` to be a fundamental domain, it's enough to check
`MeasureTheory.AEDisjoint (g • s) s` for `g ≠ 1`. -/
@[to_additive "For `s` to be a fundamental domain, it's enough to check
  `MeasureTheory.AEDisjoint (g +ᵥ s) s` for `g ≠ 0`."]
theorem mk'' (h_meas : NullMeasurableSet s μ) (h_ae_covers : ∀ᵐ x ∂μ, ∃ g : G, g • x ∈ s)
    (h_ae_disjoint : ∀ g, g ≠ (1 : G) → AEDisjoint μ (g • s) s)
    (h_qmp : ∀ g : G, QuasiMeasurePreserving ((g • ·) : α → α) μ μ) :
    IsFundamentalDomain G s μ

(h_meas : MeasureTheory.NullMeasurableSet s μ)

(h_ae_covers : ∀ᵐ (x : α) ∂μ, ∃ g, g • x ∈ s)

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

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


@[simp] lemma shadow_compls : ∂ 𝒜ᶜˢ = (∂⁺ 𝒜)ᶜˢ

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


protected theorem sub_le_self (a : Int) {b : Int} (h : 0 ≤ b) : a - b ≤ a


/-- The algebra isomorphism between multivariable polynomials in `Option S₁` and
polynomials with coefficients in `MvPolynomial S₁ R`.
-/
@[simps!]
def optionEquivLeft : MvPolynomial (Option S₁) R ≃ₐ[R] Polynomial (MvPolynomial S₁ R)

(R : Type u)
(S₁ : Type v)
[CommSemiring R]
(a : (MvPolynomial S₁ R)[X])

(MvPolynomial.optionEquivLeft R S₁).symm a = (Polynomial.aevalTower (MvPolynomial.rename some) (MvPolynomial.X none)) a


/-- `liminf (c - xᵢ) = c - limsup xᵢ`. -/
lemma liminf_const_sub (F : Filter ι) [NeBot F] [AddCommSemigroup R] [Sub R] [ContinuousSub R]
    [OrderedSub R] [CovariantClass R R (fun x y ↦ x + y) fun x y ↦ x ≤ y] (f : ι → R) (c : R)
    (bdd_above : F.IsBoundedUnder (· ≤ ·) f) (cobdd : F.IsCoboundedUnder (· ≤ ·) f) :
    Filter.liminf (fun i ↦ c - f i) F = c - Filter.limsup f F

[CovariantClass R R (fun x y => x + y) fun x y => x ≤ y]

(bdd_above : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) F f)

(cobdd : Filter.IsCoboundedUnder (fun x x_1 => x ≤ x_1) F f)

Filter.liminf (fun i => c - f i) F = c - Filter.limsup f F


@[simp]
theorem inf_erase_top [DecidableEq α] (s : Finset α) : (s.erase ⊤).inf id = s.inf id

{α : Type u_2}
[SemilatticeInf α]
[OrderTop α]
[DecidableEq α]
(s : Finset α)


theorem Ioo_subset_Ici_self : Ioo a b ⊆ Ici a

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


@[simp, measurability]
protected theorem MeasurableSet.diff {s₁ s₂ : Set α} (h₁ : MeasurableSet s₁)
    (h₂ : MeasurableSet s₂) : MeasurableSet (s₁ \ s₂)

{α : Type u_1}
{m : MeasurableSpace α}
{s₁ s₂ : Set α}
(h₁ : MeasurableSet s₁)
(h₂ : MeasurableSet s₂)


@[simp] lemma algebraMap_apply (x : S) : algebraMap S L x = x

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)
(x : ↥S)


theorem iteratedPDeriv_succ_left {n : ℕ} (m : Fin (n + 1) → E) (f : 𝓢(E, F)) :
    iteratedPDeriv 𝕜 m f = pderivCLM 𝕜 (m 0) (iteratedPDeriv 𝕜 (Fin.tail m) f)

(𝕜 : Type u_1)
{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[RCLike 𝕜]
[NormedSpace 𝕜 F]
[SMulCommClass ℝ 𝕜 F]
{n : ℕ}
(m : Fin (n + 1) → E)
(f : SchwartzMap E F)

(SchwartzMap.iteratedPDeriv 𝕜 m) f = (SchwartzMap.pderivCLM 𝕜 (m 0)) ((SchwartzMap.iteratedPDeriv 𝕜 (Fin.tail m)) f)


theorem slice_zero [Zero α] (i : ℕ) (hid : i < d) : slice (0 : Holor α (d :: ds)) i hid = 0

{α : Type}
{d : ℕ}
{ds : List ℕ}
[Zero α]
(i : ℕ)
(hid : i < d)


/-- Given a function `U : ι → α` for `[CompleteLattice α]`,
`iSup U` provides a cocone over `diagram U`.
-/
@[simps]
def cocone : Cocone (diagram U)

{ι α : Type v}
(U : ι → α)
[CompleteLattice α]

(CategoryTheory.Pairwise.cocone U).pt = iSup U


/-- The natural isomorphism `FA ⨿ F- ≅ F(A ⨿ -)`, provided each `coprodComparison F A B` is an
isomorphism (as `B` changes).
-/
-- @[simps (config := { rhsMd := semireducible })] -- Porting note: no config for semireducible
@[simps]
def coprodComparisonNatIso [HasBinaryCoproducts C] [HasBinaryCoproducts D] (A : C)
    [∀ B, IsIso (coprodComparison F A B)] :
    F ⋙ coprod.functor.obj (F.obj A) ≅ coprod.functor.obj A ⋙ F

[∀ (B : C), CategoryTheory.IsIso (CategoryTheory.Limits.coprodComparison F A B)]

(CategoryTheory.Limits.coprodComparisonNatIso F A).inv =
  (CategoryTheory.asIso { app := fun B => CategoryTheory.Limits.coprodComparison F A B, naturality := ⋯ }).inv


theorem neg_iff_pos_of_mul_neg [ExistsAddOfLE α] [PosMulMono α] [MulPosMono α]
    [CovariantClass α α (swap (· + ·)) (· ≤ ·)] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (hab : a * b < 0) : a < 0 ↔ 0 < b

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

[ContravariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


@[simp]
theorem not_sbtw_self (x y : P) : ¬Sbtw R x y x

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


/-- The linear map corresponding to `orthogonalProjection`. -/
@[simp]
theorem orthogonalProjection_linear {s : AffineSubspace ℝ P} [Nonempty s]
    [HasOrthogonalProjection s.direction] :
    (orthogonalProjection s).linear = _root_.orthogonalProjection s.direction

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{s : AffineSubspace ℝ P}
[Nonempty ↥s]
[HasOrthogonalProjection s.direction]

(EuclideanGeometry.orthogonalProjection s).linear = ↑(orthogonalProjection s.direction)


lemma setLIntegral_rnDeriv_le (s : Set α) :
    ∫⁻ x in s, μ.rnDeriv ν x ∂ν ≤ μ s

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


@[simp]
theorem IsSymm.neg [Neg α] {A : Matrix n n α} (h : A.IsSymm) : (-A).IsSymm

{α : Type u_1}
{n : Type u_3}
[Neg α]
{A : Matrix n n α}
(h : A.IsSymm)


@[to_additive]
theorem isNormalSubgroup_ker {f : G → H} (hf : IsGroupHom f) : IsNormalSubgroup (ker f)

{G : Type u_1}
{H : Type u_2}
[Group G]
[Group H]
{f : G → H}
(hf : IsGroupHom f)


theorem closure_sUnion (s : Set (Set R)) : closure (⋃₀ s) = ⨆ t ∈ s, closure t

{R : Type u}
[NonUnitalNonAssocSemiring R]
(s : Set (Set R))

NonUnitalSubsemiring.closure (⋃₀ s) = ⨆ t ∈ s, NonUnitalSubsemiring.closure t


@[to_additive (attr := simp)]
theorem le_div_self_iff (a : α) {b : α} : a ≤ a / b ↔ b ≤ 1

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


@[to_additive]
theorem cons_cons {p} : Red L₁ L₂ → Red (p :: L₁) (p :: L₂)

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

FreeAddGroup.Red L₁ L₂ → FreeAddGroup.Red (p :: L₁) (p :: L₂)


/-- `RelHomClass F r s` asserts that `F` is a type of functions such that all `f : F`
satisfy `r a b → s (f a) (f b)`.

The relations `r` and `s` are `outParam`s since figuring them out from a goal is a higher-order
matching problem that Lean usually can't do unaided.
-/
class RelHomClass (F : Type*) {α β : Type*} (r : outParam <| α → α → Prop)
  (s : outParam <| β → β → Prop) [FunLike F α β] : Prop where
  /-- A `RelHomClass` sends related elements to related elements -/
  map_rel : ∀ (f : F) {a b}, r a b → s (f a) (f b)

{F : Type u_5}
{α : Type u_6}
{β : Type u_7}
{r : outParam (α → α → Prop)}
{s : outParam (β → β → Prop)}
[FunLike F α β]
[self : RelHomClass F r s]
(f : F)
{a b : α}


/-- If `x` is a letter and `w` is a word such that `xw` reduces to the empty word, then `w` reduces
to `x⁻¹` -/
@[to_additive
  "If `x` is a letter and `w` is a word such that `x + w` reduces to the empty word, then `w`
  reduces to `-x`."]
theorem cons_nil_iff_singleton {x b} : Red ((x, b) :: L) [] ↔ Red L [(x, not b)]

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

FreeAddGroup.Red ((x, b) :: L) [] ↔ FreeAddGroup.Red L [(x, !b)]


/-- Reorder a product.

The difference with `Finset.prod_nbij'` is that the bijection is specified as a surjective
injection, rather than by an inverse function.

The difference with `Finset.prod_bij` is that the bijection is a non-dependent function, rather than
being allowed to use membership of the domain of the product. -/
@[to_additive "Reorder a sum.

The difference with `Finset.sum_nbij'` is that the bijection is specified as a surjective injection,
rather than by an inverse function.

The difference with `Finset.sum_bij` is that the bijection is a non-dependent function, rather than
being allowed to use membership of the domain of the sum."]
lemma prod_nbij (i : ι → κ) (hi : ∀ a ∈ s, i a ∈ t) (i_inj : (s : Set ι).InjOn i)
    (i_surj : (s : Set ι).SurjOn i t) (h : ∀ a ∈ s, f a = g (i a)) :
    ∏ x ∈ s, f x = ∏ x ∈ t, g x

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[AddCommMonoid α]
{s : Finset ι}
{t : Finset κ}
{f : ι → α}
{g : κ → α}
(i : ι → κ)
(hi : ∀ a ∈ s, i a ∈ t)
(i_inj : Set.InjOn i ↑s)
(i_surj : Set.SurjOn i ↑s ↑t)
(h : ∀ a ∈ s, f a = g (i a))


protected theorem div_le_iff' {x y z : ℝ≥0∞} (h1 : y ≠ 0) (h2 : y ≠ ∞) :
    x / y ≤ z ↔ x ≤ y * z

{x y z : ENNReal}
(h1 : y ≠ 0)
(h2 : y ≠ ⊤)


theorem _root_.HasCompactSupport.convolutionExistsLeft
    (hcf : HasCompactSupport f) (hf : Continuous f)
    (hg : LocallyIntegrable g μ) : ConvolutionExists f g L μ

(hg : MeasureTheory.LocallyIntegrable g μ)


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

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

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


theorem mk_list_eq_sum_pow (α : Type u) : #(List α) = sum fun n : ℕ => #α ^ n

Cardinal.mk (List α) = Cardinal.sum fun n => Cardinal.mk α ^ n


theorem sym_mul_sym [Mul α] [Add α] [One α] [OfNat α 2] [Invertible (2 : α)] (a b : α) :
    sym a * sym b = sym (⅟ 2 * (a * b + b * a))

{α : Type u_1}
[Mul α]
[Add α]
[One α]
[OfNat α 2]
[Invertible 2]
(a b : α)

SymAlg.sym a * SymAlg.sym b = SymAlg.sym (⅟2 * (a * b + b * a))


lemma baseChange_preΨ' (n : ℕ) : (W.baseChange B).preΨ' n = ((W.baseChange A).preΨ' n).map f

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

(W.baseChange B).preΨ' n = Polynomial.map (↑f) ((W.baseChange A).preΨ' n)


/-- `adjust_to_orientation` gives a basis with the required orientation. -/
@[simp]
theorem orientation_adjustToOrientation [Nonempty ι] (e : Basis ι R M)
    (x : Orientation R M ι) : (e.adjustToOrientation x).orientation = x

{R : Type u_1}
[LinearOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{ι : Type u_3}
[Fintype ι]
[DecidableEq ι]
[Nonempty ι]
(e : Basis ι R M)
(x : Orientation R M ι)


@[reassoc (attr := simp)]
theorem w {A B : StructuredArrow S T} (f : A ⟶ B) : A.hom ≫ T.map f.right = B.hom

{A B : CategoryTheory.StructuredArrow S T}

CategoryTheory.CategoryStruct.comp A.hom (T.map f.right) = B.hom


@[simp] lemma floorDiv_eq_div (a b : ℕ) : a ⌊/⌋ b = a / b


theorem Continuous.borel_measurable [TopologicalSpace α] [TopologicalSpace β] {f : α → β}
    (hf : Continuous f) : @Measurable α β (borel α) (borel β) f

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
(hf : Continuous f)


theorem rotation_map (θ : Real.Angle) (f : V ≃ₗᵢ[ℝ] V') (x : V') :
    (Orientation.map (Fin 2) f.toLinearEquiv o).rotation θ x = f (o.rotation θ (f.symm x))

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

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

(((Orientation.map (Fin 2) f.toLinearEquiv) o).rotation θ) x = f ((o.rotation θ) (f.symm x))


/-- Reflection is its own inverse. -/
@[simp]
theorem reflection_symm : (reflection K).symm = reflection K

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
[HasOrthogonalProjection K]


/-- The sine of an angle in a right-angled triangle as a ratio of sides. -/
theorem sin_angle_add_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) (h0 : x ≠ 0 ∨ y ≠ 0) :
    Real.sin (angle x (x + y)) = ‖y‖ / ‖x + y‖

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x y : V}
(h : ⟪x, y⟫_ℝ = 0)
(h0 : x ≠ 0 ∨ y ≠ 0)

Real.sin (InnerProductGeometry.angle x (x + y)) = ‖y‖ / ‖x + y‖


/-- Note this is more general than `IsSelfAdjoint.conjugate'` as `B` can be rectangular. -/
theorem isHermitian_conjTranspose_mul_mul [Fintype m] {A : Matrix m m α} (B : Matrix m n α)
    (hA : A.IsHermitian) : (Bᴴ * A * B).IsHermitian

{α : Type u_1}
{m : Type u_3}
{n : Type u_4}
[NonUnitalSemiring α]
[StarRing α]
[Fintype m]
{A : Matrix m m α}
(B : Matrix m n α)
(hA : A.IsHermitian)


@[to_additive]
theorem max_mul_mul_right (a b c : α) : max (a * c) (b * c) = max a b * c

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


@[to_additive addCHaar_mono]
theorem chaar_mono {K₀ : PositiveCompacts G} {K₁ K₂ : Compacts G} (h : (K₁ : Set G) ⊆ K₂) :
    chaar K₀ K₁ ≤ chaar K₀ K₂

{K₀ : TopologicalSpace.PositiveCompacts G}

MeasureTheory.Measure.haar.chaar K₀ K₁ ≤ MeasureTheory.Measure.haar.chaar K₀ K₂


/-- The measurable space structures generated by independent pi-systems are independent. -/
theorem iIndepSets.iIndep [IsProbabilityMeasure μ]
    (h_le : ∀ i, m i ≤ _mΩ) (π : ι → Set (Set Ω)) (h_pi : ∀ n, IsPiSystem (π n))
    (h_generate : ∀ i, m i = generateFrom (π i)) (h_ind : iIndepSets π μ) :
    iIndep m μ

(h_generate : ∀ (i : ι), m i = MeasurableSpace.generateFrom (π i))

(h_ind : ProbabilityTheory.iIndepSets π μ)


protected theorem rel_comp {X Y Z : RelCat} (f : X ⟶ Y) (g : Y ⟶ Z) : f ≫ g = Rel.comp f g

{X Y Z : CategoryTheory.RelCat}
(f : X ⟶ Y)
(g : Y ⟶ Z)

CategoryTheory.CategoryStruct.comp f g = Rel.comp f g


theorem support_comp_inv_smul [Zero γ] (c : α) (f : β → γ) :
    (support fun x ↦ f (c⁻¹ • x)) = c • support f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Group α]
[MulAction α β]
[Zero γ]
(c : α)
(f : β → γ)

(Function.support fun x => f (c⁻¹ • x)) = c • Function.support f


@[simp]
protected theorem liftOn₂_eq {φ} (p q : Set ℕ) (f : Set ℕ → Set ℕ → φ)
    (h : ∀ p₁ p₂ q₁ q₂, ManyOneEquiv p₁ p₂ → ManyOneEquiv q₁ q₂ → f p₁ q₁ = f p₂ q₂) :
    (of p).liftOn₂ (of q) f h = f p q

(h : ∀ (p₁ p₂ q₁ q₂ : ℕ → Prop), ManyOneEquiv p₁ p₂ → ManyOneEquiv q₁ q₂ → f p₁ q₁ = f p₂ q₂)

(ManyOneDegree.of p).liftOn₂ (ManyOneDegree.of q) f h = f p q


theorem lt_neg_of_pos_of_infinitesimal {x : ℝ*} : Infinitesimal x → ∀ r : ℝ, 0 < r → -↑r < x

x.Infinitesimal → ∀ (r : ℝ), 0 < r → -↑r < x


@[simp]
lemma DifferentiableAt.add_iff_right (hg : DifferentiableAt 𝕜 f x) :
    DifferentiableAt 𝕜 (fun y => f y + g y) x ↔ DifferentiableAt 𝕜 g x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{x : E}
(hg : DifferentiableAt 𝕜 f x)


protected theorem isPartialOrder : ∀ (_ : r ↪r s) [IsPartialOrder β s], IsPartialOrder α r

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

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


theorem nodalWeight_eq_eval_nodal_erase_inv :
    nodalWeight s v i = (eval (v i) (nodal (s.erase i) v))⁻¹

{F : Type u_1}
[Field F]
{ι : Type u_2}
[DecidableEq ι]
{s : Finset ι}
{v : ι → F}
{i : ι}

Lagrange.nodalWeight s v i = (Polynomial.eval (v i) (Lagrange.nodal (s.erase i) v))⁻¹


@[simp]
theorem invOf_eq_group_inv [Group α] (a : α) [Invertible a] : ⅟ a = a⁻¹

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


/-- `LocallyDiscrete C` is equivalent to the original type `C`. -/
@[simps]
def locallyDiscreteEquiv : LocallyDiscrete C ≃ C

(CategoryTheory.LocallyDiscrete.locallyDiscreteEquiv.symm as).as = as


/--
Monoid objects in `C` are "just" lax monoidal functors from the trivial monoidal category to `C`.
-/
@[simps]
def equivLaxMonoidalFunctorPUnit : LaxMonoidalFunctor (Discrete PUnit.{u + 1}) C ≌ Mon_ C

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

(Mon_.equivLaxMonoidalFunctorPUnit C).counitIso = Mon_.EquivLaxMonoidalFunctorPUnit.counitIso C


@[to_additive (attr := simp)]
theorem smul_apply [SMul K β] (k : K) (f : α →ₛ β) (a : α) : (k • f) a = k • f a

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{K : Type u_5}
[VAdd K β]
(k : K)
(f : MeasureTheory.SimpleFunc α β)
(a : α)


/-- The line derivative of a Lipschitz function is almost everywhere linear with respect to fixed
coefficients. -/
theorem ae_lineDeriv_sum_eq
    (hf : LipschitzWith C f) {ι : Type*} (s : Finset ι) (a : ι → ℝ) (v : ι → E) :
    ∀ᵐ x ∂μ, lineDeriv ℝ f x (∑ i ∈ s, a i • v i) = ∑ i ∈ s, a i • lineDeriv ℝ f x (v i)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
[MeasurableSpace E]
[BorelSpace E]
{C : ℝ≥0}
{f : E → ℝ}
{μ : MeasureTheory.Measure E}
[μ.IsAddHaarMeasure]
(hf : LipschitzWith C f)
{ι : Type u_3}
(s : Finset ι)
(a : ι → ℝ)
(v : ι → E)

∀ᵐ (x : E) ∂μ, lineDeriv ℝ f x (∑ i ∈ s, a i • v i) = ∑ i ∈ s, a i • lineDeriv ℝ f x (v i)


lemma toMonoidHom_injective : Injective (toMonoidHom : (α →*₀ β) → α →* β)

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


/-- If `f` is torus integrable then `-f` is torus integrable. -/
protected nonrec theorem neg (hf : TorusIntegrable f c R) : TorusIntegrable (-f) c R

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


/-- Transport a monoidal structure along an equivalence of (plain) categories.
-/
@[simps]
def transportStruct (e : C ≌ D) : MonoidalCategoryStruct.{v₂} D

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(e : C ≌ D)
(X : D)

∀ (x x_1 : D) (f : x ⟶ x_1), X ◁ f = e.functor.map (e.inverse.obj X ◁ e.inverse.map f)


@[simp]
theorem mul_imJ : (a * b).imJ = a.re * b.imJ - a.imI * b.imK + a.imJ * b.re + a.imK * b.imI

{R : Type u_3}
[CommRing R]
(a b : ℍ[R])


/-- The unique isomorphism `X ≅ Y` which induces an isomorphism `F.obj X ≅ F.obj Y`
when `hF : F.FullyFaithful`. -/
@[simps]
def preimageIso {X Y : C} (e : F.obj X ≅ F.obj Y) : X ≅ Y

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : CategoryTheory.Functor C D}
(hF : F.FullyFaithful)
{X Y : C}
(e : F.obj X ≅ F.obj Y)

(hF.preimageIso e).hom = hF.preimage e.hom


theorem y_neg (D : ℝ) (x : E) : y D (-x) = y D x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
[MeasurableSpace E]
[BorelSpace E]
(D : ℝ)
(x : E)

ExistsContDiffBumpBase.y D (-x) = ExistsContDiffBumpBase.y D x


lemma comp_inv {φ : M →* N} {ψ : N →* M} (h : Function.RightInverse φ ψ)
    {χ : M →* M} [IsId χ] :
    CompTriple φ ψ χ

{M : Type u_2}
{N : Type u_3}
[Monoid M]
[Monoid N]
{φ : M →* N}
{ψ : N →* M}
(h : Function.RightInverse ⇑φ ⇑ψ)
{χ : M →* M}
[MonoidHom.CompTriple.IsId χ]


@[reassoc]
theorem tensor_μ_natural {X₁ X₂ Y₁ Y₂ U₁ U₂ V₁ V₂ : C} (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (g₁ : U₁ ⟶ V₁)
    (g₂ : U₂ ⟶ V₂) :
    ((f₁ ⊗ f₂) ⊗ g₁ ⊗ g₂) ≫ tensor_μ C (Y₁, Y₂) (V₁, V₂) =
      tensor_μ C (X₁, X₂) (U₁, U₂) ≫ ((f₁ ⊗ g₁) ⊗ f₂ ⊗ g₂)

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
{X₁ X₂ Y₁ Y₂ U₁ U₂ V₁ V₂ : C}
(f₁ : X₁ ⟶ Y₁)
(f₂ : X₂ ⟶ Y₂)
(g₁ : U₁ ⟶ V₁)
(g₂ : U₂ ⟶ V₂)

((f₁ ⊗ f₂) ⊗ g₁ ⊗ g₂) ≫ CategoryTheory.tensor_μ C (Y₁, Y₂) (V₁, V₂) =
  CategoryTheory.tensor_μ C (X₁, X₂) (U₁, U₂) ≫ ((f₁ ⊗ g₁) ⊗ f₂ ⊗ g₂)


/-- `Part.seq` as a continuous function. -/
@[simps! apply] -- Porting note: removed `(config := { rhsMd := reducible })`
noncomputable def seq {β γ : Type v} (f : α →𝒄 Part (β → γ)) (g : α →𝒄 Part β) : α →𝒄 Part γ

{α : Type u}
[OmegaCompletePartialOrder α]
{β γ : Type v}
(f : α →𝒄 Part (β → γ))
(g : α →𝒄 Part β)
(x : α)

(f.seq g) x = Seq.seq (f x) fun x_1 => g x


theorem principal_le_iff {s : Set α} {f : Filter α} : 𝓟 s ≤ f ↔ ∀ V ∈ f, s ⊆ V


@[to_additive]
theorem image_eq_one_of_nmem_mulTSupport {f : X → α} {x : X} (hx : x ∉ mulTSupport f) : f x = 1

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


/-- An antitone function `f` sending `bot` to `top` and continuous at the supremum of a set sends
this supremum to the infimum of the image of this set. -/
theorem Antitone.map_sSup_of_continuousAt {f : α → β} {s : Set α} (Cf : ContinuousAt f (sSup s))
    (Af : Antitone f) (fbot : f ⊥ = ⊤) : f (sSup s) = sInf (f '' s)

{α : Type u_1}
{β : Type u_2}
[CompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[CompleteLinearOrder β]
[TopologicalSpace β]
[OrderClosedTopology β]
{f : α → β}
{s : Set α}
(Cf : ContinuousAt f (sSup s))
(Af : Antitone f)
(fbot : f ⊥ = ⊤)


@[simp, norm_cast]
theorem coe_coe : ⇑(e : M →ₛₗ[σ] M₂) = e

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


@[simp]
theorem eval₂_one : (1 : R[X]).eval₂ f x = 1

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


theorem mono_right (h : QuasiMeasurePreserving f μa μb) (ha : μb ≪ μb') :
    QuasiMeasurePreserving f μa μb'

(h : MeasureTheory.Measure.QuasiMeasurePreserving f μa μb)

MeasureTheory.Measure.QuasiMeasurePreserving f μa μb'


theorem eval_image_pi (hs : i ∈ s) (ht : (s.pi t).Nonempty) : eval i '' s.pi t = t i

{ι : Type u_1}
{α : ι → Type u_2}
{s : Set ι}
{t : (i : ι) → Set (α i)}
{i : ι}
(hs : i ∈ s)
(ht : (s.pi t).Nonempty)


/-- The cross product of two vectors is perpendicular to the second vector. -/
@[simp 1100] -- Porting note: increase priority so that the LHS doesn't simplify
theorem dot_cross_self (v w : Fin 3 → R) : w ⬝ᵥ v ×₃ w = 0

{R : Type u_1}
[CommRing R]
(v w : Fin 3 → R)


/-- An injective object admits a trivial injective resolution: itself in degree 0. -/
@[simps]
def self [Injective Z] : InjectiveResolution Z

(CategoryTheory.InjectiveResolution.self Z).ι = CategoryTheory.CategoryStruct.id ((CochainComplex.single₀ C).obj Z)


@[simp]
theorem norm_normComp : ‖f.normComp‖ = ‖f‖

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


theorem periodicOrbit_apply_eq (hx : x ∈ periodicPts f) :
    periodicOrbit f (f x) = periodicOrbit f x

{α : Type u_1}
{f : α → α}
{x : α}
(hx : x ∈ Function.periodicPts f)

Function.periodicOrbit f (f x) = Function.periodicOrbit f x


@[simp]
theorem toIntLinearEquiv_toAddEquiv : ↑e.toIntLinearEquiv = e

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


lemma card_diffs_le : (s \\ t).card ≤ s.card * t.card

{α : Type u_2}
[DecidableEq α]
[GeneralizedBooleanAlgebra α]
(s t : Finset α)


theorem right_le_opow {a : Ordinal} (b : Ordinal) (a1 : 1 < a) : b ≤ a ^ b


@[simp]
theorem zeroLocus_singleton_zero : zeroLocus ({0} : Set R) = Set.univ


/-- A monotone function between (conditionally) complete linear ordered spaces sends a
`Filter.limsInf` to the `Filter.liminf` of the image if the function is continuous at the `limsInf`
(and the filter is bounded from below and frequently bounded from above). -/
theorem Monotone.map_limsInf_of_continuousAt {F : Filter R} [NeBot F] {f : R → S}
    (f_incr : Monotone f) (f_cont : ContinuousAt f F.limsInf)
    (cobdd : F.IsCobounded (· ≥ ·) := by isBoundedDefault)
    (bdd_below : F.IsBounded (· ≥ ·) := by isBoundedDefault) : f F.limsInf = F.liminf f

(cobdd : Filter.IsCobounded (fun x x_1 => x ≥ x_1) F := by isBoundedDefault)

(bdd_below : Filter.IsBounded (fun x x_1 => x ≥ x_1) F := by isBoundedDefault)


theorem integral_add_measure {ν} (f : α →ₛ E) (hf : Integrable f (μ + ν)) :
    f.integral (μ + ν) = f.integral μ + f.integral ν

(hf : MeasureTheory.Integrable (↑f) (μ + ν))

MeasureTheory.SimpleFunc.integral (μ + ν) f =
  MeasureTheory.SimpleFunc.integral μ f + MeasureTheory.SimpleFunc.integral ν f


theorem le_comap_map (f : P₁ →ᵃ[k] P₂) (s : AffineSubspace k P₁) : s ≤ (s.map f).comap f

{k : Type u_1}
{V₁ : Type u_2}
{P₁ : Type u_3}
{V₂ : Type u_4}
{P₂ : Type u_5}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
(f : P₁ →ᵃ[k] P₂)
(s : AffineSubspace k P₁)

s ≤ AffineSubspace.comap f (AffineSubspace.map f s)


theorem isCoseparator_pi {β : Type w} (f : β → C) [HasProduct f] :
    IsCoseparator (∏ᶜ f) ↔ IsCoseparating (Set.range f)

CategoryTheory.IsCoseparator (∏ᶜ f) ↔ CategoryTheory.IsCoseparating (Set.range f)


theorem exists' {p : α → β → Prop} : (∃ x : PProd α β, p x.1 x.2) ↔ ∃ a b, p a b

{α : Sort u_1}
{β : Sort u_2}
{p : α → β → Prop}


theorem coe_mul_inv_eq_one {n : ℕ} (x : ℕ) (h : Nat.Coprime x n) :
    ((x : ZMod n) * (x : ZMod n)⁻¹) = 1


theorem coe_m_add_one_pos : 0 < (m : ℝ) + 1

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{P : Finpartition Finset.univ}


theorem le_weightedTotalDegree (w : σ → M) {φ : MvPolynomial σ R} {d : σ →₀ ℕ}
    (hd : d ∈ φ.support) : weight w d ≤ φ.weightedTotalDegree w

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
{σ : Type u_3}
[AddCommMonoid M]
[SemilatticeSup M]
[OrderBot M]
(w : σ → M)
{φ : MvPolynomial σ R}
{d : σ →₀ ℕ}
(hd : d ∈ φ.support)

(Finsupp.weight w) d ≤ MvPolynomial.weightedTotalDegree w φ


theorem homEquiv_naturality_right_symm (f : X ⟶ G.obj Y) (g : Y ⟶ Y') :
    (adj.homEquiv X Y').symm (f ≫ G.map g) = (adj.homEquiv X Y).symm f ≫ g

(adj : CategoryTheory.Adjunction.CoreHomEquiv F G)

(adj.homEquiv X Y').symm (CategoryTheory.CategoryStruct.comp f (G.map g)) =
  CategoryTheory.CategoryStruct.comp ((adj.homEquiv X Y).symm f) g


@[simp] lemma trunc_zero' {f : R⟦X⟧} : trunc 0 f = 0

{R : Type u_1}
[Semiring R]
{f : PowerSeries R}


/-- The Hausdorff edistance between a set and its closure vanishes. -/
@[simp]
theorem hausdorffEdist_self_closure : hausdorffEdist s (closure s) = 0

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

EMetric.hausdorffEdist s (closure s) = 0


@[to_additive (attr := simp)]
theorem comp_id : p.comp (MonoidHom.id _) = p

{E : Type u_4}
[Group E]
(p : GroupSeminorm E)


/-- A multiplicative morphism property `W` has left calculus of fractions if
any right fraction can be turned into a left fraction and that two morphisms
that can be equalized by precomposition with a morphism in `W` can also
be equalized by postcomposition with a morphism in `W`. -/
class HasLeftCalculusOfFractions extends W.IsMultiplicative : Prop where
  exists_leftFraction ⦃X Y : C⦄ (φ : W.RightFraction X Y) :
    ∃ (ψ : W.LeftFraction X Y), φ.f ≫ ψ.s = φ.s ≫ ψ.f
  ext : ∀ ⦃X' X Y : C⦄ (f₁ f₂ : X ⟶ Y) (s : X' ⟶ X) (_ : W s)
    (_ : s ≫ f₁ = s ≫ f₂), ∃ (Y' : C) (t : Y ⟶ Y') (_ : W t), f₁ ≫ t = f₂ ≫ t

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
[self : W.HasLeftCalculusOfFractions]
⦃X Y : C⦄
(φ : W.RightFraction X Y)

∃ ψ, CategoryTheory.CategoryStruct.comp φ.f ψ.s = CategoryTheory.CategoryStruct.comp φ.s ψ.f


@[simp]
lemma comap_zero (hg : Measurable g) : Kernel.comap (0 : Kernel α β) g hg = 0

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_4}
{mγ : MeasurableSpace γ}
{g : γ → α}
(hg : Measurable g)

ProbabilityTheory.Kernel.comap 0 g hg = 0


lemma min_max_distrib_left (a b c : α) : min a (max b c) = max (min a b) (min a c)

{α : Type u}
[LinearOrder α]
(a b c : α)


/-- Product of a multiset of elements in a submonoid of a `CommMonoid` is in the submonoid. -/
@[to_additive
      "Sum of a multiset of elements in an `AddSubmonoid` of an `AddCommMonoid` is
      in the `AddSubmonoid`."]
theorem multiset_prod_mem {M} [CommMonoid M] (S : Submonoid M) (m : Multiset M)
    (hm : ∀ a ∈ m, a ∈ S) : m.prod ∈ S

{M : Type u_4}
[AddCommMonoid M]
(S : AddSubmonoid M)
(m : Multiset M)
(hm : ∀ a ∈ m, a ∈ S)


/-- This can be used to prove
```lean
example (A : Matrix (Fin 2) (Fin 2) α) :
  A = !![A 0 0, A 0 1;
         A 1 0, A 1 1] :=
(etaExpand_eq _).symm
```
-/
theorem etaExpand_eq {m n} (A : Matrix (Fin m) (Fin n) α) : etaExpand A = A

{α : Type u_1}
{m n : ℕ}
(A : Matrix (Fin m) (Fin n) α)


theorem rpow_le_one {x : ℝ≥0∞} {z : ℝ} (hx : x ≤ 1) (hz : 0 ≤ z) : x ^ z ≤ 1


theorem mem_pure_self (a : α) : a ∈ pure a


/-- Given `pb : PowerBasis R S`, then the norm of `pb.gen` is
`((minpoly R pb.gen).aroots F).prod`. -/
theorem PowerBasis.norm_gen_eq_prod_roots [Algebra R F] (pb : PowerBasis R S)
    (hf : (minpoly R pb.gen).Splits (algebraMap R F)) :
    algebraMap R F (norm R pb.gen) = ((minpoly R pb.gen).aroots F).prod

(hf : Polynomial.Splits (algebraMap R F) (minpoly R pb.gen))

(algebraMap R F) ((Algebra.norm R) pb.gen) = ((minpoly R pb.gen).aroots F).prod


@[simp]
lemma fiberBinaryProductEquiv_symm_fst_apply {X Y : C} (x : F.obj X) (y : F.obj Y) :
    F.map prod.fst ((fiberBinaryProductEquiv F X Y).symm (x, y)) = x

(F : CategoryTheory.Functor C FintypeCat)

F.map CategoryTheory.Limits.prod.fst ((CategoryTheory.PreGaloisCategory.fiberBinaryProductEquiv F X Y).symm (x, y)) = x


@[simp, elementwise]
theorem biprodIsoProd_inv_comp_fst (M N : ModuleCat.{v} R) :
    (biprodIsoProd M N).inv ≫ biprod.fst = LinearMap.fst R M N

{R : Type u}
[Ring R]
(M N : ModuleCat R)

(M.biprodIsoProd N).inv ≫ CategoryTheory.Limits.biprod.fst = LinearMap.fst R ↑M ↑N


/-- Given any pair of coprime elements of `R`, there exists a matrix in `SL(2, R)` having those
entries as its top or bottom row. -/
lemma exists_SL2_row {a b : R} (hab : IsCoprime a b) (i : Fin 2) :
    ∃ g : SL(2, R), g i 0 = a ∧ g i 1 = b

{R : Type u_1}
[CommRing R]
{a b : R}
(hab : IsCoprime a b)
(i : Fin 2)


theorem mem_upperBounds_image (Ha : a ∈ upperBounds s) : f a ∈ upperBounds (f '' s)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
(Hf : Monotone f)
{a : α}
{s : Set α}
(Ha : a ∈ upperBounds s)


/-- On a topological group, `𝓝 : G → Filter G` can be promoted to a `MulHom`. -/
@[to_additive (attr := simps)
  "On an additive topological group, `𝓝 : G → Filter G` can be promoted to an `AddHom`."]
def nhdsMulHom : G →ₙ* Filter G

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
(x : G)


theorem X_pow_sub_C_irreducible_of_odd
    {n : ℕ} (hn : Odd n) {a : K} (ha : ∀ p : ℕ, p.Prime → p ∣ n → ∀ b : K, b ^ p ≠ a) :
    Irreducible (X ^ n - C a)

(ha : ∀ (p : ℕ), Nat.Prime p → p ∣ n → ∀ (b : K), b ^ p ≠ a)

Irreducible (Polynomial.X ^ n - Polynomial.C a)


theorem range_toPullbackDiag (f : X → Y) : range (toPullbackDiag f) = pullbackDiagonal f

{X : Type u_1}
{Y : Sort u_2}
(f : X → Y)

Set.range (toPullbackDiag f) = Function.pullbackDiagonal f


lemma IsBasis.le_iff {α} {t₁ t₂ : TopologicalSpace α}
    {Us : Set (Opens α)} (hUs : @IsBasis α t₂ Us) :
    t₁ ≤ t₂ ↔ ∀ U ∈ Us, IsOpen[t₁] U

(hUs : TopologicalSpace.Opens.IsBasis Us)


@[simp]
theorem trace_conjTranspose [StarAddMonoid R] (A : Matrix n n R) : trace Aᴴ = star (trace A)

{n : Type u_3}
{R : Type u_6}
[Fintype n]
[AddCommMonoid R]
[StarAddMonoid R]
(A : Matrix n n R)


theorem rightAngleRotation_neg_orientation (x : E) :
    (-o).rightAngleRotation x = -o.rightAngleRotation x

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


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

{α : Type u_2}
[OrderedCommGroup α]
{s t : Interval α}

s * t = 1 ↔ ∃ a b, s = Interval.pure a ∧ t = Interval.pure b ∧ a * b = 1


theorem Frequently.mp {p q : α → Prop} {f : Filter α} (h : ∃ᶠ x in f, p x)
    (hpq : ∀ᶠ x in f, p x → q x) : ∃ᶠ x in f, q x

{α : Type u}
{p q : α → Prop}
{f : Filter α}
(h : ∃ᶠ (x : α) in f, p x)
(hpq : ∀ᶠ (x : α) in f, p x → q x)


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

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


theorem Ioo_subset_Ioo_union_Ico : Ioo a c ⊆ Ioo a b ∪ Ico b c

{α : Type u_1}
[LinearOrder α]
{a b c : α}


theorem integral_mono_ae (h : f ≤ᵐ[μ] g) : (∫ u in a..b, f u ∂μ) ≤ ∫ u in a..b, g u ∂μ

{f g : ℝ → ℝ}
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
(hab : a ≤ b)
(hf : IntervalIntegrable f μ a b)
(hg : IntervalIntegrable g μ a b)
(h : f ≤ᵐ[μ] g)

∫ (u : ℝ) in a..b, f u ∂μ ≤ ∫ (u : ℝ) in a..b, g u ∂μ


theorem divMonomial_add_modMonomial_single (x : MvPolynomial σ R) (i : σ) :
    X i * (x /ᵐᵒⁿᵒᵐⁱᵃˡ Finsupp.single i 1) + x %ᵐᵒⁿᵒᵐⁱᵃˡ Finsupp.single i 1 = x

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
(x : MvPolynomial σ R)
(i : σ)

MvPolynomial.X i * x.divMonomial (Finsupp.single i 1) + x.modMonomial (Finsupp.single i 1) = x


theorem inl_fst_add_inr_snd_eq [AddZeroClass R] [AddZeroClass M] (x : tsze R M) :
    inl x.fst + inr x.snd = x

{R : Type u}
{M : Type v}
[AddZeroClass R]
[AddZeroClass M]
(x : tsze R M)

TrivSqZeroExt.inl x.fst + TrivSqZeroExt.inr x.snd = x


theorem HasFDerivAtFilter.sum (h : ∀ i ∈ u, HasFDerivAtFilter (A i) (A' i) x L) :
    HasFDerivAtFilter (fun y => ∑ i ∈ u, A i y) (∑ i ∈ u, A' i) x L


theorem span_mul_span' (S T : Set R) : span S * span T = span (S * T)

{R : Type u}
[CommSemiring R]
(S T : Set R)

Ideal.span S * Ideal.span T = Ideal.span (S * T)


/-- In a commutative monoid, an element `a` divides an element `b` iff `a` divides all left
    associates of `b`. -/
theorem dvd_mul_left : a ∣ u * b ↔ a ∣ b

{α : Type u_1}
[CommMonoid α]
{a b : α}
{u : αˣ}


@[deprecated getElem?_set (since := "2024-06-12")]
theorem get?_set (a : α) {m n} (l : List α) :
    (set l m a).get? n = if m = n then (fun _ => a) <$> l.get? n else l.get? n

{α : Type u_1}
(a : α)
{m n : Nat}
(l : List α)

(l.set m a).get? n = if m = n then (fun x => a) <$> l.get? n else l.get? n


theorem det_eq_sign_charpoly_coeff (M : Matrix n n R) :
    M.det = (-1) ^ Fintype.card n * M.charpoly.coeff 0

{R : Type u}
[CommRing R]
{n : Type v}
[DecidableEq n]
[Fintype n]
(M : Matrix n n R)


protected theorem not_le {a b : Int} : ¬a ≤ b ↔ b < a


/-- `P⁺` is always separated. -/
theorem sep {X : C} (P : Cᵒᵖ ⥤ D) (S : J.Cover X) (x y : (J.plusObj P).obj (op X))
    (h : ∀ I : S.Arrow, (J.plusObj P).map I.f.op x = (J.plusObj P).map I.f.op y) : x = y

{J : CategoryTheory.GrothendieckTopology C}

[CategoryTheory.Category.{max v u, w} D]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ D]

[∀ (P : CategoryTheory.Functor Cᵒᵖ D) (X : C) (S : J.Cover X), CategoryTheory.Limits.HasMultiequalizer (S.index P)]

[(X : C) → CategoryTheory.Limits.PreservesColimitsOfShape (J.Cover X)ᵒᵖ (CategoryTheory.forget D)]

(x y : (CategoryTheory.forget D).obj ((J.plusObj P).obj (Opposite.op X)))

(h : ∀ (I : S.Arrow), ((J.plusObj P).map I.f.op) x = ((J.plusObj P).map I.f.op) y)


/-- If `a` commutes with both `b` and `c`, then it commutes with their product. -/
@[to_additive (attr := simp)
"If `a` commutes with both `b` and `c`, then it commutes with their sum."]
theorem mul_right (hab : Commute a b) (hac : Commute a c) : Commute a (b * c)

{S : Type u_3}
[AddSemigroup S]
{a b c : S}
(hab : AddCommute a b)
(hac : AddCommute a c)


lemma dblZ_ne_zero_of_Y_ne [NoZeroDivisors R] {P Q : Fin 3 → R} (hP : W'.Equation P)
    (hQ : W'.Equation Q) (hPz : P z ≠ 0) (hx : P x * Q z ^ 2 = Q x * P z ^ 2)
    (hy : P y * Q z ^ 3 ≠ Q y * P z ^ 3) : W'.dblZ P ≠ 0

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
[NoZeroDivisors R]
{P Q : Fin 3 → R}
(hP : W'.Equation P)
(hQ : W'.Equation Q)
(hPz : P z ≠ 0)
(hx : P x * Q z ^ 2 = Q x * P z ^ 2)
(hy : P y * Q z ^ 3 ≠ Q y * P z ^ 3)


@[fun_prop]
theorem continuous_coe : Continuous ((↑) : ℝ≥0 → ℝ≥0∞)