theorem completeSpace_lp_of_cauchy_complete_ℒp [hp : Fact (1 ≤ p)]
    (H :
      ∀ (f : ℕ → α → E) (hf : ∀ n, Memℒp (f n) p μ) (B : ℕ → ℝ≥0∞) (hB : ∑' i, B i < ∞)
        (h_cau : ∀ N n m : ℕ, N ≤ n → N ≤ m → eLpNorm (f n - f m) p μ < B N),
        ∃ (f_lim : α → E), Memℒp f_lim p μ ∧
          atTop.Tendsto (fun n => eLpNorm (f n - f_lim) p μ) (𝓝 0)) :
    CompleteSpace (Lp E p μ)

(H :
  ∀ (f : ℕ → α → E),
    (∀ (n : ℕ), MeasureTheory.Memℒp (f n) p μ) →
      ∀ (B : ℕ → ℝ≥0∞),
        ∑' (i : ℕ), B i < ⊤ →
          (∀ (N n m : ℕ), N ≤ n → N ≤ m → MeasureTheory.eLpNorm (f n - f m) p μ < B N) →
            ∃ f_lim,
              MeasureTheory.Memℒp f_lim p μ ∧
                Filter.Tendsto (fun n => MeasureTheory.eLpNorm (f n - f_lim) p μ) Filter.atTop (𝓝 0))


/-- If `x` is a fixed point of `f ∘ g` and `g`, then it is a fixed point of `f`. -/
theorem left_of_comp (hfg : IsFixedPt (f ∘ g) x) (hg : IsFixedPt g x) : IsFixedPt f x

{α : Type u}
{f g : α → α}
{x : α}
(hfg : Function.IsFixedPt (f ∘ g) x)
(hg : Function.IsFixedPt g x)


/-- The composition of two proper maps is proper. -/
lemma IsProperMap.comp (hf : IsProperMap f) (hg : IsProperMap g) :
    IsProperMap (g ∘ f)

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : X → Y}
{g : Y → Z}
(hf : IsProperMap f)
(hg : IsProperMap g)


/-- Alternative constructor for `IndObjectPresentation` taking a cocone instead of its defining
    natural transformation. -/
@[simps]
def ofCocone {I : Type v} [SmallCategory I] [IsFiltered I] {F : I ⥤ C}
    (c : Cocone (F ⋙ yoneda)) (hc : IsColimit c) : IndObjectPresentation c.pt

(c : CategoryTheory.Limits.Cocone (F.comp CategoryTheory.yoneda))

(hc : CategoryTheory.Limits.IsColimit c)

(CategoryTheory.Limits.IndObjectPresentation.ofCocone c hc).ι = c.ι


@[to_additive]
theorem preimage_smul (a : α) (t : Set β) : (fun x ↦ a • x) ⁻¹' t = a⁻¹ • t

{α : Type u_2}
{β : Type u_3}
[Group α]
[MulAction α β]
(a : α)
(t : Set β)


theorem tendsto_setToFun_approxOn_of_measurable (hT : DominatedFinMeasAdditive μ T C)
    [MeasurableSpace E] [BorelSpace E] {f : α → E} {s : Set E} [SeparableSpace s]
    (hfi : Integrable f μ) (hfm : Measurable f) (hs : ∀ᵐ x ∂μ, f x ∈ closure s) {y₀ : E}
    (h₀ : y₀ ∈ s) (h₀i : Integrable (fun _ => y₀) μ) :
    Tendsto (fun n => setToFun μ T hT (SimpleFunc.approxOn f hfm s y₀ h₀ n)) atTop
      (𝓝 <| setToFun μ T hT f)

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(h₀i : MeasureTheory.Integrable (fun x => y₀) μ)

Filter.Tendsto (fun n => MeasureTheory.setToFun μ T hT ↑(MeasureTheory.SimpleFunc.approxOn f hfm s y₀ h₀ n))
  Filter.atTop (𝓝 (MeasureTheory.setToFun μ T hT f))


theorem intermediate_value_Ioc' {a b : α} (hab : a ≤ b) {f : α → δ}
    (hf : ContinuousOn f (Icc a b)) : Ico (f b) (f a) ⊆ f '' Ioc a b

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{δ : Type u_1}
[LinearOrder δ]
[TopologicalSpace δ]
[OrderClosedTopology δ]
{a b : α}
(hab : a ≤ b)
{f : α → δ}
(hf : ContinuousOn f (Set.Icc a b))


theorem FG.prod {S : Subalgebra R A} {T : Subalgebra R B} (hS : S.FG) (hT : T.FG) :
    (S.prod T).FG

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
{S : Subalgebra R A}
{T : Subalgebra R B}
(hS : S.FG)
(hT : T.FG)


@[simp]
theorem lcm_eq_inf (I J : Ideal A) : lcm I J = I ⊓ J

{A : Type u_2}
[CommRing A]
[IsDedekindDomain A]
(I J : Ideal A)


/-- `Option` as a functor from types to pointed types. This is the free functor. -/
@[simps]
def typeToPointed : Type u ⥤ Pointed.{u}

∀ {X Y : Type u} (f : X ⟶ Y) (a : Option X), (typeToPointed.map f).toFun a = Option.map f a


@[to_additive nsmul_nonneg]
theorem one_le_pow_of_one_le' {a : M} (H : 1 ≤ a) : ∀ n : ℕ, 1 ≤ a ^ n

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


theorem gcd_eq_of_dvd_sub_left {a b c : α} (h : a ∣ b - c) : gcd b a = gcd c a

{α : Type u_1}
[CommRing α]
[IsDomain α]
[NormalizedGCDMonoid α]
{a b c : α}
(h : a ∣ b - c)


@[to_additive]
theorem smul_union : s • (t₁ ∪ t₂) = s • t₁ ∪ s • t₂

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{s : Set α}
{t₁ t₂ : Set β}


{α : Type u_2}
[Preorder α]
{x y : α}
(h : x = y)


theorem frobenius_mul : frobenius R p (x * y) = frobenius R p x * frobenius R p y

{R : Type u}
[CommSemiring R]
(p : ℕ)
[ExpChar R p]
(x y : R)

(frobenius R p) (x * y) = (frobenius R p) x * (frobenius R p) y


theorem condexpIndSMul_smul' [NormedSpace ℝ F] [SMulCommClass ℝ 𝕜 F] (hs : MeasurableSet s)
    (hμs : μ s ≠ ∞) (c : 𝕜) (x : F) :
    condexpIndSMul hm hs hμs (c • x) = c • condexpIndSMul hm hs hμs x

{α : Type u_1}
{F : Type u_4}
{𝕜 : Type u_7}
[RCLike 𝕜]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
{hm : m ≤ m0}
[NormedSpace ℝ F]
[SMulCommClass ℝ 𝕜 F]
(hs : MeasurableSet s)
(hμs : μ s ≠ ⊤)
(c : 𝕜)
(x : F)

MeasureTheory.condexpIndSMul hm hs hμs (c • x) = c • MeasureTheory.condexpIndSMul hm hs hμs x


theorem measurable_preCDF {ρ : Measure (α × ℝ)} {r : ℚ} : Measurable (preCDF ρ r)

{α : Type u_1}
{mα : MeasurableSpace α}
{ρ : MeasureTheory.Measure (α × ℝ)}
{r : ℚ}

Measurable (ProbabilityTheory.preCDF ρ r)


/-- Localizing an artinian ring can only reduce the amount of elements. -/
theorem localization_surjective : Function.Surjective (algebraMap R L)

{R : Type u_1}
[CommRing R]
[IsArtinianRing R]
(S : Submonoid R)
(L : Type u_2)
[CommRing L]
[Algebra R L]
[IsLocalization S L]


@[simp]
theorem mk_mul_moveRight_inr {xl xr yl yr} {xL xR yL yR} {i j} :
    (mk xl xr xL xR * mk yl yr yL yR).moveRight (Sum.inr (i, j)) =
      xR i * mk yl yr yL yR + mk xl xr xL xR * yL j - xR i * yL j

{xl xr yl yr : Type u_1}
{xL : xl → SetTheory.PGame}
{xR : xr → SetTheory.PGame}
{yL : yl → SetTheory.PGame}
{yR : yr → SetTheory.PGame}
{i : xr}
{j : yl}

(SetTheory.PGame.mk xl xr xL xR * SetTheory.PGame.mk yl yr yL yR).moveRight (Sum.inr (i, j)) =
  xR i * SetTheory.PGame.mk yl yr yL yR + SetTheory.PGame.mk xl xr xL xR * yL j - xR i * yL j


@[to_additive]
theorem one_iff_ker_inv' {f : G → H} (hf : IsGroupHom f) (a b : G) : f a = f b ↔ f (a⁻¹ * b) = 1

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


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

{α : Type u_2}
{β : Type u_3}
[Top α]
[SemilatticeInf β]
[OrderTop β]
(f g : TopHom α β)
(a : α)


theorem integral_fintype_iUnion {ι : Type*} [Fintype ι] {s : ι → Set X}
    (hs : ∀ i, MeasurableSet (s i)) (h's : Pairwise (Disjoint on s))
    (hf : ∀ i, IntegrableOn f (s i) μ) : ∫ x in ⋃ i, s i, f x ∂μ = ∑ i, ∫ x in s i, f x ∂μ

(hf : ∀ (i : ι), MeasureTheory.IntegrableOn f (s i) μ)

∫ (x : X) in ⋃ i, s i, f x ∂μ = ∑ i : ι, ∫ (x : X) in s i, f x ∂μ


@[simp]
protected theorem mk_get (x : Const n A α) : Const.mk (Const.get x) = x

{n : ℕ}
{A : Type u}
{α : TypeVec.{u} n}
(x : MvQPF.Const n A α)


/-- The equivalence between the complex numbers and `ℝ × ℝ`. -/
@[simps apply]
def equivRealProd : ℂ ≃ ℝ × ℝ


@[simp]
theorem coe_mul (e₁ e₂ : MulAut M) : ⇑(e₁ * e₂) = e₁ ∘ e₂

(M : Type u_2)
[Mul M]
(e₁ e₂ : MulAut M)

⇑(e₁ * e₂) = ⇑e₁ ∘ ⇑e₂


lemma isNat_neg_of_isNegNat {a : ℤ} {b : ℕ} (h : IsInt a (.negOfNat b)) : IsNat (-a) b

(h : Mathlib.Meta.NormNum.IsInt a (Int.negOfNat b))


@[to_additive (attr := simp)]
protected theorem div_eq_one' {r : R} (hr : r ∈ S) : r /ₒ ⟨r, hr⟩ = 1

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{r : R}
(hr : r ∈ S)


theorem nextFixed_le {x : α} (hx : x ≤ f x) {y : fixedPoints f} (h : x ≤ y) :
    f.nextFixed x hx ≤ y

{α : Type u}
[CompleteLattice α]
(f : α →o α)
{x : α}
(hx : x ≤ f x)
{y : ↑(Function.fixedPoints ⇑f)}
(h : x ≤ ↑y)


theorem filterTR_loop_eq (p : α → Bool) (as bs : List α) :
    filterTR.loop p as bs = bs.reverse ++ filter p as

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

List.filterTR.loop p as bs = bs.reverse ++ List.filter p as


nonrec theorem sum_casesOn {f : α → β ⊕ γ} {g : α → β →. σ} {h : α → γ →. σ} (hf : Computable f)
    (hg : Partrec₂ g) (hh : Partrec₂ h) : @Partrec _ σ _ _ fun a => Sum.casesOn (f a) (g a) (h a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{σ : Type u_4}
[Primcodable α]
[Primcodable β]
[Primcodable γ]
[Primcodable σ]
{f : α → β ⊕ γ}
{g : α → β →. σ}
{h : α → γ →. σ}
(hf : Computable f)
(hg : Partrec₂ g)
(hh : Partrec₂ h)

Partrec fun a => Sum.casesOn (f a) (g a) (h a)


/-- Injective affine maps preserve affine independence. -/
theorem AffineMap.affineIndependent_iff {p : ι → P} (f : P →ᵃ[k] P₂) (hf : Function.Injective f) :
    AffineIndependent k (f ∘ p) ↔ AffineIndependent k p

{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}
{V₂ : Type u_5}
{P₂ : Type u_6}
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
{p : ι → P}
(f : P →ᵃ[k] P₂)
(hf : Function.Injective ⇑f)

AffineIndependent k (⇑f ∘ p) ↔ AffineIndependent k p


@[to_additive add_lt_of_neg_right]
theorem mul_lt_of_lt_one_right' [CovariantClass α α (· * ·) (· < ·)] (a : α) {b : α} (h : b < 1) :
    a * b < a

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


theorem gradedMul_assoc (x y z : DirectSum _ 𝒜 ⊗[R] DirectSum _ ℬ) :
    gradedMul R 𝒜 ℬ (gradedMul R 𝒜 ℬ x y) z = gradedMul R 𝒜 ℬ x (gradedMul R 𝒜 ℬ y z)

(x y z : DirectSum ι 𝒜 ⊗[R] DirectSum ι ℬ)

((TensorProduct.gradedMul R 𝒜 ℬ) (((TensorProduct.gradedMul R 𝒜 ℬ) x) y)) z =
  ((TensorProduct.gradedMul R 𝒜 ℬ) x) (((TensorProduct.gradedMul R 𝒜 ℬ) y) z)


{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
(P : Algebra.Generators R S)


theorem Ideal.minimalPrimes_eq_comap :
    I.minimalPrimes = Ideal.comap (Ideal.Quotient.mk I) '' minimalPrimes (R ⧸ I)

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


protected theorem ofNat (α) [Denumerable α] : Primrec (ofNat α)


/-- `seminormFromConst' hf1 hc hpm 1 = 1`. -/
theorem seminormFromConst_one : seminormFromConst' hf1 hc hpm 1 = 1

{R : Type u_1}
[CommRing R]
{c : R}
{f : RingSeminorm R}
(hf1 : f 1 ≤ 1)
(hc : f c ≠ 0)
(hpm : IsPowMul ⇑f)


theorem mem_pi' {s : Set (∀ i, α i)} :
    s ∈ pi f ↔ ∃ I : Finset ι, ∃ t : ∀ i, Set (α i), (∀ i, t i ∈ f i) ∧ Set.pi (↑I) t ⊆ s

{ι : Type u_1}
{α : ι → Type u_2}
{f : (i : ι) → Filter (α i)}
{s : Set ((i : ι) → α i)}

s ∈ Filter.pi f ↔ ∃ I t, (∀ (i : ι), t i ∈ f i) ∧ (↑I).pi t ⊆ s


/-- The function `x ^ (a / (b * x + c))` tends to `1` at `+∞`, for any real numbers `a`, `b`, and
`c` such that `b` is nonzero. -/
theorem tendsto_rpow_div_mul_add (a b c : ℝ) (hb : 0 ≠ b) :
    Tendsto (fun x => x ^ (a / (b * x + c))) atTop (𝓝 1)

Filter.Tendsto (fun x => x ^ (a / (b * x + c))) Filter.atTop (𝓝 1)


{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{s : 𝕜 → 𝕜}
{U : Set 𝕜}
(hs : MeromorphicOn s U)


theorem coe_comp {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) : (f ≫ g : X → Z) = g ∘ f

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

⇑(CategoryTheory.CategoryStruct.comp f g) = ⇑g ∘ ⇑f


theorem isCaratheodory_iUnion_nat {s : ℕ → Set α} (h : ∀ i, IsCaratheodory m (s i))
    (hd : Pairwise (Disjoint on s)) : IsCaratheodory m (⋃ i, s i)

{α : Type u}
(m : MeasureTheory.OuterMeasure α)
{s : ℕ → Set α}
(h : ∀ (i : ℕ), m.IsCaratheodory (s i))
(hd : Pairwise (Disjoint on s))


/-- The function x ↦ ∑ a_i b_i^x is injective. This implies the uniqueness of `p`. -/
lemma injective_sumCoeffsExp : Function.Injective (fun (p : ℝ) => ∑ i, a i * (b i) ^ p)

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(R : AkraBazziRecurrence T g a b r)

Function.Injective fun p => ∑ i : α, a i * b i ^ p


theorem degree_erase_lt (hp : p ≠ 0) : degree (p.erase (natDegree p)) < degree p

{R : Type u}
[Semiring R]
{p : R[X]}
(hp : p ≠ 0)

(Polynomial.erase p.natDegree p).degree < p.degree


theorem mul_inv : ∀ {z : ℤ_[p]}, ‖z‖ = 1 → z * z.inv = 1

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{z : ℤ_[p]}


lemma Sigma.map_comp_map {f g h : α → C} [HasCoproduct f] [HasCoproduct g] [HasCoproduct h]
    (q : ∀ (a : α), f a ⟶ g a) (q' : ∀ (a : α), g a ⟶ h a) :
    Sigma.map q ≫ Sigma.map q' = Sigma.map (fun a => q a ≫ q' a)

{α : Type w₂}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{f g h : α → C}
[CategoryTheory.Limits.HasCoproduct f]
[CategoryTheory.Limits.HasCoproduct g]
[CategoryTheory.Limits.HasCoproduct h]
(q : (a : α) → f a ⟶ g a)
(q' : (a : α) → g a ⟶ h a)

CategoryTheory.Limits.Sigma.map q ≫ CategoryTheory.Limits.Sigma.map q' =
  CategoryTheory.Limits.Sigma.map fun a => q a ≫ q' a


lemma piecewise_insert_self [DecidableEq ι] {j : ι} [∀ i, Decidable (i ∈ insert j s)] :
    (insert j s).piecewise f g j = f j

{ι : Type u_1}
{π : ι → Sort u_2}
(s : Finset ι)
(f g : (i : ι) → π i)
[DecidableEq ι]
{j : ι}
[(i : ι) → Decidable (i ∈ insert j s)]


theorem mdifferentiable_fst : MDifferentiable (I.prod I') I (Prod.fst : M × M' → M)

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


theorem degree_ne_of_natDegree_ne {n : ℕ} : p.natDegree ≠ n → degree p ≠ n

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


theorem exists_mem_range_of_norm_rat_le_one (h : ‖(r : ℚ_[p])‖ ≤ 1) :
    ∃ n : ℤ, 0 ≤ n ∧ n < p ∧ ‖(⟨r, h⟩ - n : ℤ_[p])‖ < 1

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

∃ n, 0 ≤ n ∧ n < ↑p ∧ ‖⟨↑r, h⟩ - ↑n‖ < 1


@[simp]
theorem take_left : ∀ l₁ l₂ : List α, take (length l₁) (l₁ ++ l₂) = l₁


@[simp]
theorem union_symm_apply_left {α} {s t : Set α} [DecidablePred fun x => x ∈ s] (H : s ∩ t ⊆ ∅)
    (a : s) : (Equiv.Set.union H).symm (Sum.inl a) = ⟨a, by simp⟩

{α : Type u_1}
{s t : Set α}
[DecidablePred fun x => x ∈ s]
(H : s ∩ t ⊆ ∅)
(a : ↑s)

(Equiv.Set.union H).symm (Sum.inl a) = ⟨↑a, ⋯⟩


@[to_additive (attr := simp)]
theorem prod_dite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α, x = a → β) :
    ∏ x ∈ s, (if h : x = a then b x h else 1) = ite (a ∈ s) (b a rfl) 1

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
[DecidableEq α]
(s : Finset α)
(a : α)
(b : (x : α) → x = a → β)

(∏ x ∈ s, if h : x = a then b x h else 1) = if a ∈ s then b a ⋯ else 1


theorem ofMulAction_def (g : G) : ofMulAction k G H g = Finsupp.lmapDomain k k (g • ·)

{k : Type u_1}
[CommSemiring k]
{G : Type u_2}
[Monoid G]
{H : Type u_3}
[MulAction G H]
(g : G)

(Representation.ofMulAction k G H) g = Finsupp.lmapDomain k k fun x => g • x


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

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

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


@[simp]
theorem decode_zero : (decode 0 : Option Bool) = some false


lemma not_nil_of_ne {p : G.Walk v w} : v ≠ w → ¬ p.Nil

{V : Type u}
{G : SimpleGraph V}
{v w : V}
{p : G.Walk v w}


theorem inner_lt_norm_mul_iff_real {x y : F} : ⟪x, y⟫_ℝ < ‖x‖ * ‖y‖ ↔ ‖y‖ • x ≠ ‖x‖ • y

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


theorem OrderIso.isCompl {x y : α} (h : IsCompl x y) : IsCompl (f x) (f y)

{α : Type u_2}
{β : Type u_3}
[Lattice α]
[Lattice β]
[BoundedOrder α]
[BoundedOrder β]
(f : α ≃o β)
{x y : α}
(h : IsCompl x y)


lemma map_polynomialY : (W.map f).toAffine.polynomialY = W.polynomialY.map (mapRingHom f)

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Affine R)
{S : Type v}
[CommRing S]
(f : R →+* S)

(WeierstrassCurve.map W f).toAffine.polynomialY = Polynomial.map (Polynomial.mapRingHom f) W.polynomialY


theorem toEquiv_injective : Injective (Diffeomorph.toEquiv : (M ≃ₘ^n⟮I, I'⟯ M') → M ≃ M')

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_5}
[TopologicalSpace H]
{H' : Type u_6}
[TopologicalSpace H']
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{n : ℕ∞}


theorem restrict_apply_eq_zero' (hs : MeasurableSet s) : μ.restrict s t = 0 ↔ μ (t ∩ s) = 0

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


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

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


lemma coe_mk {x : K} (hx) : ((⟨x, hx⟩ : 𝓞 K) : K) = x

{K : Type u_1}
[Field K]
{x : K}
(hx : x ∈ integralClosure ℤ K)


theorem sdiff_unique (s : x ⊓ y ⊔ z = x) (i : x ⊓ y ⊓ z = ⊥) : x \ y = z

{α : Type u}
{x y z : α}
[GeneralizedBooleanAlgebra α]
(s : x ⊓ y ⊔ z = x)
(i : x ⊓ y ⊓ z = ⊥)


theorem eq_left_getLeft_of_isLeft : ∀ {x : α ⊕ β} (h : x.isLeft), x = inl (x.getLeft h)

{α : Type u_1}
{β : Type u_2}
{x : α ⊕ β}
(h : x.isLeft = true)


@[simp]
theorem insepDegree_top : insepDegree F (⊤ : IntermediateField E K) = insepDegree 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]

Field.insepDegree F ↥⊤ = Field.insepDegree F K


lemma natDegree_eq_of_natDegree_add_lt_left (p q : R[X])
    (H : natDegree (p + q) < natDegree p) : natDegree p = natDegree q

{R : Type u}
[Semiring R]
(p q : R[X])
(H : (p + q).natDegree < p.natDegree)


theorem surjective_decode_iget (α : Type*) [Encodable α] [Inhabited α] :
    Surjective fun n => ((Encodable.decode n).iget : α)

(α : Type u_3)
[Encodable α]
[Inhabited α]

Function.Surjective fun n => (Encodable.decode n).iget


theorem List.sum_smul {l : List R} {x : M} : l.sum • x = (l.map fun r ↦ r • x).sum

{R : Type u_5}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{l : List R}
{x : M}

l.sum • x = (List.map (fun r => r • x) l).sum


/-- A multiplicative character on a commutative monoid with finitely many units
has finite (= positive) order. -/
lemma orderOf_pos [Finite Mˣ] (χ : MulChar M R) : 0 < orderOf χ

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


@[to_additive (attr := simp)]
theorem op_bot : (⊥ : Submonoid M).op = ⊥


theorem integral_sin_pow_antitone : Antitone fun n : ℕ => ∫ x in (0)..π, sin x ^ n

Antitone fun n => ∫ (x : ℝ) in 0 ..π, Real.sin x ^ n


@[simp]
theorem swap_apply_self (i j a : α) : swap i j (swap i j a) = a

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

(Equiv.swap i j) ((Equiv.swap i j) a) = a


theorem ExpChar.congr {p : ℕ} (q : ℕ) [hq : ExpChar R q] (h : q = p) : ExpChar R p

(R : Type u)
[Semiring R]
{p : ℕ}
(q : ℕ)
[hq : ExpChar R q]
(h : q = p)


theorem eq_of_empty [h : IsEmpty α] (f g : α →ᵇ β) : f = g

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
[h : IsEmpty α]
(f g : BoundedContinuousFunction α β)


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

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


theorem Colorable.mono_left {G' : SimpleGraph V} (h : G ≤ G') {n : ℕ} (hc : G'.Colorable n) :
    G.Colorable n

{V : Type u}
{G G' : SimpleGraph V}
(h : G ≤ G')
{n : ℕ}
(hc : G'.Colorable n)


theorem Derivation.tensorProductTo_mul (D : Derivation R S M) (x y : S ⊗[R] S) :
    D.tensorProductTo (x * y) =
      TensorProduct.lmul' (S := S) R x • D.tensorProductTo y +
        TensorProduct.lmul' (S := S) R y • D.tensorProductTo x

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{M : Type u_1}
[AddCommGroup M]
[Module R M]
[Module S M]
[IsScalarTower R S M]
(D : Derivation R S M)
(x y : TensorProduct R S S)

D.tensorProductTo (x * y) =
  (Algebra.TensorProduct.lmul' R) x • D.tensorProductTo y + (Algebra.TensorProduct.lmul' R) y • D.tensorProductTo x


@[simp]
theorem support_sup [DecidableEq ι] (f g : ι →₀ α) : (f ⊔ g).support = f.support ∪ g.support


@[simp]
theorem renameEquiv_refl : renameEquiv R (Equiv.refl σ) = AlgEquiv.refl

{σ : Type u_1}
(R : Type u_4)
[CommSemiring R]

MvPolynomial.renameEquiv R (Equiv.refl σ) = AlgEquiv.refl


/-- A subsemigroup of a magma `M` is a subset closed under multiplication. -/
structure Subsemigroup (M : Type*) [Mul M] where
  /-- The carrier of a subsemigroup. -/
  carrier : Set M
  /-- The product of two elements of a subsemigroup belongs to the subsemigroup. -/
  mul_mem' {a b} : a ∈ carrier → b ∈ carrier → a * b ∈ carrier

{M : Type u_4}
[Mul M]
(self : Subsemigroup M)
{a b : M}

a ∈ self.carrier → b ∈ self.carrier → a * b ∈ self.carrier


theorem isPiSystem_measurableSet {α : Type*} [MeasurableSpace α] :
    IsPiSystem { s : Set α | MeasurableSet s }


theorem and_eq_true_iff (x y : Bool) : (x && y) = true ↔ x = true ∧ y = true


@[simp]
theorem id_apply (a : α) : sSupHom.id α a = a


@[simp] theorem pwFilter_nil [DecidableRel R] : pwFilter R [] = []

∀ {α : Type u_1} {R : α → α → Prop} [inst : DecidableRel R], List.pwFilter R [] = []


@[fun_prop]
protected theorem mono' (h : AEMeasurable f μ) (h' : ν ≪ μ) : AEMeasurable f ν

{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{f : α → β}
{μ ν : MeasureTheory.Measure α}
(h : AEMeasurable f μ)
(h' : ν ≪ μ)


theorem sup_toSubalgebra_of_isAlgebraic_right [Algebra.IsAlgebraic K E2] :
    (E1 ⊔ E2).toSubalgebra = E1.toSubalgebra ⊔ E2.toSubalgebra

{K : Type u_3}
{L : Type u_4}
[Field K]
[Field L]
[Algebra K L]
(E1 E2 : IntermediateField K L)
[Algebra.IsAlgebraic K ↥E2]


theorem bijective_iff_surjective_and_card (f : α → β) :
    Bijective f ↔ Surjective f ∧ card α = card β

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

Function.Bijective f ↔ Function.Surjective f ∧ Fintype.card α = Fintype.card β


(S : CategoryTheory.ShortComplex.SnakeInput C)

CategoryTheory.CategoryStruct.comp S.L₀.g S.δ = 0


theorem disjoint_pure_atBot [Preorder α] [NoMinOrder α] (x : α) : Disjoint (pure x) atBot

{α : Type u_3}
[Preorder α]
[NoMinOrder α]
(x : α)


@[aesop safe (rule_sets := [Matroid])]
private theorem insert_subset_ground {e : α} {X : Set α} {M : Matroid α}
    (he : e ∈ M.E) (hX : X ⊆ M.E) : insert e X ⊆ M.E

{α : Type u_1}
{e : α}
{X : Set α}
{M : Matroid α}
(he : e ∈ M.E)
(hX : X ⊆ M.E)


theorem one_lt_pow (ha : 1 < a) : ∀ {n : ℕ} (_ : n ≠ 0), 1 < a ^ n

{R : Type u_3}
[OrderedSemiring R]
{a : R}
(ha : 1 < a)
{n : ℕ}


theorem ofIsCompl_eq (h : IsCompl p q) {φ : p →ₗ[R] F} {ψ : q →ₗ[R] F} {χ : E →ₗ[R] F}
    (hφ : ∀ u, φ u = χ u) (hψ : ∀ u, ψ u = χ u) : ofIsCompl h φ ψ = χ

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
{p q : Submodule R E}
(h : IsCompl p q)
{φ : ↥p →ₗ[R] F}
{ψ : ↥q →ₗ[R] F}
{χ : E →ₗ[R] F}
(hφ : ∀ (u : ↥p), φ u = χ ↑u)
(hψ : ∀ (u : ↥q), ψ u = χ ↑u)


theorem coe_def : (φ : MvPowerSeries σ R) = fun n => coeff n φ

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


theorem b_of_eq (h : P.toPoly = Q.toPoly) : P.b = Q.b

{R : Type u_1}
{P Q : Cubic R}
[Semiring R]
(h : P.toPoly = Q.toPoly)


lemma add_eq_add {X'' Y'' : C} (eX' : L.obj X'' ≅ X') (eY' : L.obj Y'' ≅ Y')
    (f₁ f₂ : X' ⟶ Y') :
    add W eX eY f₁ f₂ = add W eX' eY' f₁ f₂

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_3, u_2} D]
[CategoryTheory.Preadditive C]
{L : CategoryTheory.Functor C D}
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasLeftCalculusOfFractions]
{X Y : C}
{X' Y' : D}
(eX : L.obj X ≅ X')
(eY : L.obj Y ≅ Y')
{X'' Y'' : C}
(eX' : L.obj X'' ≅ X')
(eY' : L.obj Y'' ≅ Y')
(f₁ f₂ : X' ⟶ Y')

CategoryTheory.Localization.Preadditive.add W eX eY f₁ f₂ = CategoryTheory.Localization.Preadditive.add W eX' eY' f₁ f₂


theorem closure_withConstants_eq :
    closure (L[[A]]) s =
      (closure L (A ∪ s)).withConstants ((A.subset_union_left).trans subset_closure)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{A s : Set M}

(FirstOrder.Language.Substructure.closure (L.withConstants ↑A)).toFun s =
  ((FirstOrder.Language.Substructure.closure L).toFun (A ∪ s)).withConstants ⋯


/-- A multiplicative morphism between monoids gives a monoidal functor between the corresponding
discrete monoidal categories.
-/
@[to_additive (attr := simps) Discrete.addMonoidalFunctor]
def Discrete.monoidalFunctor (F : M →* N) : MonoidalFunctor (Discrete M) (Discrete N)

{M : Type u}
[Monoid M]
{N : Type u'}
[Monoid N]
(F : M →* N)
(X : CategoryTheory.Discrete M)

((CategoryTheory.Discrete.monoidalFunctor F).obj X).as = F X.as


@[simp]
theorem refl_toCoalgEquiv : refl R A = CoalgEquiv.refl R A

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[CoalgebraStruct R A]

↑(BialgEquiv.refl R A) = CoalgEquiv.refl R A


theorem fpowerSeries_apply_add_two (f : E →L[𝕜] F) (x : E) (n : ℕ) : f.fpowerSeries x (n + 2) = 0

{𝕜 : Type u}
{E : Type v}
{F : Type w}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(f : E →L[𝕜] F)
(x : E)
(n : ℕ)


@[to_additive]
theorem MonoidHom.coe_finsupp_prod [Zero β] [Monoid N] [CommMonoid P] (f : α →₀ β)
    (g : α → β → N →* P) : ⇑(f.prod g) = f.prod fun i fi => ⇑(g i fi)

{α : Type u_1}
{β : Type u_7}
{N : Type u_10}
{P : Type u_11}
[Zero β]
[AddMonoid N]
[AddCommMonoid P]
(f : α →₀ β)
(g : α → β → N →+ P)

⇑(f.sum g) = f.sum fun i fi => ⇑(g i fi)


@[simp] lemma smul_pow' (r : M) (x : A) (n : ℕ) : r • x ^ n = (r • x) ^ n

{M : Type u_1}
{A : Type u_4}
[Monoid M]
[Monoid A]
[MulDistribMulAction M A]
(r : M)
(x : A)
(n : ℕ)


@[simp]
theorem exp_sub_sinh : exp x - sinh x = cosh x


private theorem sum_four_squares_of_two_mul_sum_four_squares {m a b c d : ℤ}
    (h : a ^ 2 + b ^ 2 + c ^ 2 + d ^ 2 = 2 * m) :
    ∃ w x y z : ℤ, w ^ 2 + x ^ 2 + y ^ 2 + z ^ 2 = m


@[simp] lemma div_self (h : a ≠ 0) : a / a = 1

{G₀ : Type u_3}
[GroupWithZero G₀]
{a : G₀}
(h : a ≠ 0)


@[simp, norm_cast]
theorem coe_sub (x y : R) : (↑(x - y) : c.Quotient) = x - y

{R : Type u_2}
[AddGroup R]
[Mul R]
(c : RingCon R)
(x y : R)


theorem mem_adjoin_iff (x : E) :
    x ∈ adjoin F S ↔ ∃ r s : MvPolynomial S F,
      x = MvPolynomial.aeval Subtype.val r / MvPolynomial.aeval Subtype.val s

(F : Type u_1)
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{S : Set E}
(x : E)

x ∈ IntermediateField.adjoin F S ↔ ∃ r s, x = (MvPolynomial.aeval Subtype.val) r / (MvPolynomial.aeval Subtype.val) s


@[to_additive add_sub_one_nsmul]
lemma pow_sub_one_mul (hn : n ≠ 0) (a : M) : a ^ (n - 1) * a = a ^ n

{M : Type u_4}
[Monoid M]
{n : ℕ}
(hn : n ≠ 0)
(a : M)


/-- Embed `Fin n` into `Fin (n + 1)` by inserting
around a specified pivot `p : Fin (n + 1)` into the `univ` -/
theorem Fin.univ_succAbove (n : ℕ) (p : Fin (n + 1)) :
    (univ : Finset (Fin (n + 1))) = Finset.cons p (univ.map <| Fin.succAboveEmb p) (by simp)

Finset.univ = Finset.cons p (Finset.map p.succAboveEmb Finset.univ) ⋯


@[simp]
theorem mk_vsub_mk (p₁ p₂ : P) (p₁' p₂' : P') :
    ((p₁, p₁') -ᵥ (p₂, p₂') : G × G') = (p₁ -ᵥ p₂, p₁' -ᵥ p₂')

{G : Type u_1}
{G' : Type u_2}
{P : Type u_3}
{P' : Type u_4}
[AddGroup G]
[AddGroup G']
[AddTorsor G P]
[AddTorsor G' P']
(p₁ p₂ : P)
(p₁' p₂' : P')

(p₁, p₁') -ᵥ (p₂, p₂') = (p₁ -ᵥ p₂, p₁' -ᵥ p₂')


@[simp]
theorem isSuccLimit_toDual_iff : IsSuccLimit (toDual a) ↔ IsPredLimit a

Order.IsSuccLimit (OrderDual.toDual a) ↔ Order.IsPredLimit a


/-- A subgroup is finitely generated if and only if it is finitely generated as a submonoid. -/
@[to_additive "An additive subgroup is finitely generated if
and only if it is finitely generated as an additive submonoid."]
theorem Subgroup.fg_iff_submonoid_fg (P : Subgroup G) : P.FG ↔ P.toSubmonoid.FG

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


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

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

((CategoryTheory.Comma.mapRightIso L i).unitIso.hom.app X).right = CategoryTheory.CategoryStruct.id X.right


lemma floorRoot_pow_dvd : floorRoot n a ^ n ∣ a


@[to_additive min_add_min_le_min_add_add]
theorem min_mul_min_le_min_mul_mul' : min a c * min b d ≤ min (a * b) (c * d)

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

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


theorem _root_.IsFiniteMeasure.lintegral_lt_top_of_bounded_to_ennreal {α : Type*}
    [MeasurableSpace α] (μ : Measure α) [μ_fin : IsFiniteMeasure μ] {f : α → ℝ≥0∞}
    (f_bdd : ∃ c : ℝ≥0, ∀ x, f x ≤ c) : ∫⁻ x, f x ∂μ < ∞

[μ_fin : MeasureTheory.IsFiniteMeasure μ]

{f : α → ℝ≥0∞}


@[to_additive]
theorem Multipliable.sigma {γ : β → Type*} {f : (Σb : β, γ b) → α} (ha : Multipliable f) :
    Multipliable fun b ↦ ∏' c, f ⟨b, c⟩

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[UniformSpace α]
[UniformAddGroup α]
[CompleteSpace α]
{γ : β → Type u_5}
{f : (b : β) × γ b → α}
(ha : Summable f)

Summable fun b => ∑' (c : γ b), f ⟨b, c⟩


@[simp]
lemma homMk₅_app_zero : (homMk₅ app₀ app₁ app₂ app₃ app₄ app₅ w₀ w₁ w₂ w₃ w₄).app 0 = app₀

{f g : CategoryTheory.ComposableArrows C 5}

(w₀ :
  CategoryTheory.CategoryStruct.comp (f.map' 0 1 ⋯ ⋯) app₁ = CategoryTheory.CategoryStruct.comp app₀ (g.map' 0 1 ⋯ ⋯))

(w₁ :
  CategoryTheory.CategoryStruct.comp (f.map' 1 2 ⋯ ⋯) app₂ = CategoryTheory.CategoryStruct.comp app₁ (g.map' 1 2 ⋯ ⋯))

(w₂ :
  CategoryTheory.CategoryStruct.comp (f.map' 2 3 ⋯ ⋯) app₃ = CategoryTheory.CategoryStruct.comp app₂ (g.map' 2 3 ⋯ ⋯))

(w₃ :
  CategoryTheory.CategoryStruct.comp (f.map' 3 4 ⋯ ⋯) app₄ = CategoryTheory.CategoryStruct.comp app₃ (g.map' 3 4 ⋯ ⋯))

(w₄ :
  CategoryTheory.CategoryStruct.comp (f.map' 4 5 ⋯ ⋯) app₅ = CategoryTheory.CategoryStruct.comp app₄ (g.map' 4 5 ⋯ ⋯))

(CategoryTheory.ComposableArrows.homMk₅ app₀ app₁ app₂ app₃ app₄ app₅ w₀ w₁ w₂ w₃ w₄).app 0 = app₀


theorem IsMinFilter.inf (hf : IsMinFilter f l a) (hg : IsMinFilter g l a) :
    IsMinFilter (fun x => f x ⊓ g x) l a

{α : Type u}
{β : Type v}
[SemilatticeInf β]
{f g : α → β}
{a : α}
{l : Filter α}
(hf : IsMinFilter f l a)
(hg : IsMinFilter g l a)


@[simp]
theorem coe_of (C : Type u) [Groupoid C] : (of C : Type u) = C

(C : Type u)
[CategoryTheory.Groupoid C]


theorem sin_pi_div_two_sub (θ : Angle) : sin (↑(π / 2) - θ) = cos θ


@[to_additive]
theorem noncommPiCoprod_range
    {hcomm : Pairwise fun i j : ι => ∀ x y : G, x ∈ H i → y ∈ H j → Commute x y} :
    (noncommPiCoprod hcomm).range = ⨆ i : ι, H i

{hcomm : Pairwise fun i j => ∀ (x y : G), x ∈ H i → y ∈ H j → AddCommute x y}

(AddSubgroup.noncommPiCoprod hcomm).range = ⨆ i, H i


theorem coe_inf [SemilatticeInf α] (a b : α) : ((a ⊓ b : α) : WithTop α) = (a : WithTop α) ⊓ b

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


theorem map_reindex_symm (f : Π i, s i →ₗ[R] t i) (e : ι ≃ ι₂) (x : ⨂[R] i, s (e.symm i)) :
    map f ((reindex R s e).symm x) = (reindex R t e).symm (map (fun i ↦ f (e.symm i)) x)

(e : ι ≃ ι₂)

(x : PiTensorProduct R fun i => s (e.symm i))

(PiTensorProduct.map f) ((PiTensorProduct.reindex R s e).symm x) =
  (PiTensorProduct.reindex R t e).symm ((PiTensorProduct.map fun i => f (e.symm i)) x)


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

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

(M * (List.take k (Matrix.Pivot.listTransvecRow M)).prod) i (Sum.inr ()) = M i (Sum.inr ())


/-- A monoidal functor induces a monoidal functor between
the categories of `G`-actions within those categories. -/
@[simps!]
def mapAction : MonoidalFunctor (Action V G) (Action W G)

(F : CategoryTheory.MonoidalFunctor V W)

((F.mapAction G).μ X Y).hom = F.μ X.V Y.V


/-- A category is `FinallySmall.{w}` if there is a final functor from a `w`-small category. -/
class FinallySmall : Prop where
  /-- There is a final functor from a small category. -/
  final_smallCategory : ∃ (S : Type w) (_ : SmallCategory S) (F : S ⥤ J), Final F

{J : Type u}
[CategoryTheory.Category.{v, u} J]
[self : CategoryTheory.FinallySmall J]


@[simp, norm_cast]
theorem coe_add (a b : α) : ((a + b : α) : WithBot α) = a + b


@[simp] protected theorem ediv_left_inj {a b d : Int}
    (hda : d ∣ a) (hdb : d ∣ b) : a / d = b / d ↔ a = b


/-- Two affine subspaces with nonempty intersection are equal if and only if their directions are
equal. -/
theorem eq_iff_direction_eq_of_mem {s₁ s₂ : AffineSubspace k P} {p : P} (h₁ : p ∈ s₁)
    (h₂ : p ∈ s₂) : s₁ = s₂ ↔ s₁.direction = s₂.direction

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s₁ s₂ : AffineSubspace k P}
{p : P}
(h₁ : p ∈ s₁)
(h₂ : p ∈ s₂)


/-- The decomposition of elements of a star module into their self- and skew-adjoint parts,
as a continuous linear equivalence. -/
@[simps!]
def StarModule.decomposeProdAdjointL [TopologicalAddGroup A] [ContinuousStar A]
    [ContinuousConstSMul R A] : A ≃L[R] selfAdjoint A × skewAdjoint A

(R : Type u_1)
(A : Type u_2)
[Semiring R]
[StarMul R]
[TrivialStar R]
[AddCommGroup A]
[Module R A]
[StarAddMonoid A]
[StarModule R A]
[Invertible 2]
[TopologicalSpace A]
[TopologicalAddGroup A]
[ContinuousStar A]
[ContinuousConstSMul R A]
(i : A)

(StarModule.decomposeProdAdjointL R A) i = ((selfAdjointPart R) i, (skewAdjointPart R) i)


/-- Given a MonoidHom `f : M →* N` and Submonoid `S ⊆ M` such that
`f(S) ⊆ Nˣ`, for all `x₁ x₂ : M` and `y₁, y₂ ∈ S`, we have
`f x₁ * (f y₁)⁻¹ = f x₂ * (f y₂)⁻¹ ↔ f (x₁ * y₂) = f (x₂ * y₁)`. -/
@[to_additive (attr := simp)
    "Given an AddMonoidHom `f : M →+ N` and Submonoid `S ⊆ M` such that
`f(S) ⊆ AddUnits N`, for all `x₁ x₂ : M` and `y₁, y₂ ∈ S`, we have
`f x₁ - f y₁ = f x₂ - f y₂ ↔ f (x₁ + y₂) = f (x₂ + y₁)`."]
theorem mul_inv {f : M →* N} (h : ∀ y : S, IsUnit (f y)) {x₁ x₂} {y₁ y₂ : S} :
    f x₁ * (IsUnit.liftRight (f.restrict S) h y₁)⁻¹ =
        f x₂ * (IsUnit.liftRight (f.restrict S) h y₂)⁻¹ ↔
      f (x₁ * y₂) = f (x₂ * y₁)

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{f : M →+ N}
(h : ∀ (y : ↥S), IsAddUnit (f ↑y))
{x₁ x₂ : M}
{y₁ y₂ : ↥S}

f x₁ + ↑(-(IsAddUnit.liftRight (f.restrict S) h) y₁) = f x₂ + ↑(-(IsAddUnit.liftRight (f.restrict S) h) y₂) ↔
  f (x₁ + ↑y₂) = f (x₂ + ↑y₁)


lemma map_iSup (f : LatticeHom α β) (L : ι → Sublattice α) : (⨆ i, L i).map f = ⨆ i, (L i).map f

{ι : Sort u_1}
{α : Type u_2}
{β : Type u_3}
[Lattice α]
[Lattice β]
(f : LatticeHom α β)
(L : ι → Sublattice α)

Sublattice.map f (⨆ i, L i) = ⨆ i, Sublattice.map f (L i)


theorem gal_C_isSolvable (x : F) : IsSolvable (C x).Gal


@[to_additive]
theorem mul_lt_of_mul_lt_left [CovariantClass α α (· * ·) (· ≤ ·)] {a b c d : α} (h : a * b < c)
    (hle : d ≤ b) :
    a * d < c

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


@[to_additive]
lemma unop_smul_eq_unop_smul_unop [SMul M α] [SMul Mᵐᵒᵖ α] [IsCentralScalar M α] (r : Mᵐᵒᵖ)
    (a : αᵐᵒᵖ) : unop (r • a) = unop r • unop a

{M : Type u_2}
{α : Type u_4}
[SMul M α]
[SMul Mᵐᵒᵖ α]
[IsCentralScalar M α]
(r : Mᵐᵒᵖ)
(a : αᵐᵒᵖ)

MulOpposite.unop (r • a) = MulOpposite.unop r • MulOpposite.unop a


/-- A function `f` from `Finset α` is strictly antitone if and only if `f (cons a s ha) < f s` for
all `s` and `a ∉ s`. -/
lemma strictAnti_iff_forall_cons_lt : StrictAnti f ↔ ∀ s ⦃a⦄ ha, f (cons a s ha) < f s

{α : Type u_1}
{β : Type u_2}
[Preorder β]
{f : Finset α → β}

StrictAnti f ↔ ∀ (s : Finset α) ⦃a : α⦄ (ha : a ∉ s), f (Finset.cons a s ha) < f s


@[to_additive]
theorem LipschitzWith.norm_div_le_of_le {f : E → F} {C : ℝ≥0} (h : LipschitzWith C f)
    (hr : ‖a / b‖ ≤ r) : ‖f a / f b‖ ≤ C * r

{E : Type u_3}
{F : Type u_4}
[SeminormedGroup E]
[SeminormedGroup F]
{a b : E}
{r : ℝ}
{f : E → F}
{C : ℝ≥0}
(h : LipschitzWith C f)
(hr : ‖a / b‖ ≤ r)


theorem validFor : ∀ {it}, Valid it → ∃ l r, ValidFor l r it

it.Valid → ∃ l r, String.Iterator.ValidFor l r it


@[simp]
theorem Definable.inter {f g : Set (α → M)} (hf : A.Definable L f) (hg : A.Definable L g) :
    A.Definable L (f ∩ g)

{M : Type w}
{A : Set M}
{L : FirstOrder.Language}
[L.Structure M]
{α : Type u₁}
{f g : Set (α → M)}
(hf : A.Definable L f)
(hg : A.Definable L g)


theorem isMatching_iff_forall_degree [∀ v, Fintype (M.neighborSet v)] :
    M.IsMatching ↔ ∀ v : V, v ∈ M.verts → M.degree v = 1

{V : Type u_1}
{G : SimpleGraph V}
{M : G.Subgraph}
[(v : V) → Fintype ↑(M.neighborSet v)]

M.IsMatching ↔ ∀ v ∈ M.verts, M.degree v = 1


@[simp]
theorem birthday_half : birthday (powHalf 1) = 2

(SetTheory.PGame.powHalf 1).birthday = 2


@[simp]
lemma factorsThruAlong_id {X : C} (S T : Presieve X) :
    S.FactorsThruAlong T (𝟙 X) ↔ S.FactorsThru T

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

S.FactorsThruAlong T (CategoryTheory.CategoryStruct.id X) ↔ S.FactorsThru T


/-- Shows that `|v - Aₙ / Bₙ| ≤ 1 / (bₙ * Bₙ * Bₙ)`. This bound is worse than the one shown in
`GenContFract.abs_sub_convs_le`, but sometimes it is easier to apply and
sufficient for one's use case.
 -/
theorem abs_sub_convergents_le' {b : K}
    (nth_partDen_eq : (of v).partDens.get? n = some b) :
    |v - (of v).convs n| ≤ 1 / (b * (of v).dens n * (of v).dens n)

(nth_partDen_eq : (GenContFract.of v).partDens.get? n = some b)

|v - (GenContFract.of v).convs n| ≤ 1 / (b * (GenContFract.of v).dens n * (GenContFract.of v).dens n)


/-- Coercion from `ℚ` as an order embedding. -/
@[simps!]
def castOrderEmbedding : ℚ ↪o K

∀ (a : ℚ), Rat.castOrderEmbedding a = ↑a


@[to_additive (attr := gcongr) sub_lt_sub_right]
theorem div_lt_div_right' (h : a < b) (c : α) : a / c < b / c

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


theorem final_iff_final_comp [Final F] : Final G ↔ Final (F ⋙ G)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
(F : CategoryTheory.Functor C D)
(G : CategoryTheory.Functor D E)
[F.Final]


@[simp]
theorem opRingEquiv_op_monomial (n : ℕ) (r : R) :
    opRingEquiv R (op (monomial n r : R[X])) = monomial n (op r)

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

(Polynomial.opRingEquiv R) (MulOpposite.op ((Polynomial.monomial n) r)) = (Polynomial.monomial n) (MulOpposite.op r)


@[ext] theorem ext {x x' : OptionT m α} (h : x.run = x'.run) : x = x'

{α : Type u}
{m : Type u → Type v}
{x x' : OptionT m α}
(h : x.run = x'.run)


theorem And.exists {p q : Prop} {f : p ∧ q → Prop} : (∃ h, f h) ↔ ∃ hp hq, f ⟨hp, hq⟩


theorem surjective_of_ne_zero [IsSimpleModule R N] {f : M →ₗ[R] N} (h : f ≠ 0) :
    Function.Surjective f

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


/-- Any compact set in a pseudometric space can be covered by finitely many balls of a given
positive radius -/
theorem finite_cover_balls_of_compact {α : Type u} [PseudoMetricSpace α] {s : Set α}
    (hs : IsCompact s) {e : ℝ} (he : 0 < e) :
    ∃ t, t ⊆ s ∧ Set.Finite t ∧ s ⊆ ⋃ x ∈ t, ball x e

∃ t ⊆ s, t.Finite ∧ s ⊆ ⋃ x ∈ t, Metric.ball x e


/-- The angle between a nonnegative multiple of a vector and that vector is 0. -/
@[simp]
theorem oangle_smul_left_self_of_nonneg (x : V) {r : ℝ} (hr : 0 ≤ r) : o.oangle (r • x) x = 0

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


@[simp]
theorem symm_dual_id : BoundedOrderHom.dual.symm (BoundedOrderHom.id _) = BoundedOrderHom.id α

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

BoundedOrderHom.dual.symm (BoundedOrderHom.id αᵒᵈ) = BoundedOrderHom.id α


/-- The natural `ℝ`-linear isometry equivalence between `𝕜` satisfying `RCLike 𝕜` and `ℂ` when
`RCLike.im RCLike.I = 1`. -/
@[simps]
def _root_.RCLike.complexLinearIsometryEquiv {𝕜 : Type*} [RCLike 𝕜]
    (h : RCLike.im (RCLike.I : 𝕜) = 1) : 𝕜 ≃ₗᵢ[ℝ] ℂ

{𝕜 : Type u_2}
[RCLike 𝕜]
(h : RCLike.im RCLike.I = 1)

∀ (a : 𝕜), (RCLike.complexLinearIsometryEquiv h) a = (RCLike.complexRingEquiv h).toFun a


@[reassoc (attr := simp)]
lemma ιTensorObj₃_tensorHom (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (f₃ : X₃ ⟶ Y₃)
    (i₁ i₂ i₃ j : I) (h : i₁ + i₂ + i₃ = j) :
    ιTensorObj₃ X₁ X₂ X₃ i₁ i₂ i₃ j h ≫ tensorHom f₁ (tensorHom f₂ f₃) j =
      (f₁ i₁ ⊗ f₂ i₂ ⊗ f₃ i₃) ≫ ιTensorObj₃ Y₁ Y₂ Y₃ i₁ i₂ i₃ j h

{X₁ X₂ X₃ : CategoryTheory.GradedObject I C}

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

{Y₁ Y₂ Y₃ : CategoryTheory.GradedObject I C}

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.Monoidal.ιTensorObj₃ X₁ X₂ X₃ i₁ i₂ i₃ j h)
    (CategoryTheory.GradedObject.Monoidal.tensorHom f₁ (CategoryTheory.GradedObject.Monoidal.tensorHom f₂ f₃) j) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.tensorHom (f₁ i₁) (CategoryTheory.MonoidalCategory.tensorHom (f₂ i₂) (f₃ i₃)))
    (CategoryTheory.GradedObject.Monoidal.ιTensorObj₃ Y₁ Y₂ Y₃ i₁ i₂ i₃ j h)


@[simp]
theorem lie_nsmul (n : ℕ) : ⁅x, n • m⁆ = n • ⁅x, m⁆

{L : Type v}
{M : Type w}
[LieRing L]
[AddCommGroup M]
[LieRingModule L M]
(x : L)
(m : M)
(n : ℕ)


@[to_additive sum_boole_nsmul]
theorem prod_pow_boole [DecidableEq α] (s : Finset α) (f : α → β) (a : α) :
    (∏ x ∈ s, f x ^ ite (a = x) 1 0) = ite (a ∈ s) (f a) 1

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

∑ x ∈ s, (if a = x then 1 else 0) • f x = if a ∈ s then f a else 0


theorem minimum?_mem [Min α] (min_eq_or : ∀ a b : α, min a b = a ∨ min a b = b) :
    {xs : List α} → xs.minimum? = some a → a ∈ xs

(min_eq_or : ∀ (a b : α), min a b = a ∨ min a b = b)


@[to_additive]
theorem subset_mul_left (s : Set α) {t : Set α} (ht : (1 : α) ∈ t) : s ⊆ s * t

{α : Type u_2}
[MulOneClass α]
(s : Set α)
{t : Set α}
(ht : 1 ∈ t)


lemma nontrivial_iff {n : ℕ} : Nontrivial (ZMod n) ↔ n ≠ 1


@[measurability]
protected theorem Measurable.rangeFactorization {f : α → β} (hf : Measurable f) :
    Measurable (rangeFactorization f)

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}
{f : α → β}
(hf : Measurable f)


/-- Let `p` be a seminorm on a vector space over a `NormedField`.
If there is a scalar `c` with `‖c‖>1`, then any `x` such that `p x ≠ 0` can be
moved by scalar multiplication to any `p`-shell of width `‖c‖`. Also recap information on the
value of `p` on the rescaling element that shows up in applications. -/
lemma rescale_to_shell_zpow (p : Seminorm 𝕜 E) {c : 𝕜} (hc : 1 < ‖c‖) {ε : ℝ}
    (εpos : 0 < ε) {x : E} (hx : p x ≠ 0) : ∃ n : ℤ, c^n ≠ 0 ∧
    p (c^n • x) < ε ∧ (ε / ‖c‖ ≤ p (c^n • x)) ∧ (‖c^n‖⁻¹ ≤ ε⁻¹ * ‖c‖ * p x)

{𝕜 : Type u_3}
{E : Type u_7}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : Seminorm 𝕜 E)
{c : 𝕜}
(hc : 1 < ‖c‖)
{ε : ℝ}
(εpos : 0 < ε)
{x : E}
(hx : p x ≠ 0)

∃ n, c ^ n ≠ 0 ∧ p (c ^ n • x) < ε ∧ ε / ‖c‖ ≤ p (c ^ n • x) ∧ ‖c ^ n‖⁻¹ ≤ ε⁻¹ * ‖c‖ * p x


/-- A preadditive category is pseudoabelian iff all idempotent endomorphisms have a kernel. -/
theorem isIdempotentComplete_iff_idempotents_have_kernels [Preadditive C] :
    IsIdempotentComplete C ↔ ∀ (X : C) (p : X ⟶ X), p ≫ p = p → HasKernel p

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

CategoryTheory.IsIdempotentComplete C ↔ ∀ (X : C) (p : X ⟶ X), p ≫ p = p → CategoryTheory.Limits.HasKernel p


@[to_additive (attr := simp)]
theorem inv_top : (⊤ : Submonoid G)⁻¹ = ⊤


/-- Typeclass for monoids with characteristic zero.
  (This is usually stated on fields but it makes sense for any additive monoid with 1.)

*Warning*: for a semiring `R`, `CharZero R` and `CharP R 0` need not coincide.
* `CharZero R` requires an injection `ℕ ↪ R`;
* `CharP R 0` asks that only `0 : ℕ` maps to `0 : R` under the map `ℕ → R`.
For instance, endowing `{0, 1}` with addition given by `max` (i.e. `1` is absorbing), shows that
`CharZero {0, 1}` does not hold and yet `CharP {0, 1} 0` does.
This example is formalized in `Counterexamples/CharPZeroNeCharZero.lean`.
-/
class CharZero (R) [AddMonoidWithOne R] : Prop where
  /-- An additive monoid with one has characteristic zero if the canonical map `ℕ → R` is
  injective. -/
  cast_injective : Function.Injective (Nat.cast : ℕ → R)

{R : Type u_1}
[AddMonoidWithOne R]
[self : CharZero R]


theorem padicValNat_dvd_iff_le [hp : Fact p.Prime] {a n : ℕ} (ha : a ≠ 0) :
    p ^ n ∣ a ↔ n ≤ padicValNat p a

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{a n : ℕ}
(ha : a ≠ 0)


protected theorem eq_of_ge {a b : α} (h : b ≤ a) :
    variationOnFromTo f s a b = -(eVariationOn f (s ∩ Icc b a)).toReal

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
(f : α → E)
(s : Set α)
{a b : α}
(h : b ≤ a)

variationOnFromTo f s a b = -(eVariationOn f (s ∩ Set.Icc b a)).toReal


theorem tendstoUniformlyOn_iff_tendstoUniformly_comp_coe :
    TendstoUniformlyOn F f p s ↔ TendstoUniformly (fun i (x : s) => F i x) (f ∘ (↑)) p

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

TendstoUniformlyOn F f p s ↔ TendstoUniformly (fun i x => F i ↑x) (f ∘ Subtype.val) p


/-- **Poisson's summation formula** for Schwartz functions. -/
theorem SchwartzMap.tsum_eq_tsum_fourierIntegral (f g : SchwartzMap ℝ ℂ) (hfg : 𝓕 ⇑f = ⇑g) (x : ℝ) :
    ∑' n : ℤ, f (x + n) = (∑' n : ℤ, g n * fourier n (x : UnitAddCircle))

∑' (n : ℤ), f (x + ↑n) = ∑' (n : ℤ), g ↑n * (fourier n) ↑x


@[simp]
theorem lowerClosure_iUnion (f : ι → Set α) : lowerClosure (⋃ i, f i) = ⨆ i, lowerClosure (f i)

{α : Type u_1}
{ι : Sort u_4}
[Preorder α]
(f : ι → Set α)


theorem coordChangeL_apply (e e' : Trivialization F (π F E)) [e.IsLinear R] [e'.IsLinear R] {b : B}
    (hb : b ∈ e.baseSet ∩ e'.baseSet) (y : F) :
    coordChangeL R e e' b y = (e' ⟨b, e.symm b y⟩).2

[TopologicalSpace (Bundle.TotalSpace F E)]

(e e' : Trivialization F Bundle.TotalSpace.proj)

(Trivialization.coordChangeL R e e' b) y = (↑e' { proj := b, snd := e.symm b y }).2


/-- If `s` is σ-compact and `f` is continuous on `s`, `f(s)` is σ-compact. -/
lemma IsSigmaCompact.image_of_continuousOn {f : X → Y} {s : Set X} (hs : IsSigmaCompact s)
    (hf : ContinuousOn f s) : IsSigmaCompact (f '' s)

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


theorem iterate_frobenius_coeff (x : 𝕎 R) (i k : ℕ) :
    (frobenius^[i] x).coeff k = x.coeff k ^ p ^ i

{p : ℕ}
{R : Type u_1}
[hp : Fact (Nat.Prime p)]
[CommRing R]
[CharP R p]
(x : WittVector p R)
(i k : ℕ)

((⇑WittVector.frobenius)^[i] x).coeff k = x.coeff k ^ p ^ i


theorem sup_mem_closed_subalgebra (A : Subalgebra ℝ C(X, ℝ)) (h : IsClosed (A : Set C(X, ℝ)))
    (f g : A) : (f : C(X, ℝ)) ⊔ (g : C(X, ℝ)) ∈ A

{X : Type u_1}
[TopologicalSpace X]
[CompactSpace X]
(A : Subalgebra ℝ C(X, ℝ))
(h : IsClosed ↑A)
(f g : ↥A)


theorem iUnion_subtype (p : α → Prop) (s : { x // p x } → Set β) :
    ⋃ x : { x // p x }, s x = ⋃ (x) (hx : p x), s ⟨x, hx⟩

{α : Type u_1}
{β : Type u_2}
(p : α → Prop)
(s : { x // p x } → Set β)


@[simp]
theorem explicitCokernelIso_hom_π {X Y : SemiNormedGrp.{u}} (f : X ⟶ Y) :
    explicitCokernelπ f ≫ (explicitCokernelIso f).hom = cokernel.π _

SemiNormedGrp.explicitCokernelπ f ≫ (SemiNormedGrp.explicitCokernelIso f).hom = CategoryTheory.Limits.cokernel.π f


theorem roth_lower_bound_explicit (hN : 4096 ≤ N) :
    (N : ℝ) * exp (-4 * √(log N)) < rothNumberNat N

↑N * rexp (-4 * √(Real.log ↑N)) < ↑(rothNumberNat N)


theorem op (h : IsZero X) : IsZero (Opposite.op X)

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


/-- In a normed vector space, the subtraction of a measurable function and a strongly measurable
function is measurable. Note that this is not true without further second-countability assumptions
for the subtraction of two measurable functions. -/
theorem _root_.Measurable.sub_stronglyMeasurable
    {α E : Type*} {_ : MeasurableSpace α} [AddCommGroup E] [TopologicalSpace E]
    [MeasurableSpace E] [BorelSpace E] [ContinuousAdd E] [ContinuousNeg E] [PseudoMetrizableSpace E]
    {g f : α → E} (hg : Measurable g) (hf : StronglyMeasurable f) :
    Measurable (g - f)

∀ {x : MeasurableSpace α} [inst : AddCommGroup E] [inst_1 : TopologicalSpace E] [inst_2 : MeasurableSpace E]
  [inst_3 : BorelSpace E] [inst_4 : ContinuousAdd E] [inst_5 : ContinuousNeg E]
  [inst_6 : TopologicalSpace.PseudoMetrizableSpace E] {g f : α → E},
  Measurable g → MeasureTheory.StronglyMeasurable f → Measurable (g - f)


@[deprecated ofFn_get (since := "2023-01-17")]
theorem ofFn_nthLe : ∀ l : List α, (ofFn fun i => nthLe l i i.2) = l


theorem isLeast_Ico (h : a < b) : IsLeast (Ico a b) a

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


@[to_additive (attr := simp) pi_norm_const]
lemma pi_norm_const' [Nonempty ι] (a : E) : ‖fun _i : ι => a‖ = ‖a‖

{ι : Type u_1}
{E : Type u_2}
[Fintype ι]
[SeminormedGroup E]
[Nonempty ι]
(a : E)


@[to_additive]
theorem comap_iInf_map_of_injective (S : ι → Submonoid M) : (⨅ i, (S i).map f).comap f = iInf S

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_4}
[FunLike F M N]
[mc : MonoidHomClass F M N]
{ι : Type u_5}
{f : F}
(hf : Function.Injective ⇑f)
(S : ι → Submonoid M)

Submonoid.comap f (⨅ i, Submonoid.map f (S i)) = iInf S


lemma even_xor'_odd (n : ℤ) : Xor' (Even n) (Odd n)


@[simp]
theorem binomial_one [DecidableEq α] (h : a ≠ b) (h₁ : f a = 1) :
    multinomial {a, b} f = (f b).succ

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


theorem hasSum_im {f : α → 𝕜} {x : 𝕜} (h : HasSum f x) : HasSum (fun x => im (f x)) (im x)

{α : Type u_1}
(𝕜 : Type u_2)
[RCLike 𝕜]
{f : α → 𝕜}
{x : 𝕜}
(h : HasSum f x)

HasSum (fun x => RCLike.im (f x)) (RCLike.im x)


theorem IsPurelyInseparable.isIntegral' [IsPurelyInseparable F E] (x : E) : IsIntegral F x

(F : Type u)
{E : Type v}
[Field F]
[Field E]
[Algebra F E]
[IsPurelyInseparable F E]
(x : E)


theorem Finite.dependent_image {s : Set α} (hs : s.Finite) (F : ∀ i ∈ s, β) :
    {y : β | ∃ x hx, F x hx = y}.Finite

{α : Type u}
{β : Type v}
{s : Set α}
(hs : s.Finite)
(F : (i : α) → i ∈ s → β)

{y | ∃ x, ∃ (hx : x ∈ s), F x hx = y}.Finite


@[simp]
theorem preimage_mul_const_Ioc_of_neg (a b : α) {c : α} (h : c < 0) :
    (fun x => x * c) ⁻¹' Ioc a b = Ico (b / c) (a / c)

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

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


theorem ppred_eq_pred {n} (h : 0 < n) : ppred n = some (pred n)


theorem coordinate_eval_4 :
    (coordinate 4).eval (.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: t)) = a4

(Lean.Omega.LinearCombo.coordinate 4).eval (Lean.Omega.Coeffs.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: t)) = a4


theorem contDiff_sin {n} : ContDiff ℝ n sin


theorem coe_addEquiv_lpBCF_symm (f : α →ᵇ E) : (AddEquiv.lpBCF.symm f : α → E) = f

{α : Type u_1}
{E : Type u_2}
[TopologicalSpace α]
[DiscreteTopology α]
[NormedAddCommGroup E]
(f : BoundedContinuousFunction α E)


@[simp]
theorem Equiv.Perm.viaFintypeEmbedding_sign [DecidableEq α] [Fintype β] :
    Equiv.Perm.sign (e.viaFintypeEmbedding f) = Equiv.Perm.sign e

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[DecidableEq β]
(e : Equiv.Perm α)
(f : α ↪ β)
[DecidableEq α]
[Fintype β]


/-- Combine two equivalences using `PProd` in the codomain and `Prod` in the domain. -/
@[simps! apply symm_apply]
def prodPProd (ea : α₁ ≃ α₂) (eb : β₁ ≃ β₂) :
    α₁ × β₁ ≃ PProd α₂ β₂

{α₁ : Type u_1}
{α₂ : Sort u_2}
{β₁ : Type u_3}
{β₂ : Sort u_4}
(ea : α₁ ≃ α₂)
(eb : β₁ ≃ β₂)

∀ (a : α₁ × β₁), (ea.prodPProd eb) a = (ea.symm.pprodCongr eb.symm).symm ⟨a.1, a.2⟩


theorem extendScalars_le_extendScalars_iff : extendScalars h ≤ extendScalars h' ↔ E ≤ E'

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

IntermediateField.extendScalars h ≤ IntermediateField.extendScalars h' ↔ E ≤ E'


theorem eq_toGHSpace {p : NonemptyCompacts ℓ_infty_ℝ} : ⟦p⟧ = toGHSpace p

{p : TopologicalSpace.NonemptyCompacts ↥(lp (fun n => ℝ) ⊤)}


/--
`M.comap f` pulls back the alphabet of `M` along `f`. In other words, it applies `f` to the input
before passing it to `M`.
-/
@[simps]
def comap (f : α' → α) (M : DFA α σ) : DFA α' σ

{α : Type u}
{σ : Type v}
{α' : Type u_1}
(f : α' → α)
(M : DFA α σ)


lemma filter_comm (q) (l : List α) : filter p (filter q l) = filter q (filter p l)

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

List.filter p (List.filter q l) = List.filter q (List.filter p l)


theorem mem_find_iff {p : Fin n → Prop} [DecidablePred p] {i : Fin n} :
    i ∈ Fin.find p ↔ p i ∧ ∀ j, p j → i ≤ j

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

i ∈ Fin.find p ↔ p i ∧ ∀ (j : Fin n), p j → i ≤ j


lemma prod_rotate_eq_one_of_prod_eq_one :
    ∀ {l : List G} (_ : l.prod = 1) (n : ℕ), (l.rotate n).prod = 1

l.prod = 1 → ∀ (n : ℕ), (l.rotate n).prod = 1


theorem zpowersQuotientStabilizerEquiv_symm_apply (n : ZMod (minimalPeriod (a • ·) b)) :
    (zpowersQuotientStabilizerEquiv a b).symm n = (⟨a, mem_zpowers a⟩ : zpowers a) ^ (cast n : ℤ)

(n : ZMod (Function.minimalPeriod (fun x => a • x) b))

(MulAction.zpowersQuotientStabilizerEquiv a b).symm n = ↑⟨a, ⋯⟩ ^ n.cast


theorem isClosed_set_pi {i : Set ι} {s : ∀ a, Set (π a)} (hs : ∀ a ∈ i, IsClosed (s a)) :
    IsClosed (pi i s)

{ι : Type u_5}
{π : ι → Type u_6}
[T : (i : ι) → TopologicalSpace (π i)]
{i : Set ι}
{s : (a : ι) → Set (π a)}
(hs : ∀ a ∈ i, IsClosed (s a))


/-- Given `c = lineMap a b r`, `a < c < b`, the point `(c, f c)` is strictly below the
segment `[(a, f a), (b, f b)]` if and only if `slope f a c < slope f c b`. -/
theorem map_lt_lineMap_iff_slope_lt_slope (hab : a < b) (h₀ : 0 < r) (h₁ : r < 1) :
    f c < lineMap (f a) (f b) r ↔ slope f a c < slope f c b

{k : Type u_1}
{E : Type u_2}
[LinearOrderedField k]
[OrderedAddCommGroup E]
[Module k E]
[OrderedSMul k E]
{f : k → E}
{a b r : k}
(hab : a < b)
(h₀ : 0 < r)
(h₁ : r < 1)

f ((AffineMap.lineMap a b) r) < (AffineMap.lineMap (f a) (f b)) r ↔
  slope f a ((AffineMap.lineMap a b) r) < slope f ((AffineMap.lineMap a b) r) b


theorem liftOfDerivationToSquareZero_mk_apply (d : Derivation R A I) (x : A) :
    Ideal.Quotient.mk I (liftOfDerivationToSquareZero I hI d x) = algebraMap A (B ⧸ I) x

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[CommSemiring A]
[CommRing B]
[Algebra R A]
[Algebra R B]
(I : Ideal B)
(hI : I ^ 2 = ⊥)
[Algebra A B]
[IsScalarTower R A B]
(d : Derivation R A ↥I)
(x : A)

(Ideal.Quotient.mk I) ((liftOfDerivationToSquareZero I hI d) x) = (algebraMap A (B ⧸ I)) x


/-- The short complex in `D` obtained by applying a functor `F : C ⥤ D` to a
short complex in `C`, assuming that `F` preserves zero morphisms. -/
@[simps]
def map (F : C ⥤ D) [F.PreservesZeroMorphisms] : ShortComplex D


theorem mem_preimage (x : α) (s : Set β) : x ∈ r.preimage s ↔ ∃ y ∈ s, r x y

{α : Type u_1}
{β : Type u_2}
(r : Rel α β)
(x : α)
(s : Set β)


/-- This is basically just `yoneda : Over A ⥤ (Over A)ᵒᵖ ⥤ Type (max u v)` restricted in the second
    argument along the forgetful functor `CostructuredArrow yoneda A ⥤ Over A`, but done in a way
    that we land in a smaller universe.

    This is one direction of the equivalence we're constructing. -/
@[simps]
def restrictedYoneda (A : Cᵒᵖ ⥤ Type v) : Over A ⥤ (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v

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

∀ {X Y : CategoryTheory.Over A} (ε : X ⟶ Y),
  (CategoryTheory.OverPresheafAux.restrictedYoneda A).map ε =
    CategoryTheory.OverPresheafAux.restrictedYonedaObjMap₁ ε.left ⋯


/-- The `lTensor`-variant of `iff_rTensor_injective'`. . -/
theorem iff_lTensor_injective' :
    Module.Flat R M ↔ ∀ (I : Ideal R), Function.Injective (lTensor M I.subtype)

(R : Type u)
(M : Type v)
[CommRing R]
[AddCommGroup M]
[Module R M]

Module.Flat R M ↔ ∀ (I : Ideal R), Function.Injective ⇑(LinearMap.lTensor M (Submodule.subtype I))


/-- If `f` is eventually differentiable along a nontrivial filter `l : Filter ℝ` that is generated
by convex sets, the norm of `f` tends to infinity along `l`, and `f' = O(g)` along `l`, where `f'`
is the derivative of `f`, then `g` is not integrable on any set `k` belonging to `l`.
Auxiliary version assuming that `E` is complete. -/
theorem not_integrableOn_of_tendsto_norm_atTop_of_deriv_isBigO_filter_aux
    [CompleteSpace E] {f : ℝ → E} {g : ℝ → F}
    {k : Set ℝ} (l : Filter ℝ) [NeBot l] [TendstoIxxClass Icc l l]
    (hl : k ∈ l) (hd : ∀ᶠ x in l, DifferentiableAt ℝ f x) (hf : Tendsto (fun x => ‖f x‖) l atTop)
    (hfg : deriv f =O[l] g) : ¬IntegrableOn g k

(hd : ∀ᶠ (x : ℝ) in l, DifferentiableAt ℝ f x)

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

¬MeasureTheory.IntegrableOn g k MeasureTheory.volume


@[simp]
theorem eval_basis_of_ne (hij : i ≠ j) (hj : j ∈ s) : (Lagrange.basis s v i).eval (v j) = 0

{F : Type u_1}
[Field F]
{ι : Type u_2}
[DecidableEq ι]
{s : Finset ι}
{v : ι → F}
{i j : ι}
(hij : i ≠ j)
(hj : j ∈ s)

Polynomial.eval (v j) (Lagrange.basis s v i) = 0


theorem strictMono_mersenne : StrictMono mersenne


theorem pi_eq_generateFrom :
    Pi.topologicalSpace =
      generateFrom
        { g | ∃ (s : ∀ a, Set (π a)) (i : Finset ι), (∀ a ∈ i, IsOpen (s a)) ∧ g = pi (↑i) s }

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

Pi.topologicalSpace = TopologicalSpace.generateFrom {g | ∃ s i, (∀ a ∈ i, IsOpen (s a)) ∧ g = (↑i).pi s}


/-- `e.symm` is a left inverse of `e`, written as `e.symm (e y) = y`. -/
@[to_additive (attr := simp) "`e.symm` is a left inverse of `e`, written as `e.symm (e y) = y`."]
theorem symm_apply_apply (e : M ≃* N) (x : M) : e.symm (e x) = x

{M : Type u_6}
{N : Type u_7}
[Mul M]
[Mul N]
(e : M ≃* N)
(x : M)


@[reassoc (attr := simp)]
lemma map_appLE (e : V ≤ f ⁻¹ᵁ U) (i : op U' ⟶ op U) :
    Y.presheaf.map i ≫ f.appLE U V e =
      f.appLE U' V (e.trans ((Opens.map f.1.base).map i.unop).le)

(e : V ≤ (TopologicalSpace.Opens.map f.val.base).obj U)

Y.presheaf.map i ≫ f.appLE U V e = f.appLE U' V ⋯


/-- `Equiv.curry` for n-ary functions. -/
@[simps!]
def curryEquiv (n : ℕ) : ((Fin n → α) → β) ≃ OfArity α β n

{α β : Type u}
(n : ℕ)
(f : Function.FromTypes (fun a => α) β)

∀ (a : Fin n → α), (Function.OfArity.curryEquiv n).symm f a = f.uncurry a


/-- The canonical isomorphism `K.cycles i ≅ K.X i` when the differential from `i` is zero. -/
@[simps! hom]
noncomputable def iCyclesIso : K.cycles i ≅ K.X i

(K.iCyclesIso i j hj h).hom = K.iCycles i


/-- There are no perfect squares strictly between m² and (m+1)² -/
lemma not_exists_sq (hl : m * m < n) (hr : n < (m + 1) * (m + 1)) : ¬∃ t, t * t = n


theorem tsub_lt_tsub_right_of_le (h : c ≤ a) (h2 : a < b) : a - c < b - c

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

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


@[simp]
theorem two_zsmul_coe_div_two (θ : ℝ) : (2 : ℤ) • (↑(θ / 2) : Angle) = θ


@[to_additive]
theorem continuous_comp_left (f : ContinuousMonoidHom A B) :
    Continuous fun g : ContinuousMonoidHom B C => g.comp f

{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[Monoid A]
[Monoid B]
[Monoid C]
[TopologicalSpace A]
[TopologicalSpace B]
[TopologicalSpace C]
(f : ContinuousMonoidHom A B)


/-- (internal implementation) the colimit cocone of a functor,
implemented as a quotient of a sigma type
-/
@[simps]
def colimitCocone (F : J ⥤ TypeMax.{v, u}) : Cocone F

{J : Type v}
[CategoryTheory.Category.{w, v} J]
(F : J ⥤ TypeMax)
(j : J)
(x : F.obj j)

(CategoryTheory.Limits.Types.TypeMax.colimitCocone F).ι.app j x =
  Quot.mk (CategoryTheory.Limits.Types.Quot.Rel F) ⟨j, x⟩


/-- If F and G are naturally isomorphic functors, establish an equivalence of hom-sets. -/
@[simps]
def equivHomsetLeftOfNatIso {F F' : C ⥤ D} (iso : F ≅ F') {X : C} {Y : D} :
    (F.obj X ⟶ Y) ≃ (F'.obj X ⟶ Y)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F F' : CategoryTheory.Functor C D}
(iso : F ≅ F')
{X : C}
{Y : D}
(f : F.obj X ⟶ Y)

(CategoryTheory.Adjunction.equivHomsetLeftOfNatIso iso) f = CategoryTheory.CategoryStruct.comp (iso.inv.app X) f


theorem continuous_insertNth {n : ℕ} : Continuous fun p : α × List α => insertNth n p.1 p.2

{α : Type u_1}
[TopologicalSpace α]
{n : ℕ}

Continuous fun p => List.insertNth n p.1 p.2


@[simp, mfld_simps]
theorem mem_localTriv_source (p : Z.TotalSpace) :
    p ∈ (Z.localTriv i).source ↔ p.1 ∈ (Z.localTriv i).baseSet

{ι : Type u_1}
{B : Type u_2}
{F : Type u_3}
[TopologicalSpace B]
[TopologicalSpace F]
(Z : FiberBundleCore ι B F)
(i : ι)
(p : Z.TotalSpace)

p ∈ (Z.localTriv i).source ↔ p.proj ∈ (Z.localTriv i).baseSet


@[simp]
theorem foldr_ι (f : M →ₗ[R] N →ₗ[R] N) (hf) (n : N) (m : M) : foldr Q f hf n (ι Q m) = f m n

((CliffordAlgebra.foldr Q f hf) n) ((CliffordAlgebra.ι Q) m) = (f m) n


theorem subset_iUnion (h : J ∈ π) : ↑J ⊆ π.iUnion

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
(π : BoxIntegral.Prepartition I)
(h : J ∈ π)


theorem update_preimage_pi [DecidableEq ι] {f : ∀ i, α i} (hi : i ∈ s)
    (hf : ∀ j ∈ s, j ≠ i → f j ∈ t j) : update f i ⁻¹' s.pi t = t i

{ι : Type u_1}
{α : ι → Type u_2}
{s : Set ι}
{t : (i : ι) → Set (α i)}
{i : ι}
[DecidableEq ι]
{f : (i : ι) → α i}
(hi : i ∈ s)
(hf : ∀ j ∈ s, j ≠ i → f j ∈ t j)


@[to_additive (attr := simp)]
theorem principal_one : 𝓟 1 = (1 : Filter α)


/-- A map `f : X → Y` is proper if and only if it is continuous and the map
`(Prod.map f id : X × Ultrafilter X → Y × Ultrafilter X)` is closed. This is stronger than
`isProperMap_iff_universally_closed` since it shows that there's only one space to check to get
properness, but in most cases it doesn't matter. -/
theorem isProperMap_iff_isClosedMap_ultrafilter {X : Type u} {Y : Type v} [TopologicalSpace X]
    [TopologicalSpace Y] {f : X → Y} :
    IsProperMap f ↔ Continuous f ∧ IsClosedMap
      (Prod.map f id : X × Ultrafilter X → Y × Ultrafilter X)

IsProperMap f ↔ Continuous f ∧ IsClosedMap (Prod.map f id)


/--
If `g` and `h` commute, then `g` fixes `(h ^ j) • x` iff `g` fixes `x`.
-/
@[to_additive "If `g` and `h` commute, then `g` fixes `(j • h) +ᵥ x` iff `g` fixes `x`."]
theorem smul_zpow_fixedBy_eq_of_commute {g h : G} (comm : Commute g h) (j : ℤ) :
    h ^ j • fixedBy α g = fixedBy α g

{α : Type u_1}
{G : Type u_2}
[AddGroup G]
[AddAction G α]
{g h : G}
(comm : AddCommute g h)
(j : ℤ)

j • h +ᵥ AddAction.fixedBy α g = AddAction.fixedBy α g


@[nolint unusedHavesSuffices] -- It claims the `have : IsLocalization` line is unnecessary,
                              -- but remove it and the proof won't work.
theorem isIntegral_localization' {R S : Type*} [CommRing R] [CommRing S] {f : R →+* S}
    (hf : f.IsIntegral) (M : Submonoid R) :
    (map (Localization (M.map (f : R →* S))) f
          (M.le_comap_map : _ ≤ Submonoid.comap (f : R →* S) _) :
        Localization M →+* _).IsIntegral

{R : Type u_6}
{S : Type u_7}
[CommRing R]
[CommRing S]
{f : R →+* S}
(hf : f.IsIntegral)
(M : Submonoid R)

(IsLocalization.map (Localization (Submonoid.map (↑f) M)) f ⋯).IsIntegral


lemma nodup_keys {m : Multiset (Σ a, β a)} : m.keys.Nodup ↔ m.NodupKeys

{α : Type u}
{β : α → Type v}
{m : Multiset ((a : α) × β a)}


theorem one_braiding {X Y : Mon_ C} : (X ⊗ Y).one ≫ (β_ X.X Y.X).hom = (Y ⊗ X).one

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


@[simp]
theorem filter_smul [Monoid γ] [∀ i, AddMonoid (β i)] [∀ i, DistribMulAction γ (β i)] (p : ι → Prop)
    [DecidablePred p] (r : γ) (f : Π₀ i, β i) : (r • f).filter p = r • f.filter p

{ι : Type u}
{γ : Type w}
{β : ι → Type v}
[Monoid γ]
[(i : ι) → AddMonoid (β i)]
[(i : ι) → DistribMulAction γ (β i)]
(p : ι → Prop)
[DecidablePred p]
(r : γ)
(f : Π₀ (i : ι), β i)

DFinsupp.filter p (r • f) = r • DFinsupp.filter p f


theorem apply_eq_prod_continuousLinearEquivAt (e : Trivialization F (π F E)) [e.IsLinear R] (b : B)
    (hb : b ∈ e.baseSet) (z : E b) : e ⟨b, z⟩ = (b, e.continuousLinearEquivAt R b hb z)

[TopologicalSpace (Bundle.TotalSpace F E)]

(e : Trivialization F Bundle.TotalSpace.proj)

↑e { proj := b, snd := z } = (b, (Trivialization.continuousLinearEquivAt R e b hb) z)


@[to_additive (attr := simp)]
theorem csInf_one : sInf (1 : Set α) = 1

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


/-- Lemma 2.4 in [Gleason, *Projective topological spaces*][gleason1958]:
a continuous surjection $\pi$ from a compact space $D$ to a Fréchet space $A$ restricts to
a compact subset $E$ of $D$, such that $\pi$ maps $E$ onto $A$ and satisfies the
"Zorn subset condition", where $\pi(E_0) \ne A$ for any proper closed subset $E_0 \subsetneq E$. -/
lemma exists_compact_surjective_zorn_subset [T1Space A] [CompactSpace D] {π : D → A}
    (π_cont : Continuous π) (π_surj : π.Surjective) : ∃ E : Set D, CompactSpace E ∧ π '' E = univ ∧
    ∀ E₀ : Set E, E₀ ≠ univ → IsClosed E₀ → E.restrict π '' E₀ ≠ univ

{A D : Type u}
[TopologicalSpace A]
[TopologicalSpace D]
[T1Space A]
[CompactSpace D]
{π : D → A}
(π_cont : Continuous π)
(π_surj : Function.Surjective π)

∃ E, CompactSpace ↑E ∧ π '' E = Set.univ ∧ ∀ (E₀ : Set ↑E), E₀ ≠ Set.univ → IsClosed E₀ → E.restrict π '' E₀ ≠ Set.univ


theorem leadingCoeff_ne_zero : leadingCoeff p ≠ 0 ↔ p ≠ 0


theorem sup_apply {f g : E →ₗ.[R] F} (H : ∀ (x : f.domain) (y : g.domain), (x : E) = y → f x = g y)
    (x : f.domain) (y : g.domain) (z : ↥(f.domain ⊔ g.domain)) (hz : (↑x : E) + ↑y = ↑z) :
    f.sup g H z = f x + g y

(H : ∀ (x : ↥f.domain) (y : ↥g.domain), ↑x = ↑y → ↑f x = ↑g y)


theorem Algebra.norm_complex_apply (z : ℂ) : Algebra.norm ℝ z = Complex.normSq z


@[to_additive lipschitzWith_one_norm]
theorem lipschitzWith_one_norm' : LipschitzWith 1 (norm : E → ℝ)


@[to_additive (attr := simp, norm_cast)]
theorem coe_zero : ⇑(0 : GroupSeminorm E) = 0


@[simp]
theorem toQuadraticMap_smul [Monoid S] [DistribMulAction S N] [SMulCommClass S R N]
    [SMulCommClass R S N] (a : S)
    (B : BilinMap R M N) : (a • B).toQuadraticMap = a • B.toQuadraticMap

{S : Type u_1}
{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
[Monoid S]
[DistribMulAction S N]
[SMulCommClass S R N]
[SMulCommClass R S N]
(a : S)
(B : LinearMap.BilinMap R M N)


theorem geom_sum_mul_neg [Ring α] (x : α) (n : ℕ) :
    (∑ i ∈ range n, x ^ i) * (1 - x) = 1 - x ^ n

(∑ i ∈ Finset.range n, x ^ i) * (1 - x) = 1 - x ^ n


/-- The equivalence `Karoubi (ChainComplex C α) ≌ ChainComplex (Karoubi C) α`. -/
@[simps!]
def karoubiChainComplexEquivalence : Karoubi (ChainComplex C α) ≌ ChainComplex (Karoubi C) α

(K : HomologicalComplex (CategoryTheory.Idempotents.Karoubi C) (ComplexShape.down α))

((CategoryTheory.Idempotents.karoubiChainComplexEquivalence C α).inverse.obj K).p.f n = (K.X n).p


@[simp]
theorem mk_l_hom {X : F C} : ⟦Hom.l_hom X⟧ = (λ_ X).hom

{X : CategoryTheory.FreeMonoidalCategory C}

⟦CategoryTheory.FreeMonoidalCategory.Hom.l_hom X⟧ = (CategoryTheory.MonoidalCategory.leftUnitor X).hom


private lemma aux [h : Nontrivial (shiftedWeightSpace R L M χ)] : weightSpace M χ ≠ ⊥

[h : Nontrivial ↥↑(LieModule.shiftedWeightSpace R L M χ)]


theorem pointwise_smul_le_iff₀ {a : α} (ha : a ≠ 0) {S T : AddSubmonoid A} :
    a • S ≤ T ↔ S ≤ a⁻¹ • T

{α : Type u_1}
{A : Type u_5}
[AddMonoid A]
[GroupWithZero α]
[DistribMulAction α A]
{a : α}
(ha : a ≠ 0)
{S T : AddSubmonoid A}

a • S ≤ T ↔ S ≤ a⁻¹ • T


/-- A supporting lemma for the **Phragmen-Lindelöf principle** in a horizontal strip. If `z : ℂ`
belongs to a horizontal strip `|Complex.im z| ≤ b`, `b ≤ π / 2`, and `a ≤ 0`, then
$$\left|exp^{a\left(e^{z}+e^{-z}\right)}\right| \le e^{a\cos b \exp^{|re z|}}.$$
-/
theorem abs_exp_mul_exp_add_exp_neg_le_of_abs_im_le {a b : ℝ} (ha : a ≤ 0) {z : ℂ} (hz : |z.im| ≤ b)
    (hb : b ≤ π / 2) :
    abs (exp (a * (exp z + exp (-z)))) ≤ Real.exp (a * Real.cos b * Real.exp |z.re|)

{a b : ℝ}
(ha : a ≤ 0)
{z : ℂ}
(hz : |z.im| ≤ b)
(hb : b ≤ Real.pi / 2)

Complex.abs (Complex.exp (↑a * (Complex.exp z + Complex.exp (-z)))) ≤ Real.exp (a * Real.cos b * Real.exp |z.re|)


@[to_additive]
theorem mulIndicator_congr (h : EqOn f g s) : mulIndicator s f = mulIndicator s g

{α : Type u_1}
{M : Type u_4}
[One M]
{s : Set α}
{f g : α → M}
(h : Set.EqOn f g s)


/-- If `f : ℝ → ℝ` is strictly positive everywhere, and integrable on `(a, b]` for real numbers
`a < b`, then its integral over `a..b` is strictly positive. (See `intervalIntegral_pos_of_pos_on`
for a version only assuming positivity of `f` on `(a, b)` rather than everywhere.) -/
theorem intervalIntegral_pos_of_pos {f : ℝ → ℝ} {a b : ℝ}
    (hfi : IntervalIntegrable f MeasureSpace.volume a b) (hpos : ∀ x, 0 < f x) (hab : a < b) :
    0 < ∫ x in a..b, f x

(hfi : IntervalIntegrable f MeasureTheory.volume a b)


theorem smul_Icc : r • Icc a b = Icc (r • a) (r • b)

{K : Type u_2}
[LinearOrderedField K]
{a b r : K}
(hr : 0 < r)

r • Set.Icc a b = Set.Icc (r • a) (r • b)


/-- A conditionally complete linear order with `Bot` is a linear order with least element, in which
every nonempty subset which is bounded above has a supremum, and every nonempty subset (necessarily
bounded below) has an infimum.  A typical example is the natural numbers.

To differentiate the statements from the corresponding statements in (unconditional)
complete linear orders, we prefix `sInf` and `sSup` by a c everywhere. The same statements should
hold in both worlds, sometimes with additional assumptions of nonemptiness or
boundedness. -/
class ConditionallyCompleteLinearOrderBot (α : Type*) extends ConditionallyCompleteLinearOrder α,
  Bot α where
  /-- `⊥` is the least element -/
  bot_le : ∀ x : α, ⊥ ≤ x
  /-- The supremum of the empty set is `⊥` -/
  csSup_empty : sSup ∅ = ⊥

[self : ConditionallyCompleteLinearOrderBot α]


/-- `f` is continuously differentiable at each point outside of its `mulTSupport`. -/
@[to_additive contMDiffAt_of_not_mem]
theorem contMDiffAt_of_not_mem_mulTSupport {f : M → M'} [One M'] {x : M}
    (hx : x ∉ mulTSupport f) (n : ℕ∞) : ContMDiffAt I I' n f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
[Zero M']
{x : M}
(hx : x ∉ tsupport f)
(n : ℕ∞)


@[simp]
theorem equivIsoColimit_apply {r t : Cocone F} (i : r ≅ t) (P : IsColimit r) :
    equivIsoColimit i P = P.ofIsoColimit i

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
{r t : CategoryTheory.Limits.Cocone F}
(i : r ≅ t)
(P : CategoryTheory.Limits.IsColimit r)

(CategoryTheory.Limits.IsColimit.equivIsoColimit i) P = P.ofIsoColimit i


lemma densityToFinite_ae_lt_top (μ : Measure α) [SigmaFinite μ] :
    ∀ᵐ x ∂μ, μ.densityToFinite x < ∞

{α : Type u_1}
{mα : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite μ]


@[simp, mfld_simps]
theorem localTriv_apply (p : Z.TotalSpace) :
    (Z.localTriv i) p = ⟨p.1, Z.coordChange (Z.indexAt p.1) i p.1 p.2⟩

{ι : Type u_1}
{B : Type u_2}
{F : Type u_3}
[TopologicalSpace B]
[TopologicalSpace F]
(Z : FiberBundleCore ι B F)
(i : ι)
(p : Z.TotalSpace)

↑(Z.localTriv i) p = (p.proj, Z.coordChange (Z.indexAt p.proj) i p.proj p.snd)


/-- The tensor of a family of linear maps from `Eᵢ` to `E'ᵢ`, as a continuous multilinear map of
the family.
-/
@[simps!]
noncomputable def mapLMultilinear : ContinuousMultilinearMap 𝕜 (fun (i : ι) ↦ E i →L[𝕜] E' i)
    ((⨂[𝕜] i, E i) →L[𝕜] ⨂[𝕜] i, E' i)

[(i : ι) → SeminormedAddCommGroup (E i)]

[(i : ι) → SeminormedAddCommGroup (E' i)]

∀ (a : ⨂[𝕜] (i : ι), E i),
  ((PiTensorProduct.mapLMultilinear 𝕜 E E') f) a =
    (PiTensorProduct.liftAux ((PiTensorProduct.tprodL 𝕜).compContinuousLinearMap f).toMultilinearMap) a


@[to_additive (attr := simp)]
theorem closure_empty : closure (∅ : Set M) = ⊥


/-- A weighted sum of pairwise subtractions, where the point on the left is constant and the
sum of the weights is 1. -/
theorem sum_smul_const_vsub_eq_vsub_affineCombination (w : ι → k) (p₂ : ι → P) (p₁ : P)
    (h : ∑ i ∈ s, w i = 1) : (∑ i ∈ s, w i • (p₁ -ᵥ p₂ i)) = p₁ -ᵥ s.affineCombination k p₂ w

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

∑ i ∈ s, w i • (p₁ -ᵥ p₂ i) = p₁ -ᵥ (Finset.affineCombination k s p₂) w


@[simp]
theorem symm_comp_self_toEmbedding (f : M ≃[L] N) :
    f.symm.toEmbedding.comp f.toEmbedding = Embedding.refl L M

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
(f : L.Equiv M N)

f.symm.toEmbedding.comp f.toEmbedding = FirstOrder.Language.Embedding.refl L M


@[simp, reassoc]
theorem comp_left {X Y Z : Arrow T} (f : X ⟶ Y) (g : Y ⟶ Z) :
    (f ≫ g).left = f.left ≫ g.left

{T : Type u}
[CategoryTheory.Category.{v, u} T]
{X Y Z : CategoryTheory.Arrow T}
(f : X ⟶ Y)
(g : Y ⟶ Z)

(CategoryTheory.CategoryStruct.comp f g).left = CategoryTheory.CategoryStruct.comp f.left g.left


theorem HasBasis.subsingleton_iff {ι : Sort*} {p : ι → Prop} {s : ι → Set α} (h : l.HasBasis p s) :
    l.Subsingleton ↔ ∃ i, p i ∧ (s i).Subsingleton

{α : Type u_1}
{l : Filter α}
{ι : Sort u_3}
{p : ι → Prop}
{s : ι → Set α}
(h : l.HasBasis p s)


/-- A generalization of `Basis.toMatrix_self`, in the opposite direction. -/
@[simp]
theorem Basis.toMatrix_mul_toMatrix {ι'' : Type*} [Fintype ι'] (b'' : ι'' → M) :
    b.toMatrix b' * b'.toMatrix b'' = b.toMatrix b''

{ι : Type u_1}
{ι' : Type u_2}
{R : Type u_5}
{M : Type u_6}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)
(b' : Basis ι' R M)
{ι'' : Type u_10}
[Fintype ι']
(b'' : ι'' → M)

b.toMatrix ⇑b' * b'.toMatrix b'' = b.toMatrix b''


lemma measure_univ_unique (hμ : IsProjectiveLimit μ P) (hν : IsProjectiveLimit ν P) :
    μ univ = ν univ

{P : (J : Finset ι) → MeasureTheory.Measure ((j : { x // x ∈ J }) → α ↑j)}

{μ ν : MeasureTheory.Measure ((i : ι) → α i)}

(hμ : MeasureTheory.IsProjectiveLimit μ P)

(hν : MeasureTheory.IsProjectiveLimit ν P)


/--
If `G : C ⥤ D` exhibits `(C, J)` as a dense subsite of `(D, K)`,
it induces an equivalence of category of sheaves valued in a category with suitable limits.
-/
@[simps! functor inverse]
noncomputable def sheafEquiv : Sheaf J A ≌ Sheaf K A

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

[∀ (X : Dᵒᵖ), CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.StructuredArrow X G.op) A]

[CategoryTheory.Functor.IsDenseSubsite J K G]

(CategoryTheory.Functor.IsDenseSubsite.sheafEquiv G J K A).functor = G.sheafPushforwardCocontinuous A J K


/-- A Dynkin system is a collection of subsets of a type `α` that contains the empty set,
  is closed under complementation and under countable union of pairwise disjoint sets.
  The disjointness condition is the only difference with `σ`-algebras.

  The main purpose of Dynkin systems is to provide a powerful induction rule for σ-algebras
  generated by a collection of sets which is stable under intersection.

  A Dynkin system is also known as a "λ-system" or a "d-system".
-/
structure DynkinSystem (α : Type*) where
  /-- Predicate saying that a given set is contained in the Dynkin system. -/
  Has : Set α → Prop
  /-- A Dynkin system contains the empty set. -/
  has_empty : Has ∅
  /-- A Dynkin system is closed under complementation. -/
  has_compl : ∀ {a}, Has a → Has aᶜ
  /-- A Dynkin system is closed under countable union of pairwise disjoint sets. Use a more general
  `MeasurableSpace.DynkinSystem.has_iUnion` instead. -/
  has_iUnion_nat : ∀ {f : ℕ → Set α}, Pairwise (Disjoint on f) → (∀ i, Has (f i)) → Has (⋃ i, f i)

{α : Type u_2}
(self : MeasurableSpace.DynkinSystem α)


/-- A morphism between source objects `S ⟶ S'`
contravariantly induces a functor between structured arrows,
`StructuredArrow S' T ⥤ StructuredArrow 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 : S ⟶ S') : StructuredArrow S' T ⥤ StructuredArrow S T

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{S S' : D}
{T : CategoryTheory.Functor C D}
(f : S ⟶ S')

∀ {X Y : CategoryTheory.Comma (CategoryTheory.Functor.fromPUnit S') T} (f_1 : X ⟶ Y),
  ((CategoryTheory.StructuredArrow.map f).map f_1).left = CategoryTheory.CategoryStruct.id X.left


@[to_additive prodMap_def]
theorem prodMap_def : prodMap f g = (f.comp (fst M N)).prod (g.comp (snd M N))

{M : Type u_5}
{N : Type u_6}
[MulOneClass M]
[MulOneClass N]
{M' : Type u_8}
{N' : Type u_9}
[MulOneClass M']
[MulOneClass N']
(f : M →* M')
(g : N →* N')

f.prodMap g = (f.comp (MonoidHom.fst M N)).prod (g.comp (MonoidHom.snd M N))


protected theorem HasLineDerivAt.lineDeriv (h : HasLineDerivAt 𝕜 f f' x v) :
    lineDeriv 𝕜 f x v = f'

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{f : E → F}
{f' : F}
{x v : E}
(h : HasLineDerivAt 𝕜 f f' x v)


@[simp] theorem getD_nil : getD [] n d = d

∀ {α : Type u_1} {d : α}, List.nil.getD n d = d


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

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

StarSubalgebra.map (StarAlgHom.id R A) S = S


@[simp]
theorem limUnder_nhdsWithin_id {x : X} {s : Set X} (h : x ∈ closure s) :
    @limUnder _ _ _ ⟨x⟩ (𝓝[s] x) id = x

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]
{x : X}
{s : Set X}
(h : x ∈ closure s)


@[simp]
theorem vadd_vsub_vadd_cancel_left (v : G) (p₁ p₂ : P) : v +ᵥ p₁ -ᵥ (v +ᵥ p₂) = p₁ -ᵥ p₂

{G : Type u_1}
{P : Type u_2}
[AddCommGroup G]
[AddTorsor G P]
(v : G)
(p₁ p₂ : P)


/-- The norm of the projection is smaller or equal to the norm of the original element. -/
theorem quotient_norm_mk_le' (S : AddSubgroup M) (m : M) : ‖(m : M ⧸ S)‖ ≤ ‖m‖

{M : Type u_1}
[SeminormedAddCommGroup M]
(S : AddSubgroup M)
(m : M)


@[simp]
theorem isTrail_copy {u v u' v'} (p : G.Walk u v) (hu : u = u') (hv : v = v') :
    (p.copy hu hv).IsTrail ↔ p.IsTrail

{V : Type u}
{G : SimpleGraph V}
{u v u' v' : V}
(p : G.Walk u v)
(hu : u = u')
(hv : v = v')


theorem card_eq_sum_ones (s : Finset α) : s.card = ∑ x ∈ s, 1


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

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


theorem tensor_comp {X₁ Y₁ Z₁ X₂ Y₂ Z₂ : ModuleCat R} (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (g₁ : Y₁ ⟶ Z₁)
    (g₂ : Y₂ ⟶ Z₂) : tensorHom (f₁ ≫ g₁) (f₂ ≫ g₂) = tensorHom f₁ f₂ ≫ tensorHom g₁ g₂

{R : Type u}
[CommRing R]
{X₁ Y₁ Z₁ : ModuleCat R}
{X₂ Y₂ Z₂ : ModuleCat R}
(f₁ : X₁ ⟶ Y₁)
(f₂ : X₂ ⟶ Y₂)
(g₁ : Y₁ ⟶ Z₁)
(g₂ : Y₂ ⟶ Z₂)

ModuleCat.MonoidalCategory.tensorHom (f₁ ≫ g₁) (f₂ ≫ g₂) =
  ModuleCat.MonoidalCategory.tensorHom f₁ f₂ ≫ ModuleCat.MonoidalCategory.tensorHom g₁ g₂


@[simp]
theorem norm_transpose (A : Matrix m n α) : ‖Aᵀ‖ = ‖A‖

{m : Type u_3}
{n : Type u_4}
{α : Type u_5}
[Fintype m]
[Fintype n]
[SeminormedAddCommGroup α]
(A : Matrix m n α)


@[simp]
theorem toLeftMovesToPGame_symm_lt {o : Ordinal} (i : o.toPGame.LeftMoves) :
    ↑(toLeftMovesToPGame.symm i) < o

{o : Ordinal.{u_1}}
(i : o.toPGame.LeftMoves)

↑(Ordinal.toLeftMovesToPGame.symm i) < o


theorem mem_baseSet_trivializationAt : b ∈ (trivializationAt F E b).baseSet

[TopologicalSpace (Bundle.TotalSpace F E)]


theorem IsOrderConnected.neg_trans {r : α → α → Prop} [IsOrderConnected α r] {a b c}
    (h₁ : ¬r a b) (h₂ : ¬r b c) : ¬r a c

{α : Type u}
{r : α → α → Prop}
[IsOrderConnected α r]
{a b c : α}
(h₁ : ¬r a b)
(h₂ : ¬r b c)


theorem mul_add_right_left_iff {x y z : R} : IsCoprime (z * y + x) y ↔ IsCoprime x y


@[simp]
theorem Ico_disjoint_Ico_same : Disjoint (Ico a b) (Ico b c)


theorem radius_eq_top_of_summable_norm (p : FormalMultilinearSeries 𝕜 E F)
    (hs : ∀ r : ℝ≥0, Summable fun n => ‖p n‖ * (r : ℝ) ^ n) : p.radius = ∞

(hs : ∀ (r : ℝ≥0), Summable fun n => ‖p n‖ * ↑r ^ n)


/-- If the product of two independent real-valued random variables is integrable and
the second one is not almost everywhere zero, then the first one is integrable. -/
theorem IndepFun.integrable_left_of_integrable_mul {β : Type*} [MeasurableSpace β] {X Y : Ω → β}
    [NormedDivisionRing β] [BorelSpace β] (hXY : IndepFun X Y μ) (h'XY : Integrable (X * Y) μ)
    (hX : AEStronglyMeasurable X μ) (hY : AEStronglyMeasurable Y μ) (h'Y : ¬Y =ᵐ[μ] 0) :
    Integrable X μ

(hXY : ProbabilityTheory.IndepFun X Y μ)

(h'XY : MeasureTheory.Integrable (X * Y) μ)

(hX : MeasureTheory.AEStronglyMeasurable X μ)

(hY : MeasureTheory.AEStronglyMeasurable Y μ)


@[simp]
theorem plusMap_id (P : Cᵒᵖ ⥤ D) : J.plusMap (𝟙 P) = 𝟙 _

(J : CategoryTheory.GrothendieckTopology C)

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

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

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

J.plusMap (CategoryTheory.CategoryStruct.id P) = CategoryTheory.CategoryStruct.id (J.plusObj P)


/-- If `G.op` is adjoint to `F.op` then `F` is adjoint to `G`. -/
-- Porting note: in mathlib3 we generated all the default `simps` lemmas.
-- However the `simpNF` linter correctly flags some of these as unsuitable simp lemmas.
-- `unit_app` and `counit_app` appear to suffice (tested in mathlib3).
-- See also the porting note on opAdjointOpOfAdjoint
@[simps! unit_app counit_app]
def adjointOfOpAdjointOp (F : C ⥤ D) (G : D ⥤ C) (h : G.op ⊣ F.op) : F ⊣ G

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : C ⥤ D)
(G : D ⥤ C)
(h : G.op ⊣ F.op)
(Y : D)

(CategoryTheory.Adjunction.adjointOfOpAdjointOp F G h).counit.app Y =
  (CategoryTheory.opEquiv (Opposite.op Y) (Opposite.op (F.obj (G.obj Y))))
    ((h.homEquiv (Opposite.op Y) (Opposite.op (G.obj Y)))
      ((CategoryTheory.opEquiv (Opposite.op (G.obj Y)) (Opposite.op (G.obj Y))).symm (𝟙 (G.obj Y))))


/-- The set of boxes of a prepartition that contain `x` in their closures has cardinality
at most `2 ^ Fintype.card ι`. -/
theorem card_filter_mem_Icc_le [Fintype ι] (x : ι → ℝ) :
    (π.boxes.filter fun J : Box ι => x ∈ Box.Icc J).card ≤ 2 ^ Fintype.card ι

{ι : Type u_1}
{I : BoxIntegral.Box ι}
(π : BoxIntegral.Prepartition I)
[Fintype ι]
(x : ι → ℝ)

(Finset.filter (fun J => x ∈ BoxIntegral.Box.Icc J) π.boxes).card ≤ 2 ^ Fintype.card ι


/-- The `Kleisli` category of a `Control.Monad` is equivalent to the `Kleisli` category of its
category-theoretic version, provided the monad is lawful.
-/
@[simps]
def eq : KleisliCat m ≌ Kleisli (ofTypeMonad m)

(m : Type u → Type u)
[Monad m]
[LawfulMonad m]

(CategoryTheory.eq m).counitIso = CategoryTheory.NatIso.ofComponents (fun X => CategoryTheory.Iso.refl X) ⋯


/-- The most general lemma stating that `x ↦ fderivWithin 𝕜 (f x) t (g x)` is `C^n`
at a point within a set.
To show that `x ↦ D_yf(x,y)g(x)` (taken within `t`) is `C^m` at `x₀` within `s`, we require that
* `f` is `C^n` at `(x₀, g(x₀))` within `(s ∪ {x₀}) × t` for `n ≥ m+1`.
* `g` is `C^m` at `x₀` within `s`;
* Derivatives are unique at `g(x)` within `t` for `x` sufficiently close to `x₀` within `s ∪ {x₀}`;
* `t` is a neighborhood of `g(x₀)` within `g '' s`; -/
theorem ContDiffWithinAt.fderivWithin'' {f : E → F → G} {g : E → F} {t : Set F} {n : ℕ∞}
    (hf : ContDiffWithinAt 𝕜 n (Function.uncurry f) (insert x₀ s ×ˢ t) (x₀, g x₀))
    (hg : ContDiffWithinAt 𝕜 m g s x₀)
    (ht : ∀ᶠ x in 𝓝[insert x₀ s] x₀, UniqueDiffWithinAt 𝕜 t (g x)) (hmn : m + 1 ≤ n)
    (hgt : t ∈ 𝓝[g '' s] g x₀) :
    ContDiffWithinAt 𝕜 m (fun x => fderivWithin 𝕜 (f x) t (g x)) s x₀

(ht : ∀ᶠ (x : E) in 𝓝[insert x₀ s] x₀, UniqueDiffWithinAt 𝕜 t (g x))


@[simp, norm_cast]
theorem id_coe : ((LinearMap.id : M →ₗ[R] M) : M → M) = _root_.id

{R : Type u_1}
{M : Type u_9}
[Semiring R]
[AddCommMonoid M]
[Module R M]


@[parity_simps] lemma even_pow {n : ℕ} : Even (m ^ n) ↔ Even m ∧ n ≠ 0


@[simp]
theorem coe_add (s t : List α) : (s + t : Multiset α) = (s ++ t : List α)


theorem isNat_intCast {R} [Ring R] (n : ℤ) (m : ℕ) :
    IsNat n m → IsNat (n : R) m

Mathlib.Meta.NormNum.IsNat n m → Mathlib.Meta.NormNum.IsNat (↑n) m


/-- Associate a `PartialEquiv` to an `Equiv`. -/
@[simps! (config := mfld_cfg)]
def _root_.Equiv.toPartialEquiv (e : α ≃ β) : PartialEquiv α β

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


@[to_additive (attr := simp)]
theorem smul_finset_eq_empty : a • s = ∅ ↔ s = ∅

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


theorem ContinuousWithinAt.tendsto_nhdsWithin_image {f : α → β} {x : α} {s : Set α}
    (h : ContinuousWithinAt f s x) : Tendsto f (𝓝[s] x) (𝓝[f '' s] f x)

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

Filter.Tendsto f (𝓝[s] x) (𝓝[f '' s] f x)


/-- The ring isomorphism between the stalk of the structure sheaf of `R` at a point `p`
corresponding to a prime ideal in `R` and the localization of `R` at `p`. -/
@[simps]
def stalkIso (x : PrimeSpectrum.Top R) :
    (structureSheaf R).presheaf.stalk x ≅ CommRingCat.of (Localization.AtPrime x.asIdeal)

(x : ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

(AlgebraicGeometry.StructureSheaf.stalkIso R x).hom = AlgebraicGeometry.StructureSheaf.stalkToFiberRingHom R x


@[simp]
theorem support_nil {u : V} : (nil : G.Walk u u).support = [u]

{V : Type u}
{G : SimpleGraph V}
{u : V}


@[to_additive (attr := simp)]
theorem map_mk_ofList (f : M →* M') (g : N →* N') (l : List (M ⊕ N)) :
    map f g (mk (ofList l)) = mk (ofList (l.map (Sum.map f g)))

{M : Type u_1}
{N : Type u_2}
{M' : Type u_3}
{N' : Type u_4}
[MulOneClass M]
[MulOneClass N]
[MulOneClass M']
[MulOneClass N']
(f : M →* M')
(g : N →* N')
(l : List (M ⊕ N))

(Monoid.Coprod.map f g) (Monoid.Coprod.mk (FreeMonoid.ofList l)) =
  Monoid.Coprod.mk (FreeMonoid.ofList (List.map (Sum.map ⇑f ⇑g) l))


/-- The two numbers `c`, `d` in the "bottom_row" of `g=[[*,*],[c,d]]` in `SL(2, ℤ)` are coprime. -/
theorem bottom_row_coprime {R : Type*} [CommRing R] (g : SL(2, R)) :
    IsCoprime ((↑g : Matrix (Fin 2) (Fin 2) R) 1 0) ((↑g : Matrix (Fin 2) (Fin 2) R) 1 1)

{R : Type u_1}
[CommRing R]
(g : SL(2, R))


@[simps!]
instance : Category (Augmented C)

(X : CategoryTheory.Comma (CategoryTheory.CosimplicialObject.const C) (𝟭 (CategoryTheory.CosimplicialObject C)))

∀ (X_1 : SimplexCategory), (𝟙 X).right.app X_1 = 𝟙 (X.right.obj X_1)


/-- The lifting of a norm nonincreasing morphism is norm nonincreasing. -/
theorem lift_normNoninc (φ : NormedAddGroupHom V₁ V) (h : f.comp φ = g.comp φ) (hφ : φ.NormNoninc) :
    (lift φ h).NormNoninc

{V : Type u_1}
{W : Type u_2}
{V₁ : Type u_3}
[SeminormedAddCommGroup V]
[SeminormedAddCommGroup W]
[SeminormedAddCommGroup V₁]
{f g : NormedAddGroupHom V W}
(φ : NormedAddGroupHom V₁ V)
(h : f.comp φ = g.comp φ)
(hφ : φ.NormNoninc)


theorem id_c (X : PresheafedSpace C) :
    (𝟙 X : X ⟶ X).c = 𝟙 X.presheaf

(X : AlgebraicGeometry.PresheafedSpace C)


theorem Even.zpow_pos_iff (hn : Even n) (h : n ≠ 0) : 0 < a ^ n ↔ a ≠ 0

{α : Type u_1}
[LinearOrderedField α]
{a : α}
{n : ℤ}
(hn : Even n)
(h : n ≠ 0)


protected theorem mul_right_cancel {n m k : Nat} (mp : 0 < m) (h : n * m = k * m) : n = k


@[simp, norm_cast]
lemma coe_withTop (f : LatticeHom α β) : ⇑f.withTop = WithTop.map f

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


@[to_additive]
theorem mul_subset {S : Submonoid M} (hs : s ⊆ S) (ht : t ⊆ S) : s * t ⊆ S

{M : Type u_3}
[Monoid M]
{s t : Set M}
{S : Submonoid M}
(hs : s ⊆ ↑S)
(ht : t ⊆ ↑S)


theorem set_of_mem_cons (l : List α) (a : α) : { x | x ∈ a :: l } = insert a { x | x ∈ l }


theorem neLocus_neg : neLocus (-f) g = f.neLocus (-g)

{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[AddGroup N]
(f g : α →₀ N)


theorem aeSeqSet_measurableSet {hf : ∀ i, AEMeasurable (f i) μ} : MeasurableSet (aeSeqSet hf p)

{ι : Sort u_1}
{α : Type u_2}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{f : ι → α → β}
{μ : MeasureTheory.Measure α}
{p : α → (ι → β) → Prop}
{hf : ∀ (i : ι), AEMeasurable (f i) μ}


lemma add_left {μ₁ μ₂ ν : Measure α} (h₁ : μ₁ ≪ ν) (h₂ : μ₂ ≪ ν) : μ₁ + μ₂ ≪ ν

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ₁ μ₂ ν : MeasureTheory.Measure α}
(h₁ : μ₁.AbsolutelyContinuous ν)
(h₂ : μ₂.AbsolutelyContinuous ν)


/-- Any `CommMagma G` that satisfies `IsRightCancelMul G` also satisfies `IsLeftCancelMul G`. -/
@[to_additive AddCommMagma.IsRightCancelAdd.toIsLeftCancelAdd "Any `AddCommMagma G` that satisfies
`IsRightCancelAdd G` also satisfies `IsLeftCancelAdd G`."]
lemma CommMagma.IsRightCancelMul.toIsLeftCancelMul (G : Type u) [CommMagma G] [IsRightCancelMul G] :
    IsLeftCancelMul G

(G : Type u)
[AddCommMagma G]
[IsRightCancelAdd G]


/-- The `vectorSpan` of the image of a function is the span of the pairwise subtractions with a
given point on the left, excluding the subtraction of that point from itself. -/
theorem vectorSpan_image_eq_span_vsub_set_left_ne (p : ι → P) {s : Set ι} {i : ι} (hi : i ∈ s) :
    vectorSpan k (p '' s) = Submodule.span k ((p i -ᵥ ·) '' (p '' (s \ {i})))

(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}
(p : ι → P)
{s : Set ι}
{i : ι}
(hi : i ∈ s)

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


@[to_additive (attr := simp)]
theorem coe_pureMonoidHom : (pureMonoidHom : α → Filter α) = pure


theorem exists_of_isLeft_right (h₁ : LiftRel r s x y) (h₂ : y.isLeft) :
    ∃ a c, r a c ∧ x = inl a ∧ y = inl c

{α : Type u}
{β : Type v}
{γ : Type u_1}
{δ : Type u_2}
{r : α → γ → Prop}
{s : β → δ → Prop}
{x : α ⊕ β}
{y : γ ⊕ δ}
(h₁ : Sum.LiftRel r s x y)
(h₂ : y.isLeft = true)

∃ a c, r a c ∧ x = Sum.inl a ∧ y = Sum.inl c


@[simp]
theorem _root_.NonUnitalStarSubalgebra.toNonUnitalSubalgebra_toNonUnitalStarSubalgebra
    (S : NonUnitalStarSubalgebra R A) :
    (S.toNonUnitalSubalgebra.toNonUnitalStarSubalgebra fun _ => star_mem (s := S)) = S

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[Star A]
(S : NonUnitalStarSubalgebra R A)


theorem coe_eq_zero_iff {x : 𝕜} : (x : AddCircle p) = 0 ↔ ∃ n : ℤ, n • p = x

{𝕜 : Type u_1}
[LinearOrderedAddCommGroup 𝕜]
(p : 𝕜)
{x : 𝕜}


/-- The oriented angle between two vectors equals minus the unoriented angle if the sign is
negative. -/
theorem oangle_eq_neg_angle_of_sign_eq_neg_one {x y : V} (h : (o.oangle x y).sign = -1) :
    o.oangle x y = -InnerProductGeometry.angle x y

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

o.oangle x y = -↑(InnerProductGeometry.angle x y)


theorem sub_pow_expChar_pow_of_commute [Ring R] {q : ℕ} [hR : ExpChar R q]
    {n : ℕ} (x y : R) (h : Commute x y) : (x - y) ^ q ^ n = x ^ q ^ n - y ^ q ^ n

(R : Type u)
[Ring R]
{q : ℕ}
[hR : ExpChar R q]
{n : ℕ}
(x y : R)
(h : Commute x y)


/-- Express `dist` in terms of `nndist`-/
theorem dist_nndist (x y : α) : dist x y = nndist x y

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


theorem _root_.LinearEquiv.toSpanNonzeroSingleton_homothety (x : E) (h : x ≠ 0) (c : 𝕜) :
    ‖LinearEquiv.toSpanNonzeroSingleton 𝕜 E x h c‖ = ‖x‖ * ‖c‖

(𝕜 : Type u_1)
{E : Type u_2}
[NormedDivisionRing 𝕜]
[SeminormedAddCommGroup E]
[Module 𝕜 E]
[BoundedSMul 𝕜 E]
(x : E)
(h : x ≠ 0)
(c : 𝕜)

‖(LinearEquiv.toSpanNonzeroSingleton 𝕜 E x h) c‖ = ‖x‖ * ‖c‖


@[gcongr] lemma factoredNumbers_mono {s t : Finset ℕ} (hst : s ≤ t) :
    factoredNumbers s ⊆ factoredNumbers t

Nat.factoredNumbers s ⊆ Nat.factoredNumbers t


@[simp]
theorem nodup_reverse {l : List α} : Nodup (reverse l) ↔ Nodup l


/-- Pseudo metric and Metric spaces

A pseudo metric space is endowed with a distance for which the requirement `d(x,y)=0 → x = y` might
not hold. A metric space is a pseudo metric space such that `d(x,y)=0 → x = y`.
Each pseudo metric space induces a canonical `UniformSpace` and hence a canonical
`TopologicalSpace` This is enforced in the type class definition, by extending the `UniformSpace`
structure. When instantiating a `PseudoMetricSpace` structure, the uniformity fields are not
necessary, they will be filled in by default. In the same way, each (pseudo) metric space induces a
(pseudo) emetric space structure. It is included in the structure, but filled in by default.
-/
class PseudoMetricSpace (α : Type u) extends Dist α : Type u where
  dist_self : ∀ x : α, dist x x = 0
  dist_comm : ∀ x y : α, dist x y = dist y x
  dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z
  edist : α → α → ℝ≥0∞ := fun x y => ENNReal.ofNNReal ⟨dist x y, dist_nonneg' _ ‹_› ‹_› ‹_›⟩
  edist_dist : ∀ x y : α, edist x y = ENNReal.ofReal (dist x y) := by
    intros x y; exact ENNReal.coe_nnreal_eq _
  toUniformSpace : UniformSpace α := .ofDist dist dist_self dist_comm dist_triangle
  uniformity_dist : 𝓤 α = ⨅ ε > 0, 𝓟 { p : α × α | dist p.1 p.2 < ε } := by intros; rfl
  toBornology : Bornology α := Bornology.ofDist dist dist_comm dist_triangle
  cobounded_sets : (Bornology.cobounded α).sets =
    { s | ∃ C : ℝ, ∀ x ∈ sᶜ, ∀ y ∈ sᶜ, dist x y ≤ C } := by intros; rfl

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


@[simp]
lemma inr_comp_binaryCoproductIso_inv :
    coprod.inr ≫ (binaryCoproductIso F G).inv = (Limits.coprod.inr (X := F))

(F G : CategoryTheory.Functor C (Type w))

CategoryTheory.CategoryStruct.comp CategoryTheory.FunctorToTypes.coprod.inr
    (CategoryTheory.FunctorToTypes.binaryCoproductIso F G).inv =
  CategoryTheory.Limits.coprod.inr


/-- The top submonoid is isomorphic to the monoid. -/
@[to_additive (attr := simps) "The top additive submonoid is isomorphic to the additive monoid."]
def topEquiv : (⊤ : Submonoid M) ≃* M

{M : Type u_1}
[AddZeroClass M]
(x : ↥⊤)


@[simp]
theorem Ici_prod_Ici (a : α) (b : β) : Ici a ×ˢ Ici b = Ici (a, b)

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


theorem condexpL1CLM_of_aestronglyMeasurable' (f : α →₁[μ] F') (hfm : AEStronglyMeasurable' m f μ) :
    condexpL1CLM F' hm μ f = f

(hfm : MeasureTheory.AEStronglyMeasurable' m (↑↑f) μ)

(MeasureTheory.condexpL1CLM F' hm μ) f = f


theorem comp_algebraMap : (φ : A →+* B).comp (algebraMap R A) = algebraMap R B

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(φ : A →ₐ[R] B)

(↑φ).comp (algebraMap R A) = algebraMap R B


theorem rat_inf_continuous_lemma {ε : α} {a₁ a₂ b₁ b₂ : α} :
    abs (a₁ - b₁) < ε → abs (a₂ - b₂) < ε → abs (a₁ ⊓ a₂ - b₁ ⊓ b₂) < ε

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

|a₁ - b₁| < ε → |a₂ - b₂| < ε → |a₁ ⊓ a₂ - b₁ ⊓ b₂| < ε


theorem nhdsWithin_pi_eq' {I : Set ι} (hI : I.Finite) (s : ∀ i, Set (π i)) (x : ∀ i, π i) :
    𝓝[pi I s] x = ⨅ i, comap (fun x => x i) (𝓝 (x i) ⊓ ⨅ (_ : i ∈ I), 𝓟 (s i))

{ι : Type u_5}
{π : ι → Type u_6}
[(i : ι) → TopologicalSpace (π i)]
{I : Set ι}
(hI : I.Finite)
(s : (i : ι) → Set (π i))
(x : (i : ι) → π i)

𝓝[I.pi s] x = ⨅ i, Filter.comap (fun x => x i) (𝓝 (x i) ⊓ ⨅ (_ : i ∈ I), 𝓟 (s i))


theorem ContDiffOn.rpow (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (h : ∀ x ∈ s, f x ≠ 0) :
    ContDiffOn ℝ n (fun x => f x ^ g x) s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f g : E → ℝ}
{s : Set E}
{n : ℕ∞}
(hf : ContDiffOn ℝ n f s)
(hg : ContDiffOn ℝ n g s)
(h : ∀ x ∈ s, f x ≠ 0)


theorem LinearMap.toMatrix₂_mul (B : M₁ →ₗ[R] M₂ →ₗ[R] R) (M : Matrix m m' R) :
    LinearMap.toMatrix₂ b₁ b₂ B * M =
      LinearMap.toMatrix₂ b₁ b₂' (B.compl₂ (toLin b₂' b₂ M))

{R : Type u_1}
{M₁ : Type u_7}
{M₂ : Type u_8}
{M₂' : Type u_10}
{n : Type u_12}
{m : Type u_13}
{m' : Type u_15}
[CommSemiring R]
[AddCommMonoid M₁]
[Module R M₁]
[AddCommMonoid M₂]
[Module R M₂]
[DecidableEq n]
[Fintype n]
[DecidableEq m]
[Fintype m]
(b₁ : Basis n R M₁)
(b₂ : Basis m R M₂)
[AddCommMonoid M₂']
[Module R M₂']
(b₂' : Basis m' R M₂')
[Fintype m']
[DecidableEq m']
(B : M₁ →ₗ[R] M₂ →ₗ[R] R)
(M : Matrix m m' R)

(LinearMap.toMatrix₂ b₁ b₂) B * M = (LinearMap.toMatrix₂ b₁ b₂') (B.compl₂ ((Matrix.toLin b₂' b₂) M))


theorem Rel.subLeft (a : lib R X) {b c : lib R X} (h : Rel R X b c) : Rel R X (a - b) (a - c)

{R : Type u}
{X : Type v}
[CommRing R]
(a : lib R X)
{b c : lib R X}
(h : FreeLieAlgebra.Rel R X b c)


/-- If the restriction to a set `s` of a σ-algebra `m` is included in the restriction to `s` of
another σ-algebra `m₂` (hypothesis `hs`), the set `s` is `m` measurable and a function `f` supported
on `s` is `m`-strongly-measurable, then `f` is also `m₂`-strongly-measurable. -/
theorem stronglyMeasurable_of_measurableSpace_le_on {α E} {m m₂ : MeasurableSpace α}
    [TopologicalSpace E] [Zero E] {s : Set α} {f : α → E} (hs_m : MeasurableSet[m] s)
    (hs : ∀ t, MeasurableSet[m] (s ∩ t) → MeasurableSet[m₂] (s ∩ t))
    (hf : StronglyMeasurable[m] f) (hf_zero : ∀ x ∉ s, f x = 0) :
    StronglyMeasurable[m₂] f

(hs : ∀ (t : Set α), MeasurableSet (s ∩ t) → MeasurableSet (s ∩ t))

(hf : MeasureTheory.StronglyMeasurable f)


@[simp]
theorem preimage_comap_zeroLocus (s : Set R) : comap f ⁻¹' zeroLocus s = zeroLocus (f '' s)

{R : Type u}
{S : Type v}
[CommSemiring R]
[CommSemiring S]
(f : R →+* S)
(s : Set R)

⇑(PrimeSpectrum.comap f) ⁻¹' PrimeSpectrum.zeroLocus s = PrimeSpectrum.zeroLocus (⇑f '' s)


@[simp]
lemma coeff_Φ (n : ℤ) : (W.Φ n).coeff (n.natAbs ^ 2) = 1

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
(n : ℤ)


theorem seqLeft_eq [Monad m] [LawfulMonad m] (x : StateT σ m α) (y : StateT σ m β) : x <* y = const β <$> x <*> y

{m : Type u_1 → Type u_2}
{σ α β : Type u_1}
[Monad m]
[LawfulMonad m]
(x : StateT σ m α)
(y : StateT σ m β)

(SeqLeft.seqLeft x fun x => y) = Seq.seq (Function.const β <$> x) fun x => y


protected lemma connected_iff {H : G.Subgraph} :
    H.Connected ↔ H.Preconnected ∧ H.verts.Nonempty

{V : Type u}
{G : SimpleGraph V}
{H : G.Subgraph}


@[to_additive]
theorem le_map_mul_map_div [Group α] [CommSemigroup β] [LE β] [SubmultiplicativeHomClass F α β]
    (f : F) (a b : α) : f a ≤ f b * f (a / b)

{F : Type u_2}
{α : Type u_3}
{β : Type u_4}
[FunLike F α β]
[Group α]
[CommSemigroup β]
[LE β]
[SubmultiplicativeHomClass F α β]
(f : F)
(a b : α)


@[to_additive]
theorem map_right_cancel {x y} {c : S} (h : f.toMap (c * x) = f.toMap (c * y)) :
    f.toMap x = f.toMap y

(h : f.toMap (↑c * x) = f.toMap (↑c * y))