/-- The product of weighted homogeneous polynomials of weighted degrees `m` and `n` is weighted
  homogeneous of weighted degree `m + n`. -/
theorem mul {w : σ → M} (hφ : IsWeightedHomogeneous w φ m) (hψ : IsWeightedHomogeneous w ψ n) :
    IsWeightedHomogeneous w (φ * ψ) (m + n)

(hφ : MvPolynomial.IsWeightedHomogeneous w φ m)

(hψ : MvPolynomial.IsWeightedHomogeneous w ψ n)

MvPolynomial.IsWeightedHomogeneous w (φ * ψ) (m + n)


theorem spanSingleton_mul_coeIdeal_eq_coeIdeal {I J : Ideal R₁} {z : K} :
    spanSingleton R₁⁰ z * (I : FractionalIdeal R₁⁰ K) = J ↔
      Ideal.span {((IsLocalization.sec R₁⁰ z).1 : R₁)} * I =
        Ideal.span {((IsLocalization.sec R₁⁰ z).2 : R₁)} * J

{R₁ : Type u_3}
[CommRing R₁]
{K : Type u_4}
[Field K]
[Algebra R₁ K]
[IsFractionRing R₁ K]
{I J : Ideal R₁}
{z : K}

FractionalIdeal.spanSingleton R₁⁰ z * ↑I = ↑J ↔
  Ideal.span {(IsLocalization.sec R₁⁰ z).1} * I = Ideal.span {↑(IsLocalization.sec R₁⁰ z).2} * J


/-- Given an exact short complex `S` and a colimit cokernel cofork `cc` for `S.f`, this is the
right homology data for `S` with `Q := cc.pt` and `H := 0`. -/
@[simps]
noncomputable def Exact.rightHomologyDataOfIsColimitCokernelCofork
    (hS : S.Exact) [HasZeroObject C] (cc : CokernelCofork S.f) (hcc : IsColimit cc) :
    S.RightHomologyData

(cc : CategoryTheory.Limits.CokernelCofork S.f)

(hcc : CategoryTheory.Limits.IsColimit cc)

(hS.rightHomologyDataOfIsColimitCokernelCofork cc hcc).ι = 0


@[simp]
theorem map_map : Filter.map m' (Filter.map m f) = Filter.map (m' ∘ m) f

{α : Type u}
{β : Type v}
{γ : Type w}
{f : Filter α}
{m : α → β}
{m' : β → γ}


theorem exists_eq_X_add_C_of_natDegree_le_one (h : natDegree p ≤ 1) : ∃ a b, p = C a * X + C b

{R : Type u}
[Semiring R]
{p : R[X]}
(h : p.natDegree ≤ 1)

∃ a b, p = Polynomial.C a * Polynomial.X + Polynomial.C b


@[simp]
theorem sInf_univ : sInf univ = (⊥ : α)


@[to_additive (attr := simp)]
lemma insertNth_div_same [∀ j, Group (α j)] (i : Fin (n + 1)) (x y : α i)
    (p : ∀ j, α (i.succAbove j)) : i.insertNth x p / i.insertNth y p = Pi.mulSingle i (x / y)

{n : ℕ}
{α : Fin (n + 1) → Type u_1}
[(j : Fin (n + 1)) → Group (α j)]
(i : Fin (n + 1))
(x y : α i)
(p : (j : Fin n) → α (i.succAbove j))


/--
Reduction to `I` prime ideal: When proving statements about mixed characteristic rings,
after we reduced to `p` prime, we can assume that the ideal `I` in the definition is maximal.
-/
theorem reduce_to_maximal_ideal {p : ℕ} (hp : Nat.Prime p) :
    (∃ I : Ideal R, I ≠ ⊤ ∧ CharP (R ⧸ I) p) ↔ ∃ I : Ideal R, I.IsMaximal ∧ CharP (R ⧸ I) p

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

(∃ I, I ≠ ⊤ ∧ CharP (R ⧸ I) p) ↔ ∃ I, I.IsMaximal ∧ CharP (R ⧸ I) p


/-- **Summation by parts**, also known as **Abel's lemma** or an **Abel transformation** -/
theorem sum_Ico_by_parts (hmn : m < n) :
    ∑ i ∈ Ico m n, f i • g i =
      f (n - 1) • G n - f m • G m - ∑ i ∈ Ico m (n - 1), (f (i + 1) - f i) • G (i + 1)

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(f : ℕ → R)
(g : ℕ → M)
{m n : ℕ}
(hmn : m < n)

∑ i ∈ Finset.Ico m n, f i • g i =
  f (n - 1) • ∑ i ∈ Finset.range n, g i - f m • ∑ i ∈ Finset.range m, g i -
    ∑ i ∈ Finset.Ico m (n - 1), (f (i + 1) - f i) • ∑ i ∈ Finset.range (i + 1), g i


@[to_additive le_addIndex_mul]
theorem le_index_mul (K₀ : PositiveCompacts G) (K : Compacts G) {V : Set G}
    (hV : (interior V).Nonempty) :
    index (K : Set G) V ≤ index (K : Set G) K₀ * index (K₀ : Set G) V

(K₀ : TopologicalSpace.PositiveCompacts G)

MeasureTheory.Measure.haar.addIndex (↑K) V ≤
  MeasureTheory.Measure.haar.addIndex ↑K ↑K₀ * MeasureTheory.Measure.haar.addIndex (↑K₀) V


@[simp]
theorem symm_equivOfInverse (f₁ : M₁ →SL[σ₁₂] M₂) (f₂ h₁ h₂) :
    (equivOfInverse f₁ f₂ h₁ h₂).symm = equivOfInverse f₂ f₁ h₂ h₁

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{σ₂₁ : R₂ →+* R₁}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
(f₁ : M₁ →SL[σ₁₂] M₂)
(f₂ : M₂ →SL[σ₂₁] M₁)
(h₁ : Function.LeftInverse ⇑f₂ ⇑f₁)
(h₂ : Function.RightInverse ⇑f₂ ⇑f₁)

(ContinuousLinearEquiv.equivOfInverse f₁ f₂ h₁ h₂).symm = ContinuousLinearEquiv.equivOfInverse f₂ f₁ h₂ h₁


/-- A strongly cartesian morphism lying over an isomorphism is an isomorphism. -/
lemma isIso_of_base_isIso (φ : a ⟶ b) [IsStronglyCartesian p f φ] [IsIso f] : IsIso φ

{𝒮 : Type u₁}
{𝒳 : Type u₂}
[CategoryTheory.Category.{v₁, u₁} 𝒮]
[CategoryTheory.Category.{v₂, u₂} 𝒳]
(p : 𝒳 ⥤ 𝒮)
{R S : 𝒮}
{a b : 𝒳}
(f : R ⟶ S)
(φ : a ⟶ b)
[p.IsStronglyCartesian f φ]
[CategoryTheory.IsIso f]


/-- Vieta's formula for the coefficients of the product of linear terms `X + λ` where `λ` runs
through a multiset `s` : the `k`th coefficient is the symmetric function `esymm (card s - k) s`. -/
theorem prod_X_add_C_coeff (s : Multiset R) {k : ℕ} (h : k ≤ Multiset.card s) :
    (s.map fun r => X + C r).prod.coeff k = s.esymm (Multiset.card s - k)

{R : Type u_1}
[CommSemiring R]
(s : Multiset R)
{k : ℕ}
(h : k ≤ Multiset.card s)

(Multiset.map (fun r => Polynomial.X + Polynomial.C r) s).prod.coeff k = s.esymm (Multiset.card s - k)


@[to_additive (attr := elab_as_elim)]
theorem induction_on {C : M ∗ N → Prop} (m : M ∗ N)
    (inl : ∀ m, C (inl m)) (inr : ∀ n, C (inr n)) (mul : ∀ x y, C x → C y → C (x * y)) : C m

(inl : ∀ (m : M), C (Monoid.Coprod.inl m))

(inr : ∀ (n : N), C (Monoid.Coprod.inr n))

(mul : ∀ (x y : Monoid.Coprod M N), C x → C y → C (x * y))


@[simp]
theorem fromBlocks_apply₂₂ (A : Matrix n l α) (B : Matrix n m α) (C : Matrix o l α)
    (D : Matrix o m α) (i : o) (j : m) : fromBlocks A B C D (Sum.inr i) (Sum.inr j) = D i j

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
(A : Matrix n l α)
(B : Matrix n m α)
(C : Matrix o l α)
(D : Matrix o m α)
(i : o)
(j : m)

Matrix.fromBlocks A B C D (Sum.inr i) (Sum.inr j) = D i j


theorem element_of_chain_not_isUnit_of_index_ne_zero {n : ℕ} {i : Fin (n + 1)} (i_pos : i ≠ 0)
    {c : Fin (n + 1) → Associates M} (h₁ : StrictMono c) : ¬IsUnit (c i)

{M : Type u_1}
[CancelCommMonoidWithZero M]
{n : ℕ}
{i : Fin (n + 1)}
(i_pos : i ≠ 0)
{c : Fin (n + 1) → Associates M}
(h₁ : StrictMono c)


theorem Context.eval_norm (ctx : Context α) (e : Expr) : evalList α ctx (norm ctx e) = eval α ctx e

{α : Sort u_1}
(ctx : Lean.Data.AC.Context α)
(e : Lean.Data.AC.Expr)

Lean.Data.AC.evalList α ctx (Lean.Data.AC.norm ctx e) = Lean.Data.AC.eval α ctx e


@[simp]
theorem toNatOrdinal_symm_eq : toNatOrdinal.symm = NatOrdinal.toOrdinal


/-- `testBit 1 i` is true iff the index `i` equals 0. -/
theorem testBit_one_eq_true_iff_self_eq_zero {i : Nat} :
    Nat.testBit 1 i = true ↔ i = 0


@[to_additive]
theorem mem_ker (f : G →* M) {x : G} : x ∈ f.ker ↔ f x = 1

{G : Type u_1}
[AddGroup G]
{M : Type u_7}
[AddZeroClass M]
(f : G →+ M)
{x : G}


theorem not_bddBelow_coe : ¬ (BddBelow <| range (fun (x : ℚ) ↦ (x : ℝ)))


theorem det_smul_adjugate_adjugate (A : Matrix n n α) :
    det A • adjugate (adjugate A) = det A ^ (Fintype.card n - 1) • A

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

A.det • A.adjugate.adjugate = A.det ^ (Fintype.card n - 1) • A


@[to_additive]
theorem exists_compact_iff_hasCompactMulSupport [R1Space α] :
    (∃ K : Set α, IsCompact K ∧ ∀ x, x ∉ K → f x = 1) ↔ HasCompactMulSupport f

{α : Type u_2}
{β : Type u_4}
[TopologicalSpace α]
[Zero β]
{f : α → β}
[R1Space α]

(∃ K, IsCompact K ∧ ∀ x ∉ K, f x = 0) ↔ HasCompactSupport f


theorem IsStoppingTime.measurableSet_eq (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[f i] {ω | τ ω = i}

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[LinearOrder ι]
{f : MeasureTheory.Filtration ι m}
{τ : Ω → ι}
[TopologicalSpace ι]
[OrderTopology ι]
[FirstCountableTopology ι]
(hτ : MeasureTheory.IsStoppingTime f τ)
(i : ι)


theorem exists_eq_singleton_iff_nonempty_subsingleton :
    (∃ a : α, s = {a}) ↔ s.Nonempty ∧ s.Subsingleton

(∃ a, s = {a}) ↔ s.Nonempty ∧ s.Subsingleton


@[simp]
theorem toFinset_none : none.toFinset = (∅ : Finset α)


theorem mk'_eq_of_eq' {a₁ b₁ : R} {a₂ b₂ : M} (H : b₁ * ↑a₂ = a₁ * ↑b₂) :
    mk' S a₁ a₂ = mk' S b₁ b₂

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
{a₁ b₁ : R}
{a₂ b₂ : ↥M}
(H : b₁ * ↑a₂ = a₁ * ↑b₂)

IsLocalization.mk' S a₁ a₂ = IsLocalization.mk' S b₁ b₂


/-- For any `n`, we have `log_stirlingSeq 1 - log_stirlingSeq n ≤ 1/4 * ∑' 1/k^2`  -/
theorem log_stirlingSeq_bounded_aux :
    ∃ c : ℝ, ∀ n : ℕ, log (stirlingSeq 1) - log (stirlingSeq (n + 1)) ≤ c

∃ c, ∀ (n : ℕ), Real.log (Stirling.stirlingSeq 1) - Real.log (Stirling.stirlingSeq (n + 1)) ≤ c


@[reassoc]
theorem left_unitality_app (n : M) (X : C) :
    (F.obj n).map (F.ε.app X) ≫ (F.μ (𝟙_ M) n).app X ≫ (F.map (λ_ n).hom).app X = 𝟙 _

(F : CategoryTheory.MonoidalFunctor M (CategoryTheory.Functor C C))

CategoryTheory.CategoryStruct.comp ((F.obj n).map (F.ε.app X))
    (CategoryTheory.CategoryStruct.comp ((F.μ (𝟙_ M) n).app X)
      ((F.map (CategoryTheory.MonoidalCategory.leftUnitor n).hom).app X)) =
  CategoryTheory.CategoryStruct.id ((F.obj n).obj ((𝟙_ (CategoryTheory.Functor C C)).obj X))


lemma quasispectrum.mem_of_not_quasiregular (a : A) {r : Rˣ}
    (hr : ¬ IsQuasiregular (-(r⁻¹ • a))) : (r : R) ∈ quasispectrum R a

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[NonUnitalRing A]
[Module R A]
(a : A)
{r : Rˣ}
(hr : ¬IsQuasiregular (-(r⁻¹ • a)))


/-- Deprecated. Use `DFunLike.ext_iff`. -/
-- @[deprecated] Porting note: using `DFunLike.ext_iff` is not viable below for now
theorem ext_iff {v₁ v₂ : Valuation R Γ₀} : v₁ = v₂ ↔ ∀ r, v₁ r = v₂ r

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedCommMonoidWithZero Γ₀]
{v₁ v₂ : Valuation R Γ₀}


theorem map_pure (f : α → β) (x : α) : (f <$> pure x : Comp F G β) = pure (f x)

{F : Type u → Type w}
{G : Type v → Type u}
[Applicative F]
[Applicative G]
[LawfulApplicative F]
[LawfulApplicative G]
{α β : Type v}
(f : α → β)
(x : α)


theorem norm_integral_eq_norm_integral_Ioc (f : ℝ → E) :
    ‖∫ x in a..b, f x ∂μ‖ = ‖∫ x in Ι a b, f x ∂μ‖

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

‖∫ (x : ℝ) in a..b, f x ∂μ‖ = ‖∫ (x : ℝ) in Ι a b, f x ∂μ‖


theorem encard_diff_singleton_add_one (h : a ∈ s) :
    (s \ {a}).encard + 1 = s.encard

{α : Type u_1}
{s : Set α}
{a : α}
(h : a ∈ s)


theorem StrictAnti.comp_strictMonoOn (hg : StrictAnti g) (hf : StrictMonoOn f s) :
    StrictAntiOn (g ∘ f) s

{α : Type u}
{β : Type v}
{γ : Type w}
[Preorder α]
[Preorder β]
[Preorder γ]
{g : β → γ}
{f : α → β}
{s : Set α}
(hg : StrictAnti g)
(hf : StrictMonoOn f s)


@[to_additive]
theorem IsOfFinOrder.of_mem_zpowers (h : IsOfFinOrder x) (h' : y ∈ Subgroup.zpowers x) :
    IsOfFinOrder y

{G : Type u_1}
[Group G]
{x y : G}
(h : IsOfFinOrder x)
(h' : y ∈ Subgroup.zpowers x)


theorem mem_restrict' : J₁ ∈ π.restrict J ↔ ∃ J' ∈ π, (J₁ : Set (ι → ℝ)) = ↑J ∩ ↑J'

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

J₁ ∈ π.restrict J ↔ ∃ J' ∈ π, ↑J₁ = ↑J ∩ ↑J'


theorem qRight_one_left (θ : I) : qRight (1, θ) = 1


theorem coeFn_abs {β} [TopologicalSpace β] [Lattice β] [TopologicalLattice β] [AddGroup β]
    [TopologicalAddGroup β] (f : α →ₘ[μ] β) : ⇑|f| =ᵐ[μ] fun x => |f x|

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{β : Type u_5}
[TopologicalSpace β]
[Lattice β]
[TopologicalLattice β]
[AddGroup β]
[TopologicalAddGroup β]
(f : α →ₘ[μ] β)


theorem dist_eq (z w : ℂ) : dist z w = abs (z - w)


theorem uniformContinuous_comp (g : C(β, δ)) (hg : UniformContinuous g) :
    UniformContinuous (ContinuousMap.comp g : C(α, β) → C(α, δ))

{α : Type u₁}
{β : Type u₂}
[TopologicalSpace α]
[UniformSpace β]
{δ : Type u_2}
[UniformSpace δ]
(g : C(β, δ))
(hg : UniformContinuous ⇑g)


/-- If `M` and `N` are linearly disjoint, if `N` is a flat `R`-module, then for any family of
`R`-linearly independent elements `{ m_i }` of `M`, they are also `N`-linearly independent,
in the sense that the `R`-linear map from `ι →₀ N` to `S` which maps `{ n_i }`
to the sum of `m_i * n_i` (`Submodule.mulLeftMap N m`) has trivial kernel. -/
theorem linearIndependent_left_of_flat (H : M.LinearDisjoint N) [Module.Flat R N]
    {ι : Type*} {m : ι → M} (hm : LinearIndependent R m) : LinearMap.ker (mulLeftMap N m) = ⊥

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
[Algebra R S]
{M N : Submodule R S}
(H : M.LinearDisjoint N)
[Module.Flat R ↥N]
{ι : Type u_1}
{m : ι → ↥M}
(hm : LinearIndependent R m)

LinearMap.ker (Submodule.mulLeftMap N m) = ⊥


theorem HasDerivAt.clm_comp (hc : HasDerivAt c c' x) (hd : HasDerivAt d d' x) :
    HasDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : 𝕜}
{G : Type u_2}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{c : 𝕜 → F →L[𝕜] G}
{c' : F →L[𝕜] G}
{d : 𝕜 → E →L[𝕜] F}
{d' : E →L[𝕜] F}
(hc : HasDerivAt c c' x)
(hd : HasDerivAt d d' x)


@[simp]
theorem rid_tmul (r : R) (m : M) : AlgebraTensorModule.rid R A M (m ⊗ₜ r) = r • m

{R : Type uR}
(A : Type uA)
{M : Type uM}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
(r : R)
(m : M)

(TensorProduct.AlgebraTensorModule.rid R A M) (m ⊗ₜ[R] r) = r • m


theorem DifferentiableWithinAt.fderivWithin_prod (hf₁ : DifferentiableWithinAt 𝕜 f₁ s x)
    (hf₂ : DifferentiableWithinAt 𝕜 f₂ s x) (hxs : UniqueDiffWithinAt 𝕜 s x) :
    fderivWithin 𝕜 (fun x : E => (f₁ x, f₂ x)) s x =
      (fderivWithin 𝕜 f₁ s x).prod (fderivWithin 𝕜 f₂ s x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f₁ : E → F}
{x : E}
{s : Set E}
{f₂ : E → G}
(hf₁ : DifferentiableWithinAt 𝕜 f₁ s x)
(hf₂ : DifferentiableWithinAt 𝕜 f₂ s x)
(hxs : UniqueDiffWithinAt 𝕜 s x)

fderivWithin 𝕜 (fun x => (f₁ x, f₂ x)) s x = (fderivWithin 𝕜 f₁ s x).prod (fderivWithin 𝕜 f₂ s x)


lemma epi_iff_locallySurjective_on_compHaus : Epi f ↔
    ∀ (S : CompHaus) (y : Y.val.obj ⟨S⟩),
      (∃ (S' : CompHaus) (φ : S' ⟶ S) (_ : Function.Surjective φ) (x : X.val.obj ⟨S'⟩),
        f.val.app ⟨S'⟩ x = Y.val.map ⟨φ⟩ y)

[CategoryTheory.HasSheafify (CategoryTheory.coherentTopology CompHaus) A]

[(CategoryTheory.coherentTopology CompHaus).HasSheafCompose (CategoryTheory.forget A)]

[CategoryTheory.Balanced (CategoryTheory.Sheaf (CategoryTheory.coherentTopology CompHaus) A)]

CategoryTheory.Epi f ↔
  ∀ (S : CompHaus) (y : (CategoryTheory.forget A).obj (Y.val.obj (Opposite.op S))),
    ∃ S' φ, ∃ (_ : Function.Surjective ⇑φ), ∃ x, (f.val.app (Opposite.op S')) x = (Y.val.map (Opposite.op φ)) y


@[simp]
theorem mem_cons_iff (s : WSeq α) (b) {a} : a ∈ cons b s ↔ a = b ∨ a ∈ s

{α : Type u}
(s : Stream'.WSeq α)
(b : α)
{a : α}

a ∈ Stream'.WSeq.cons b s ↔ a = b ∨ a ∈ s


@[simp (high)]
theorem norm_p_pow (n : ℕ) : ‖(p : ℚ_[p]) ^ n‖ = (p : ℝ) ^ (-n : ℤ)

{p : ℕ}
[hp : Fact (Nat.Prime p)]
(n : ℕ)


@[reassoc]
lemma d_comm (K : HomologicalComplex₂ C c₁ c₂) (i₁ i₁' : I₁) (i₂ i₂' : I₂) :
    (K.d i₁ i₁').f i₂ ≫ (K.X i₁').d i₂ i₂' = (K.X i₁).d i₂ i₂' ≫ (K.d i₁ i₁').f i₂'


/-- A product over all subsets of `s ∪ {x}` is obtained by multiplying the product over all subsets
of `s`, and over all subsets of `s` to which one adds `x`. -/
@[to_additive "A sum over all subsets of `s ∪ {x}` is obtained by summing the sum over all subsets
of `s`, and over all subsets of `s` to which one adds `x`."]
lemma prod_powerset_insert [DecidableEq α] (ha : a ∉ s) (f : Finset α → β) :
    ∏ t ∈ (insert a s).powerset, f t =
      (∏ t ∈ s.powerset, f t) * ∏ t ∈ s.powerset, f (insert a t)

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

∑ t ∈ (insert a s).powerset, f t = ∑ t ∈ s.powerset, f t + ∑ t ∈ s.powerset, f (insert a t)


/-- An irreducible space is one that is nonempty
and where there is no non-trivial pair of disjoint opens. -/
class IrreducibleSpace (X : Type*) [TopologicalSpace X] extends PreirreducibleSpace X : Prop where
  toNonempty : Nonempty X

{X : Type u_3}
[TopologicalSpace X]
[self : IrreducibleSpace X]


@[simp]
theorem MonadHom.comp_toNatTrans {T₁ T₂ T₃ : Monad C} (f : T₁ ⟶ T₂) (g : T₂ ⟶ T₃) :
    (f ≫ g).toNatTrans = ((f.toNatTrans : _ ⟶ (T₂ : C ⥤ C)) ≫ g.toNatTrans : (T₁ : C ⥤ C) ⟶ T₃)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{T₁ T₂ T₃ : CategoryTheory.Monad C}
(f : T₁ ⟶ T₂)
(g : T₂ ⟶ T₃)

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


@[to_additive (attr := simp)]
theorem fromLeftInv_one : S.fromLeftInv 1 = 1

{M : Type u_1}
[Monoid M]
(S : Submonoid M)


@[simp]
theorem add_apply (p q : Seminorm 𝕜 E) (x : E) : (p + q) x = p x + q x

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddGroup E]
[SMul 𝕜 E]
(p q : Seminorm 𝕜 E)
(x : E)


@[simp high]
theorem coe_toSubsemigroup (s : NonUnitalSubsemiring R) : (s.toSubsemigroup : Set R) = s

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


theorem image_inter [DecidableEq α] (s₁ s₂ : Finset α) (hf : Injective f) :
    (s₁ ∩ s₂).image f = s₁.image f ∩ s₂.image f

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{f : α → β}
[DecidableEq α]
(s₁ s₂ : Finset α)
(hf : Function.Injective f)

Finset.image f (s₁ ∩ s₂) = Finset.image f s₁ ∩ Finset.image f s₂


theorem add_lt_of_lt_sub' {a b c : Nat} : b < c - a → a + b < c


theorem IsSubordinate.support_subset {fs : SmoothBumpCovering ι I M s} {U : M → Set M}
    (h : fs.IsSubordinate U) (i : ι) : support (fs i) ⊆ U (fs.c i)

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
{fs : SmoothBumpCovering ι I M s}
{U : M → Set M}
(h : fs.IsSubordinate U)
(i : ι)

Function.support ↑(fs.toFun i) ⊆ U (fs.c i)


/-- The other direction does not hold because of the `u`-`u` cross terms on the RHS. -/
theorem image₂_distrib_subset_right {γ : Type*} {u : Finset γ} {f : δ → γ → ε} {g : α → β → δ}
    {f₁ : α → γ → α'} {f₂ : β → γ → β'} {g' : α' → β' → ε}
    (h_distrib : ∀ a b c, f (g a b) c = g' (f₁ a c) (f₂ b c)) :
    image₂ f (image₂ g s t) u ⊆ image₂ g' (image₂ f₁ s u) (image₂ f₂ t u)

{f : δ → γ → ε}

{g : α → β → δ}

{f₁ : α → γ → α'}

{f₂ : β → γ → β'}

(h_distrib : ∀ (a : α) (b : β) (c : γ), f (g a b) c = g' (f₁ a c) (f₂ b c))

Finset.image₂ f (Finset.image₂ g s t) u ⊆ Finset.image₂ g' (Finset.image₂ f₁ s u) (Finset.image₂ f₂ t u)


@[elab_as_elim]
theorem induction_on₂ {C : Finmap β → Finmap β → Prop} (s₁ s₂ : Finmap β)
    (H : ∀ a₁ a₂ : AList β, C ⟦a₁⟧ ⟦a₂⟧) : C s₁ s₂

{α : Type u}
{β : α → Type v}
{C : Finmap β → Finmap β → Prop}
(s₁ s₂ : Finmap β)
(H : ∀ (a₁ a₂ : AList β), C ⟦a₁⟧ ⟦a₂⟧)


/-- The `n+1`st term of the upper central series `H i` has underlying set equal to the `x` such
that `⁅x,G⁆ ⊆ H n`-/
theorem mem_upperCentralSeries_succ_iff (n : ℕ) (x : G) :
    x ∈ upperCentralSeries G (n + 1) ↔ ∀ y : G, x * y * x⁻¹ * y⁻¹ ∈ upperCentralSeries G n

(G : Type u_1)
[Group G]
(n : ℕ)
(x : G)

x ∈ upperCentralSeries G (n + 1) ↔ ∀ (y : G), x * y * x⁻¹ * y⁻¹ ∈ upperCentralSeries G n


theorem log_le_sub_one_of_pos {x : ℝ} (hx : 0 < x) : log x ≤ x - 1


/-- A regular monomorphism is a morphism which is the equalizer of some parallel pair. -/
class RegularMono (f : X ⟶ Y) where
  /-- An object in `C` -/
  Z : C -- Porting note: violates naming but what is better?
  /-- A map from the codomain of `f` to `Z` -/
  left : Y ⟶ Z
  /-- Another map from the codomain of `f` to `Z` -/
  right : Y ⟶ Z
  /-- `f` equalizes the two maps -/
  w : f ≫ left = f ≫ right := by aesop_cat
  /-- `f` is the equalizer of the two maps -/
  isLimit : IsLimit (Fork.ofι f w)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y : C}
{f : X ⟶ Y}
[self : CategoryTheory.RegularMono f]

CategoryTheory.CategoryStruct.comp f CategoryTheory.RegularMono.left =
  CategoryTheory.CategoryStruct.comp f CategoryTheory.RegularMono.right


theorem aemeasurable_ofReal_abs_det_fderivWithin (hs : MeasurableSet s)
    (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) :
    AEMeasurable (fun x => ENNReal.ofReal |(f' x).det|) (μ.restrict s)


/-- If `p` is a maximal ideal of `R`, and `S` is the integral closure of `R` in `L`,
then the dimension `[S/pS : R/p]` is equal to `[Frac(S) : Frac(R)]`. -/
theorem finrank_quotient_map [IsDomain S] [IsDedekindDomain R] [Algebra K L]
    [Algebra R L] [IsScalarTower R K L] [IsScalarTower R S L] [IsIntegralClosure S R L]
    [hp : p.IsMaximal] [IsNoetherian R S] :
    finrank (R ⧸ p) (S ⧸ map (algebraMap R S) p) = finrank K L

{R : Type u}
[CommRing R]
{S : Type v}
[CommRing S]
(p : Ideal R)
[Algebra R S]
(K : Type u_1)
[Field K]
[Algebra R K]
[hRK : IsFractionRing R K]
(L : Type u_2)
[Field L]
[Algebra S L]
[IsFractionRing S L]
[IsDomain S]
[IsDedekindDomain R]
[Algebra K L]
[Algebra R L]
[IsScalarTower R K L]
[IsScalarTower R S L]
[IsIntegralClosure S R L]
[hp : p.IsMaximal]
[IsNoetherian R S]

FiniteDimensional.finrank (R ⧸ p) (S ⧸ Ideal.map (algebraMap R S) p) = FiniteDimensional.finrank K L


theorem fold_bind {ι : Type*} (s : Multiset ι) (t : ι → Multiset α) (b : ι → α) (b₀ : α) :
    (s.bind t).fold op ((s.map b).fold op b₀) =
    (s.map fun i => (t i).fold op (b i)).fold op b₀

{α : Type u_1}
(op : α → α → α)
[hc : Std.Commutative op]
[ha : Std.Associative op]
{ι : Type u_3}
(s : Multiset ι)
(t : ι → Multiset α)
(b : ι → α)
(b₀ : α)

Multiset.fold op (Multiset.fold op b₀ (Multiset.map b s)) (s.bind t) =
  Multiset.fold op b₀ (Multiset.map (fun i => Multiset.fold op (b i) (t i)) s)


/-- Let `f : ℝ → ℝ` be a differentiable function. If `f'` is strictly positive, then
`f` is a strictly monotone function. -/
lemma strictAnti_of_hasDerivAt_neg {f f' : ℝ → ℝ} (hf : ∀ x, HasDerivAt f (f' x) x)
    (hf' : ∀ x, f' x < 0) : StrictAnti f

{f f' : ℝ → ℝ}
(hf : ∀ (x : ℝ), HasDerivAt f (f' x) x)
(hf' : ∀ (x : ℝ), f' x < 0)


theorem effectiveEpiFamilyStructCompIso_aux
    {W : C} (e : (a : α) → X a ⟶ W)
    (h : ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂),
      g₁ ≫ π a₁ ≫ i = g₂ ≫ π a₂ ≫ i → g₁ ≫ e a₁ = g₂ ≫ e a₂)
    {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂) (hg : g₁ ≫ π a₁ = g₂ ≫ π a₂) :
    g₁ ≫ e a₁ = g₂ ≫ e a₂

(h :
  ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂),
    CategoryTheory.CategoryStruct.comp g₁ (CategoryTheory.CategoryStruct.comp (π a₁) i) =
        CategoryTheory.CategoryStruct.comp g₂ (CategoryTheory.CategoryStruct.comp (π a₂) i) →
      CategoryTheory.CategoryStruct.comp g₁ (e a₁) = CategoryTheory.CategoryStruct.comp g₂ (e a₂))

(hg : CategoryTheory.CategoryStruct.comp g₁ (π a₁) = CategoryTheory.CategoryStruct.comp g₂ (π a₂))


@[simp]
theorem prod_eval (f : C(α, β₁)) (g : C(α, β₂)) (a : α) : (prodMk f g) a = (f a, g a)

{α : Type u_1}
[TopologicalSpace α]
{β₁ : Type u_7}
{β₂ : Type u_8}
[TopologicalSpace β₁]
[TopologicalSpace β₂]
(f : C(α, β₁))
(g : C(α, β₂))
(a : α)


/-- Horizontal inverse of a 2-commutative square -/
@[simps! iso'_hom_app iso'_inv_app]
def hInv (_ : CatCommSq T.functor L R B.functor) : CatCommSq T.inverse R L B.inverse

∀ (x : CategoryTheory.CatCommSq T.functor L R B.functor) (X : C₂),
  CategoryTheory.CatCommSq.iso'.inv.app X =
    CategoryTheory.CategoryStruct.comp (B.inverse.map (R.map (T.counitIso.inv.app X)))
      (CategoryTheory.CategoryStruct.comp
        (B.inverse.map ((CategoryTheory.CatCommSq.iso T.functor L R B.functor).hom.app (T.inverse.obj X)))
        (B.unitIso.inv.app (L.obj (T.inverse.obj X))))


@[simp]
theorem continuousWithinAt_Ioc_iff_Iic (h : a < b) :
    ContinuousWithinAt f (Ioc a b) b ↔ ContinuousWithinAt f (Iic b) b

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIicTopology α]
[TopologicalSpace β]
{a b : α}
{f : α → β}
(h : a < b)

ContinuousWithinAt f (Set.Ioc a b) b ↔ ContinuousWithinAt f (Set.Iic b) b


theorem vec2_eq {a₀ a₁ b₀ b₁ : α} (h₀ : a₀ = b₀) (h₁ : a₁ = b₁) : ![a₀, a₁] = ![b₀, b₁]

{α : Type u}
{a₀ a₁ b₀ b₁ : α}
(h₀ : a₀ = b₀)
(h₁ : a₁ = b₁)


/-- The linear equivalence between `ContinuousMultilinearMap 𝕜 E F` and `(⨂[𝕜] i, Eᵢ) →L[𝕜] F`
induced by `PiTensorProduct.lift`, for every normed space `F`.
-/
@[simps]
noncomputable def liftEquiv : ContinuousMultilinearMap 𝕜 E F ≃ₗ[𝕜] (⨂[𝕜] i, E i) →L[𝕜] F

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

(PiTensorProduct.liftEquiv 𝕜 E F).symm l = (PiTensorProduct.lift.symm ↑l).mkContinuous ‖l‖ ⋯


theorem mem_closedBall_comm : x ∈ closedBall y ε ↔ y ∈ closedBall x ε

{α : Type u}
[PseudoEMetricSpace α]
{x y : α}
{ε : ℝ≥0∞}

x ∈ EMetric.closedBall y ε ↔ y ∈ EMetric.closedBall x ε


/-- A variant of `of_lifting_property'` when we're working over a `[Ring R]`,
which only requires quantifying over modules with an `AddCommGroup` instance. -/
theorem Projective.of_lifting_property {R : Type u} [Ring R] {P : Type max u v} [AddCommGroup P]
    [Module R P]
    -- If for all surjections of `R`-modules `M →ₗ N`, all maps `P →ₗ N` lift to `P →ₗ M`,
    (huniv : ∀ {M : Type max v u} {N : Type max u v} [AddCommGroup M] [AddCommGroup N]
      [Module R M] [Module R N] (f : M →ₗ[R] N) (g : P →ₗ[R] N),
        Function.Surjective f → ∃ h : P →ₗ[R] M, f.comp h = g) :
    -- then `P` is projective.
    Projective R P

(huniv :
  ∀ {M : Type (max v u)} {N : Type (max u v)} [inst : AddCommGroup M] [inst_1 : AddCommGroup N] [inst_2 : Module R M]
    [inst_3 : Module R N] (f : M →ₗ[R] N) (g : P →ₗ[R] N), Function.Surjective ⇑f → ∃ h, f ∘ₗ h = g)


/-- A `NormedLinearOrderedGroup` is a group that is both a `NormedCommGroup` and a
`LinearOrderedCommGroup`. This class is necessary to avoid diamonds caused by both classes
carrying their own group structure. -/
@[to_additive]
class NormedLinearOrderedGroup (α : Type*) extends LinearOrderedCommGroup α, Norm α,
  MetricSpace α where
  /-- The distance function is induced by the norm. -/
  dist_eq : ∀ x y, dist x y = ‖x / y‖ := by aesop

{α : Type u_2}
[self : NormedLinearOrderedGroup α]
(x y : α)


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


@[simp]
theorem refl_symm : (AlgEquiv.refl : A₁ ≃ₐ[R] A₁).symm = AlgEquiv.refl

{R : Type uR}
{A₁ : Type uA₁}
[CommSemiring R]
[Semiring A₁]
[Algebra R A₁]


theorem one_div_lt_one_div {n m : ℕ} (h : n < m) : 1 / ((m : α) + 1) < 1 / ((n : α) + 1)

{α : Type u_1}
[LinearOrderedSemifield α]
{n m : ℕ}
(h : n < m)


/-- If `M / R` and `M' / R'` are modules, `i : R → R'` is a surjective map which maps zero to zero,
`j : M →+ M'` is a monoid map which sends non-zero elements to non-zero elements, such that the
scalar multiplications on `M` and `M'` are compatible, then `j` sends linearly independent families
of vectors to linearly independent families of vectors. As a special case, taking `R = R'`
it is `LinearIndependent.map'`. -/
theorem LinearIndependent.map_of_surjective_injective {R' : Type*} {M' : Type*}
    [Semiring R'] [AddCommMonoid M'] [Module R' M'] (hv : LinearIndependent R v)
    (i : ZeroHom R R') (j : M →+ M') (hi : Surjective i) (hj : ∀ m, j m = 0 → m = 0)
    (hc : ∀ (r : R) (m : M), j (r • m) = i r • j m) : LinearIndependent R' (j ∘ v)


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


theorem probability (n : ℕ) (x : I) : (∑ k : Fin (n + 1), bernstein n k x) = 1

∑ k : Fin (n + 1), (bernstein n ↑k) x = 1


/-- **Banach-Alaoglu** theorem. The set of functions `f : E → F` that represent continuous linear
maps `f : E →SL[σ₁₂] F` at distance `≤ r` from `f₀ : E →SL[σ₁₂] F` is compact in the topology of
pointwise convergence. Other versions of this theorem can be found in
`Analysis.Normed.Module.WeakDual`. -/
theorem isCompact_image_coe_closedBall [ProperSpace F] (f₀ : E →SL[σ₁₂] F) (r : ℝ) :
    IsCompact (((↑) : (E →SL[σ₁₂] F) → E → F) '' closedBall f₀ r)

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
[ProperSpace F]
(f₀ : E →SL[σ₁₂] F)
(r : ℝ)

IsCompact (DFunLike.coe '' Metric.closedBall f₀ r)


theorem isCauSeq_iff_lift {f : ℕ → ℚ} : IsCauSeq abs f ↔ IsCauSeq abs fun i => (f i : ℝ)

IsCauSeq abs f ↔ IsCauSeq abs fun i => ↑(f i)


theorem of_d_ne {i j : α} (h : i ≠ j + 1) : (of X d sq).d i j = 0


/-- Formula for `hurwitzZetaEven` as a Dirichlet series in the convergence range, with sum over `ℕ`
(version with absolute values) -/
lemma hasSum_nat_hurwitzZetaEven (a : ℝ) {s : ℂ} (hs : 1 < re s) :
    HasSum (fun n : ℕ ↦ (1 / (↑|n + a| : ℂ) ^ s + 1 / (↑|n + 1 - a| : ℂ) ^ s) / 2)
    (hurwitzZetaEven a s)

HasSum (fun n => (1 / ↑|↑n + a| ^ s + 1 / ↑|↑n + 1 - a| ^ s) / 2) (HurwitzZeta.hurwitzZetaEven (↑a) s)


@[to_additive]
theorem Finite.smul : s.Finite → t.Finite → (s • t).Finite

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{s : Set α}
{t : Set β}


theorem inf'_product_left {t : Finset γ} (h : (s ×ˢ t).Nonempty) (f : β × γ → α) :
    (s ×ˢ t).inf' h f = s.inf' h.fst fun i => t.inf' h.snd fun i' => f ⟨i, i'⟩

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[SemilatticeInf α]
{s : Finset β}
{t : Finset γ}
(h : (s ×ˢ t).Nonempty)
(f : β × γ → α)

(s ×ˢ t).inf' h f = s.inf' ⋯ fun i => t.inf' ⋯ fun i' => f (i, i')


theorem transGen_idem : TransGen (TransGen r) = TransGen r

Relation.TransGen (Relation.TransGen r) = Relation.TransGen r


theorem edges_toPath_subset {u v : V} (p : G.Walk u v) : (p.toPath : G.Walk u v).edges ⊆ p.edges

{V : Type u}
{G : SimpleGraph V}
[DecidableEq V]
{u v : V}
(p : G.Walk u v)


@[simp]
lemma ΓIso_inv {X Y : Scheme.{u}} (f : X ⟶ Y) [IsOpenImmersion f] (U : Y.Opens) :
    (ΓIso f U).inv = f.appLE (f.opensRange ⊓ U) (f⁻¹ᵁ U)
      (by rw [← f.image_preimage_eq_opensRange_inter, f.preimage_image_eq])

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

(AlgebraicGeometry.IsOpenImmersion.ΓIso f U).inv =
  AlgebraicGeometry.Scheme.Hom.appLE f (AlgebraicGeometry.Scheme.Hom.opensRange f ⊓ U)
    ((TopologicalSpace.Opens.map f.val.base).obj U) ⋯


private theorem extend_Z_bilin_aux (x₀ : α) (y₁ : δ) : ∃ U₂ ∈ comap e (𝓝 x₀), ∀ x ∈ U₂, ∀ x' ∈ U₂,
    (fun p : β × δ => φ p.1 p.2) (x' - x, y₁) ∈ W'

{α : Type u_1}
{β : Type u_2}
{δ : Type u_4}
{G : Type u_5}
[TopologicalSpace α]
[AddCommGroup α]
[TopologicalAddGroup α]
[TopologicalSpace β]
[AddCommGroup β]
[TopologicalSpace δ]
[AddCommGroup δ]
[UniformSpace G]
[AddCommGroup G]
{e : β →+ α}
(de : DenseInducing ⇑e)
{φ : β →+ δ →+ G}
(hφ : Continuous fun p => (φ p.1) p.2)
{W' : Set G}
(W'_nhd : W' ∈ 𝓝 0)
(x₀ : α)
(y₁ : δ)

∃ U₂ ∈ Filter.comap (⇑e) (𝓝 x₀), ∀ x ∈ U₂, ∀ x' ∈ U₂, (fun p => (φ p.1) p.2) (x' - x, y₁) ∈ W'


protected theorem IsCompressed.eq (h : IsCompressed u v s) : 𝓒 u v s = s

{α : Type u_1}
[GeneralizedBooleanAlgebra α]
[DecidableRel Disjoint]
[DecidableRel fun x x_1 => x ≤ x_1]
{s : Finset α}
{u v : α}
[DecidableEq α]
(h : UV.IsCompressed u v s)


/-- If the sequence of Fourier coefficients of `f` is summable, then the Fourier series converges
uniformly to `f`. -/
theorem hasSum_fourier_series_of_summable (h : Summable (fourierCoeff f)) :
    HasSum (fun i => fourierCoeff f i • fourier i) f

{T : ℝ}
[hT : Fact (0 < T)]
{f : C(AddCircle T, ℂ)}
(h : Summable (fourierCoeff ⇑f))

HasSum (fun i => fourierCoeff (⇑f) i • fourier i) f


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

{X : Type u_5}
[TopologicalSpace X]
[Add X]
[ContinuousAdd X]
(x : X)

⇑(ContinuousMap.addRight x) = fun y => y + x


/-- `IsArtinian R M` is the proposition that `M` is an Artinian `R`-module,
implemented as the well-foundedness of submodule inclusion. -/
class IsArtinian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where
  wellFounded_submodule_lt' : WellFounded ((· < ·) : Submodule R M → Submodule R M → Prop)

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[self : IsArtinian R M]


@[to_additive existing (attr := simp)]
theorem pure_div_pure : pure a / pure b = pure (a / b)

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

NonemptyInterval.pure a / NonemptyInterval.pure b = NonemptyInterval.pure (a / b)


/-- The sieve `S` is closed iff its closure is equal to itself. -/
theorem isClosed_iff_close_eq_self {X : C} (S : Sieve X) : J₁.IsClosed S ↔ J₁.close S = S

(J₁ : CategoryTheory.GrothendieckTopology C)


lemma MonotoneOn.mapsTo_Icc (h : MonotoneOn f (Icc a b)) : MapsTo f (Icc a b) (Icc (f a) (f b))

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

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


theorem front : ∀ {s}, Valid s → s.toString.1 = c :: m → s.front = c

{c : Char}
{m : List Char}
{s : Substring}

s.Valid → s.toString.data = c :: m → s.front = c


@[to_additive]
lemma inv (h : IsUnit a) : IsUnit a⁻¹

{α : Type u}
[DivisionMonoid α]
{a : α}
(h : IsUnit a)


@[simp]
theorem pointwise_smul_toAddSubmonoid (m : M) (S : Subsemiring R) :
    (m • S).toAddSubmonoid = m • S.toAddSubmonoid

{M : Type u_1}
{R : Type u_2}
[Monoid M]
[Semiring R]
[MulSemiringAction M R]
(m : M)
(S : Subsemiring R)


theorem le_iff (hf : LeftOrdContinuous f) (h : Injective f) {x y} : f x ≤ f y ↔ x ≤ y

{α : Type u}
{β : Type v}
[SemilatticeSup α]
[SemilatticeSup β]
{f : α → β}
(hf : LeftOrdContinuous f)
(h : Function.Injective f)
{x y : α}


/-- Decompose a bounded continuous function to its positive and negative parts. -/
theorem self_eq_nnrealPart_sub_nnrealPart_neg (f : α →ᵇ ℝ) :
    ⇑f = (↑) ∘ f.nnrealPart - (↑) ∘ (-f).nnrealPart

{α : Type u}
[TopologicalSpace α]
(f : BoundedContinuousFunction α ℝ)

⇑f = NNReal.toReal ∘ ⇑f.nnrealPart - NNReal.toReal ∘ ⇑(-f).nnrealPart


theorem eq_top_iff {a b : α} : multiplicity a b = ⊤ ↔ ∀ n : ℕ, a ^ n ∣ b

{α : Type u_1}
[Monoid α]
[DecidableRel fun x x_1 => x ∣ x_1]
{a b : α}

multiplicity a b = ⊤ ↔ ∀ (n : ℕ), a ^ n ∣ b


theorem comp₂ {Y₁ Y₂ Z : Type*} {f : X → Y₁} {g : X → Y₂} (hf : IsLocallyConstant f)
    (hg : IsLocallyConstant g) (h : Y₁ → Y₂ → Z) : IsLocallyConstant fun x => h (f x) (g x)

{X : Type u_1}
[TopologicalSpace X]
{Y₁ : Type u_5}
{Y₂ : Type u_6}
{Z : Type u_7}
{f : X → Y₁}
{g : X → Y₂}
(hf : IsLocallyConstant f)
(hg : IsLocallyConstant g)
(h : Y₁ → Y₂ → Z)


/-- The number of times an ideal `I` occurs as normalized factor of another ideal `J` is stable
  when regarding at these ideals as associated elements of the monoid of ideals.-/
theorem count_associates_factors_eq [DecidableEq <| Associates (Ideal R)]
    [∀ (p : Associates <| Ideal R), Decidable (Irreducible p)]
    (I J : Ideal R) (hI : I ≠ 0) (hJ : J.IsPrime) (hJ₀ : J ≠ ⊥) :
    (Associates.mk J).count (Associates.mk I).factors = Multiset.count J (normalizedFactors I)

[(p : Associates (Ideal R)) → Decidable (Irreducible p)]

(Associates.mk J).count (Associates.mk I).factors = Multiset.count J (UniqueFactorizationMonoid.normalizedFactors I)


/-- **Strict inequality case of the Rearrangement Inequality**: Pointwise scalar multiplication of
`f` and `g`, which antivary together, is strictly decreased by a permutation if and only if
`f ∘ σ` and `g` do not antivary together. Stated by permuting the entries of `f`. -/
theorem Antivary.sum_smul_lt_sum_comp_perm_smul_iff (hfg : Antivary f g) :
    ∑ i, f i • g i < ∑ i, f (σ i) • g i ↔ ¬Antivary (f ∘ σ) g

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{σ : Equiv.Perm ι}
{f : ι → α}
{g : ι → β}
[Fintype ι]
(hfg : Antivary f g)

∑ i : ι, f i • g i < ∑ i : ι, f (σ i) • g i ↔ ¬Antivary (f ∘ ⇑σ) g


private theorem zpow_aux (hf : ∀ x, p x ↔ p (f x)) : ∀ {n : ℤ} (x), p x ↔ p ((f ^ n) x)

{α : Type u}
{p : α → Prop}
{f : Equiv.Perm α}
(hf : ∀ (x : α), p x ↔ p (f x))
{n : ℤ}
(x : α)


lemma _root_.AddEquiv.isRegular_congr {e : M ≃+ M₂} {as bs}
    (h : List.Forall₂ (fun (r : R) (s : S) => ∀ x, e (r • x) = s • e x) as bs) :
    IsRegular M as ↔ IsRegular M₂ bs

(h : List.Forall₂ (fun r s => ∀ (x : M), e (r • x) = s • e x) as bs)

RingTheory.Sequence.IsRegular M as ↔ RingTheory.Sequence.IsRegular M₂ bs


/-- Induction principle for `Finset`s in any type from which a given function `f` maps to a linearly
ordered type : a predicate is true on all `s : Finset α` provided that:

* it is true on the empty `Finset`,
* for every `s : Finset α` and an element `a` such that for elements of `s` denoted by `x` we have
  `f a ≤ f x`, `p s` implies `p (insert a s)`. -/
@[elab_as_elim]
theorem induction_on_min_value [DecidableEq ι] (f : ι → α) {p : Finset ι → Prop} (s : Finset ι)
    (h0 : p ∅) (step : ∀ a s, a ∉ s → (∀ x ∈ s, f a ≤ f x) → p s → p (insert a s)) : p s

(step : ∀ (a : ι) (s : Finset ι), a ∉ s → (∀ x ∈ s, f a ≤ f x) → p s → p (insert a s))


theorem not_mem_erase_self {a : α} {s : Finmap β} : ¬a ∈ erase a s

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{s : Finmap β}


@[to_additive]
theorem subsingleton_quotient_top : Subsingleton (G ⧸ (⊤ : Subgroup G))


protected theorem left_distrib (n m k : Nat) : n * (m + k) = n * m + n * k


/-- A product of weighted homogeneous polynomials is weighted homogeneous, with weighted degree
  equal to the sum of the weighted degrees. -/
theorem prod {ι : Type*} (s : Finset ι) (φ : ι → MvPolynomial σ R) (n : ι → M) {w : σ → M} :
    (∀ i ∈ s, IsWeightedHomogeneous w (φ i) (n i)) →
      IsWeightedHomogeneous w (∏ i ∈ s, φ i) (∑ i ∈ s, n i)

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

(∀ i ∈ s, MvPolynomial.IsWeightedHomogeneous w (φ i) (n i)) →
  MvPolynomial.IsWeightedHomogeneous w (∏ i ∈ s, φ i) (∑ i ∈ s, n i)


@[to_additive (attr := simp)]
theorem swap_inv [Inv G] [Inv H] (p : G × H) : p⁻¹.swap = p.swap⁻¹

{G : Type u_3}
{H : Type u_4}
[Neg G]
[Neg H]
(p : G × H)


theorem parallelogram_law_with_nnnorm (x y : E) :
    ‖x + y‖₊ * ‖x + y‖₊ + ‖x - y‖₊ * ‖x - y‖₊ = 2 * (‖x‖₊ * ‖x‖₊ + ‖y‖₊ * ‖y‖₊)

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x y : E)


/-- The category of algebras over an additive monad on a preadditive category is preadditive. -/
@[simps]
instance Monad.algebraPreadditive : Preadditive (Monad.Algebra T)

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Preadditive C]
(T : CategoryTheory.Monad C)
[T.Additive]
(F G : T.Algebra)
(r : ℤ)
(α : F ⟶ G)


@[simp, norm_cast]
theorem coe_pow (x : ℝ) (n : ℕ) : (↑(x ^ n) : EReal) = (x : EReal) ^ n


lemma exists_eventually_atTop [SemilatticeSup α] [Nonempty α] {r : α → β → Prop} :
    (∃ b, ∀ᶠ a in atTop, r a b) ↔ ∀ᶠ a₀ in atTop, ∃ b, ∀ a ≥ a₀, r a b

{α : Type u_3}
{β : Type u_4}
[SemilatticeSup α]
[Nonempty α]
{r : α → β → Prop}

(∃ b, ∀ᶠ (a : α) in Filter.atTop, r a b) ↔ ∀ᶠ (a₀ : α) in Filter.atTop, ∃ b, ∀ a ≥ a₀, r a b


@[to_additive lowerClosure_interior_subset] lemma lowerClosure_interior_subset' (s : Set α) :
    (lowerClosure (interior s) : Set α) ⊆ interior (lowerClosure s)

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

↑(lowerClosure (interior s)) ⊆ interior ↑(lowerClosure s)


@[simp]
theorem dotProduct_self_eq_zero [LinearOrderedRing R] {v : n → R} : dotProduct v v = 0 ↔ v = 0

{n : Type u_2}
{R : Type u_4}
[Fintype n]
[LinearOrderedRing R]
{v : n → R}


@[simp]
theorem ker_comp {E : Type*} [Groupoid E] (ψ : D ⥤ E) : ker (φ ⋙ ψ) = comap φ (ker ψ)

{C : Type u}
[CategoryTheory.Groupoid C]
{D : Type u_1}
[CategoryTheory.Groupoid D]
(φ : CategoryTheory.Functor C D)
{E : Type u_2}
[CategoryTheory.Groupoid E]
(ψ : CategoryTheory.Functor D E)

CategoryTheory.Subgroupoid.ker (φ.comp ψ) = CategoryTheory.Subgroupoid.comap φ (CategoryTheory.Subgroupoid.ker ψ)


/-- A version of `Nat.exists_infinite_primes` using the `BddAbove` predicate. -/
theorem not_bddAbove_setOf_prime : ¬BddAbove { p | Prime p }


theorem log_two_lt_d9 : log 2 < 0.6931471808


theorem set_biUnion_biUnion (s : Finset γ) (t : γ → Finset α) (f : α → Set β) :
    ⋃ y ∈ s.biUnion t, f y = ⋃ (x ∈ s) (y ∈ t x), f y

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[DecidableEq α]
(s : Finset γ)
(t : γ → Finset α)
(f : α → Set β)

⋃ y ∈ s.biUnion t, f y = ⋃ x ∈ s, ⋃ y ∈ t x, f y


theorem disjoint_atBot_atTop [PartialOrder α] [Nontrivial α] :
    Disjoint (atBot : Filter α) atTop

{α : Type u_3}
[PartialOrder α]
[Nontrivial α]


theorem zero_toSimpleFunc : toSimpleFunc (0 : Lp.simpleFunc E p μ) =ᵐ[μ] 0

{α : Type u_1}
(E : Type u_4)
[MeasurableSpace α]
[NormedAddCommGroup E]
{p : ℝ≥0∞}
(μ : MeasureTheory.Measure α)

↑(MeasureTheory.Lp.simpleFunc.toSimpleFunc 0) =ᵐ[μ] 0


theorem single_one_comm [CommSemiring k] [MulOneClass G] (r : k) (f : MonoidAlgebra k G) :
    single (1 : G) r * f = f * single (1 : G) r

{k : Type u₁}
{G : Type u₂}
[CommSemiring k]
[MulOneClass G]
(r : k)
(f : MonoidAlgebra k G)

MonoidAlgebra.single 1 r * f = f * MonoidAlgebra.single 1 r


@[simp]
theorem snd_prod (f : A →ₐ[R] B) (g : A →ₐ[R] C) : (snd R B C).comp (prod f g) = g

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[Semiring C]
[Algebra R C]
(f : A →ₐ[R] B)
(g : A →ₐ[R] C)


/-- an n-digit number in base b + 2 is less than (b + 2)^n -/
theorem ofDigits_lt_base_pow_length' {b : ℕ} {l : List ℕ} (hl : ∀ x ∈ l, x < b + 2) :
    ofDigits (b + 2) l < (b + 2) ^ l.length

Nat.ofDigits (b + 2) l < (b + 2) ^ l.length


theorem two_mul_arctan_add_pi {x : ℝ} (h : 1 < x) :
    2 * arctan x = arctan (2 * x / (1 - x ^ 2)) + π

2 * Real.arctan x = Real.arctan (2 * x / (1 - x ^ 2)) + Real.pi


@[to_additive]
theorem map_div_right_eq_self (μ : Measure G) [IsMulRightInvariant μ] (g : G) :
    map (· / g) μ = μ

{G : Type u_2}
[MeasurableSpace G]
[DivInvMonoid G]
(μ : MeasureTheory.Measure G)
[μ.IsMulRightInvariant]
(g : G)

MeasureTheory.Measure.map (fun x => x / g) μ = μ


theorem not_cliqueFree_of_top_embedding {n : ℕ} (f : (⊤ : SimpleGraph (Fin n)) ↪g G) :
    ¬G.CliqueFree n

{α : Type u_1}
{G : SimpleGraph α}
{n : ℕ}
(f : ⊤ ↪g G)


theorem infinitePos_mul_of_not_infinitesimal_neg_infiniteNeg {x y : ℝ*} :
    ¬Infinitesimal x → x < 0 → InfiniteNeg y → InfinitePos (x * y)

¬x.Infinitesimal → x < 0 → y.InfiniteNeg → (x * y).InfinitePos


@[simp]
theorem smul_single [Zero M] [SMulZeroClass R M] (c : R) (a : α) (b : M) :
    c • Finsupp.single a b = Finsupp.single a (c • b)

{α : Type u_1}
{M : Type u_5}
{R : Type u_11}
[Zero M]
[SMulZeroClass R M]
(c : R)
(a : α)
(b : M)


@[to_additive]
theorem pairwise_aedisjoint_of_ac {ν} (h : IsFundamentalDomain G s μ) (hν : ν ≪ μ) :
    Pairwise fun g₁ g₂ : G => AEDisjoint ν (g₁ • s) (g₂ • s)

(h : MeasureTheory.IsFundamentalDomain G s μ)

(hν : ν ≪ μ)

Pairwise fun g₁ g₂ => MeasureTheory.AEDisjoint ν (g₁ • s) (g₂ • s)


/-- Characterization of the sheaf hom on basic opens,
    direction ← (next lemma) is used at various places, but → is not used in this file. -/
theorem toΓSpecCApp_iff
    (f :
      (structureSheaf <| Γ.obj <| op X).val.obj (op <| basicOpen r) ⟶
        X.presheaf.obj (op <| X.toΓSpecMapBasicOpen r)) :
    toOpen _ (basicOpen r) ≫ f = X.toToΓSpecMapBasicOpen r ↔ f = X.toΓSpecCApp r

(r : ↑(AlgebraicGeometry.LocallyRingedSpace.Γ.obj (Opposite.op X)))

(f :
  (AlgebraicGeometry.Spec.structureSheaf ↑(AlgebraicGeometry.LocallyRingedSpace.Γ.obj (Opposite.op X))).val.obj
      (Opposite.op (PrimeSpectrum.basicOpen r)) ⟶
    X.presheaf.obj (Opposite.op (X.toΓSpecMapBasicOpen r)))

CategoryTheory.CategoryStruct.comp
      (AlgebraicGeometry.StructureSheaf.toOpen (↑(AlgebraicGeometry.LocallyRingedSpace.Γ.obj (Opposite.op X)))
        (PrimeSpectrum.basicOpen r))
      f =
    X.toToΓSpecMapBasicOpen r ↔
  f = X.toΓSpecCApp r


@[measurability, fun_prop]
theorem Measurable.coe_nnreal_real {f : α → ℝ≥0} (hf : Measurable f) :
    Measurable fun x => (f x : ℝ)

{α : Type u_1}
[MeasurableSpace α]
{f : α → ℝ≥0}
(hf : Measurable f)


lemma ιMapBifunctorOrZero_eq_zero (i₁ : I₁) (i₂ : I₂) (j : J)
    (h : ComplexShape.π c₁ c₂ c (i₁, i₂) ≠ j) :
    ιMapBifunctorOrZero K₁ K₂ F c i₁ i₂ j = 0

[∀ (X₁ : C₁), (F.obj X₁).PreservesZeroMorphisms]

K₁.ιMapBifunctorOrZero K₂ F c i₁ i₂ j = 0


theorem dual_rTensor_conj_homEquiv (f : A →ₗ[R] A') :
    homEquiv.symm.toLinearMap ∘ₗ dual (f.rTensor B) ∘ₗ homEquiv.toLinearMap = f.lcomp R _

{R : Type uR}
[CommRing R]
{A : Type uA}
[AddCommGroup A]
(A' : Type u_1)
[AddCommGroup A']
{B : Type uB}
[AddCommGroup B]
[Module R A]
[Module R A']
[Module R B]
(f : A →ₗ[R] A')

↑CharacterModule.homEquiv.symm ∘ₗ CharacterModule.dual (LinearMap.rTensor B f) ∘ₗ ↑CharacterModule.homEquiv =
  LinearMap.lcomp R (CharacterModule B) f


@[simp]
theorem symm_comp_self (e : M₁ ≃SL[σ₁₂] M₂) : (e.symm : M₂ → M₁) ∘ (e : M₁ → M₂) = id

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


theorem nontrivial_iff_lt [LinearOrder α] : Nontrivial α ↔ ∃ x y : α, x < y


theorem tsub_eq_of_eq_add_rev (h : a = b + c) : a - b = c

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


@[ext]
lemma ext {X : C} {φ₁ φ₂ : Aut X} (h : φ₁.hom = φ₂.hom) : φ₁ = φ₂

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X : C}
{φ₁ φ₂ : CategoryTheory.Aut X}
(h : φ₁.hom = φ₂.hom)


@[simp]
theorem eta (f : R[X]) : Polynomial.ofFinsupp f.toFinsupp = f


@[ext]
lemma ext {P Q : AffineTargetMorphismProperty}
    (H : ∀ ⦃X Y : Scheme⦄ (f : X ⟶ Y) [IsAffine Y], P f ↔ Q f) : P = Q

{P Q : AlgebraicGeometry.AffineTargetMorphismProperty}

(H : ∀ ⦃X Y : AlgebraicGeometry.Scheme⦄ (f : X ⟶ Y) [inst : AlgebraicGeometry.IsAffine Y], P f ↔ Q f)


lemma div_lt_div_of_lt_of_dvd {a b d : ℕ} (hdb : d ∣ b) (h : a < b) : a / d < b / d


theorem lintegral_trim {μ : Measure α} (hm : m ≤ m0) {f : α → ℝ≥0∞} (hf : Measurable[m] f) :
    ∫⁻ a, f a ∂μ.trim hm = ∫⁻ a, f a ∂μ

{α : Type u_1}
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(hm : m ≤ m0)
{f : α → ℝ≥0∞}
(hf : Measurable f)

∫⁻ (a : α), f a ∂μ.trim hm = ∫⁻ (a : α), f a ∂μ


theorem OrthogonalFamily.eq_ite [DecidableEq ι] {i j : ι} (v : G i) (w : G j) :
    ⟪V i v, V j w⟫ = ite (i = j) ⟪V i v, V j w⟫ 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{G : ι → Type u_5}
[(i : ι) → NormedAddCommGroup (G i)]
[(i : ι) → InnerProductSpace 𝕜 (G i)]
{V : (i : ι) → G i →ₗᵢ[𝕜] E}
(hV : OrthogonalFamily 𝕜 G V)
[DecidableEq ι]
{i j : ι}
(v : G i)
(w : G j)

⟪(V i) v, (V j) w⟫_𝕜 = if i = j then ⟪(V i) v, (V j) w⟫_𝕜 else 0


theorem mulMap_comp_rTensor {M' : Submodule R S} (hM : M' ≤ M) :
    mulMap M N ∘ₗ (inclusion hM).rTensor N = mulMap M' N

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
{M : Submodule R S}
(N : Submodule R S)
{M' : Submodule R S}
(hM : M' ≤ M)

M.mulMap N ∘ₗ LinearMap.rTensor (↥N) (Submodule.inclusion hM) = M'.mulMap N


/-- The sum of a finite power series is continuous. -/
protected theorem FormalMultilinearSeries.continuousOn_of_finite
    (p : FormalMultilinearSeries 𝕜 E F) {n : ℕ} (hn : ∀ m, n ≤ m → p m = 0) :
    Continuous p.sum

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
{n : ℕ}
(hn : ∀ (m : ℕ), n ≤ m → p m = 0)


theorem toZ_iterate_pred_ge (n : ℕ) : -(n : ℤ) ≤ toZ i0 (pred^[n] i0)

{ι : Type u_1}
[LinearOrder ι]
[SuccOrder ι]
[IsSuccArchimedean ι]
[PredOrder ι]
{i0 : ι}
(n : ℕ)


theorem card_le_of_surjective' [RankCondition R] {α β : Type*} [Fintype α] [Fintype β]
    (f : (α →₀ R) →ₗ[R] β →₀ R) (i : Surjective f) : Fintype.card β ≤ Fintype.card α

(R : Type u)
[Semiring R]
[RankCondition R]
{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(f : (α →₀ R) →ₗ[R] β →₀ R)
(i : Function.Surjective ⇑f)


/-- Given a finite set `t` and a subset `s` of `t`, the product of `f i` over `i ∈ s`
times the product of `f i` over `t \ s` equals the product of `f i` over `i ∈ t`. -/
@[to_additive
      "Given a finite set `t` and a subset `s` of `t`, the sum of `f i` over `i ∈ s` plus
      the sum of `f i` over `t \\ s` equals the sum of `f i` over `i ∈ t`."]
theorem finprod_mem_mul_diff (hst : s ⊆ t) (ht : t.Finite) :
    ((∏ᶠ i ∈ s, f i) * ∏ᶠ i ∈ t \ s, f i) = ∏ᶠ i ∈ t, f i

{α : Type u_1}
{M : Type u_5}
[CommMonoid M]
{f : α → M}
{s t : Set α}
(hst : s ⊆ t)
(ht : t.Finite)


theorem not_wOppSide_bot (x y : P) : ¬(⊥ : AffineSubspace R P).WOppSide x y

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


lemma indicator_le_indicator_nonneg (s : Set α) (f : α → M) :
    s.indicator f ≤ {a | 0 ≤ f a}.indicator f

{α : Type u_2}
{M : Type u_4}
[Zero M]
[LinearOrder M]
(s : Set α)
(f : α → M)


theorem pow_apply_eq_self_of_apply_eq_self {x : α} (hfx : f x = x) : ∀ n : ℕ, (f ^ n) x = x

{α : Type u_1}
{f : Equiv.Perm α}
{x : α}
(hfx : f x = x)
(n : ℕ)


theorem MDifferentiableOn.mdifferentiableAt (h : MDifferentiableOn I I' f s) (hx : s ∈ 𝓝 x) :
    MDifferentiableAt I I' 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'}
{x : M}
{s : Set M}
(h : MDifferentiableOn I I' f s)
(hx : s ∈ 𝓝 x)


theorem memℒp_norm_iff {f : α → E} (hf : AEStronglyMeasurable f μ) :
    Memℒp (fun x => ‖f x‖) p μ ↔ Memℒp f p μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.Memℒp (fun x => ‖f x‖) p μ ↔ MeasureTheory.Memℒp f p μ


/-- The supremum of a singleton is the element of the singleton-/
@[simp]
theorem csSup_singleton (a : α) : sSup {a} = a

{α : Type u_1}
[ConditionallyCompleteLattice α]
(a : α)


lemma not_isLimit_natCast : (n : ℕ) → ¬ IsLimit (n : Cardinal.{u})


/-- The weighted sum is unaffected by changing the weights to the
corresponding indicator function and adding points to the set. -/
theorem weightedVSub_indicator_subset (w : ι → k) (p : ι → P) {s₁ s₂ : Finset ι} (h : s₁ ⊆ s₂) :
    s₁.weightedVSub p w = s₂.weightedVSub p (Set.indicator (↑s₁) 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}
(w : ι → k)
(p : ι → P)
{s₁ s₂ : Finset ι}
(h : s₁ ⊆ s₂)

(s₁.weightedVSub p) w = (s₂.weightedVSub p) ((↑s₁).indicator w)


theorem div_eq_filter_card {a b c : ℕ} (hb0 : 0 < b) (hc : a / b ≤ c) :
    a / b = ((Ico 1 c.succ).filter fun x => x * b ≤ a).card

a / b = (Finset.filter (fun x => x * b ≤ a) (Finset.Ico 1 c.succ)).card


{K : Type u_1}
[GroupWithZero K]
[Fintype K]
(a : K)


theorem iff_eq_true_of_eq {a b : Prop} (h : a = b) : (a ↔ b) = True


theorem preimage_boolIndicator_eq_union (t : Set Bool) :
    s.boolIndicator ⁻¹' t = (if true ∈ t then s else ∅) ∪ if false ∈ t then sᶜ else ∅

{α : Type u_1}
(s : Set α)
(t : Set Bool)


nonrec theorem IsPWO.mono (ht : t.IsPWO) : s ⊆ t → s.IsPWO

{α : Type u_2}
[Preorder α]
{s t : Set α}
(ht : t.IsPWO)


/-- If `a ≤ b`, then `(b, +∞) ⊆ (a, +∞)`. In preorders, this is just an implication. If you need
the equivalence in linear orders, use `Ioi_subset_Ioi_iff`. -/
@[gcongr]
theorem Ioi_subset_Ioi (h : a ≤ b) : Ioi b ⊆ Ioi a

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


@[simp]
theorem birkhoffAverage_one' (f : α → α) (g : α → M) : birkhoffAverage R f g 1 = g

(R : Type u_1)
{α : Type u_2}
{M : Type u_3}
[DivisionSemiring R]
[AddCommMonoid M]
[Module R M]
(f : α → α)
(g : α → M)


theorem isBounded_le_atBot : (atBot : Filter α).IsBounded (· ≤ ·)

{α : Type u_1}
[Preorder α]
[Nonempty α]

Filter.IsBounded (fun x x_1 => x ≤ x_1) Filter.atBot


/-- Relation between `Λ s` and the Mellin transform of `f - f₀`, where the latter is defined. -/
theorem hasMellin {s : ℂ} (hs : P.k < s.re) : HasMellin (P.f · - P.f₀) s (P.Λ s)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
[CompleteSpace E]
(P : WeakFEPair E)
{s : ℂ}
(hs : P.k < s.re)

HasMellin (fun x => P.f x - P.f₀) s (P.Λ s)


@[simp]
theorem lsmul_apply (r : R) (m : M) : lsmul R M r m = r • m

{R : Type u_1}
[CommSemiring R]
{M : Type u_5}
[AddCommMonoid M]
[Module R M]
(r : R)
(m : M)


theorem integrableOn_Ico_iff_integrableOn_Ioo :
    IntegrableOn f (Ico a b) μ ↔ IntegrableOn f (Ioo a b) μ

{α : Type u_1}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
[PartialOrder α]
[MeasurableSingletonClass α]
{f : α → E}
{μ : MeasureTheory.Measure α}
{a b : α}
[MeasureTheory.NoAtoms μ]

MeasureTheory.IntegrableOn f (Set.Ico a b) μ ↔ MeasureTheory.IntegrableOn f (Set.Ioo a b) μ


@[deprecated (since := "2024-07-15")]
theorem id_eq {P : Karoubi C} : 𝟙 P = ⟨P.p, by repeat' rw [P.idem]⟩

{P : CategoryTheory.Idempotents.Karoubi C}

CategoryTheory.CategoryStruct.id P = { f := P.p, comm := ⋯ }


theorem mul_left_surjective₀ {a : G₀} (h : a ≠ 0) : Surjective fun g => a * g

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


theorem powersetCard_coe (n) (l : List α) :
    @powersetCard α n l = ((sublistsLen n l).map (↑) : List (Multiset α))

Multiset.powersetCard n ↑l = ↑(List.map Multiset.ofList (List.sublistsLen n l))


@[simp]
theorem generateFrom_insert_univ (S : Set (Set α)) :
    generateFrom (insert Set.univ S) = generateFrom S

MeasurableSpace.generateFrom (insert Set.univ S) = MeasurableSpace.generateFrom S


theorem RingHom.LocalizationPreserves.away (H : RingHom.LocalizationPreserves @P) (r : R)
    [IsLocalization.Away r R'] [IsLocalization.Away (f r) S'] (hf : P f) :
    P (IsLocalization.Away.map R' S' f r)

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


theorem le_ncard_of_inj_on_range {n : ℕ} (f : ℕ → α) (hf : ∀ i < n, f i ∈ s)
    (f_inj : ∀ i < n, ∀ j < n, f i = f j → i = j) (hs : s.Finite := by toFinite_tac) :
    n ≤ s.ncard


@[simp, norm_cast] lemma cast_mul (m n : ℕ) : ((m * n : ℕ) : α) = m * n

{α : Type u_1}
[NonAssocSemiring α]
(m n : ℕ)


/-- If `C` has a terminal object and binary products, then it has a product for objects indexed by
`Fin n`.
This is a helper lemma for `hasFiniteProductsOfHasBinaryAndTerminal`, which is more general
than this.
-/
private theorem hasProduct_fin : ∀ (n : ℕ) (f : Fin n → C), HasProduct f


@[ext]
theorem colimit_obj_ext {H : J ⥤ K ⥤ C} [HasColimitsOfShape J C] {k : K} {W : C}
    {f g : (colimit H).obj k ⟶ W} (w : ∀ j, (colimit.ι H j).app k ≫ f = (colimit.ι H j).app k ≫ g) :
    f = g

{f g : (CategoryTheory.Limits.colimit H).obj k ⟶ W}

(w : ∀ (j : J), (CategoryTheory.Limits.colimit.ι H j).app k ≫ f = (CategoryTheory.Limits.colimit.ι H j).app k ≫ g)


theorem mul_le_edist (hf : AntilipschitzWith K f) (x y : α) :
    (K : ℝ≥0∞)⁻¹ * edist x y ≤ edist (f x) (f y)

{α : Type u_1}
{β : Type u_2}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : AntilipschitzWith K f)
(x y : α)


lemma iterate_cancel (hf : Injective f) (ha : f^[m] a = f^[n] a) : f^[m - n] a = a

{α : Type u}
{f : α → α}
{m n : ℕ}
{a : α}
(hf : Function.Injective f)
(ha : f^[m] a = f^[n] a)


theorem AdjoinMonic.isIntegral (z : AdjoinMonic k) : IsIntegral k z

(k : Type u)
[Field k]
(z : AlgebraicClosure.AdjoinMonic k)


/-- The length of the antidiagonal of `n` is `n + 1`. -/
@[simp]
theorem length_antidiagonal (n : ℕ) : (antidiagonal n).length = n + 1

(List.Nat.antidiagonal n).length = n + 1


theorem martingalePart_add_ae_eq [SigmaFiniteFiltration μ ℱ] {f g : ℕ → Ω → E}
    (hf : Martingale f ℱ μ) (hg : Adapted ℱ fun n => g (n + 1)) (hg0 : g 0 = 0)
    (hgint : ∀ n, Integrable (g n) μ) (n : ℕ) : martingalePart (f + g) ℱ μ n =ᵐ[μ] f n

(hg : MeasureTheory.Adapted ℱ fun n => g (n + 1))

(hgint : ∀ (n : ℕ), MeasureTheory.Integrable (g n) μ)

MeasureTheory.martingalePart (f + g) ℱ μ n =ᵐ[μ] f n


@[reassoc]
theorem comp_val {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) : (f ≫ g).val = f.val ≫ g.val

{X Y Z : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
(g : Y ⟶ Z)


/-- A locally finite preconnected infinite graph has at least one end. -/
lemma nonempty_ends_of_infinite [LocallyFinite G] [Fact G.Preconnected] [Infinite V] :
    G.end.Nonempty

{V : Type}
(G : SimpleGraph V)
[G.LocallyFinite]
[Fact G.Preconnected]
[Infinite V]


theorem factors_unique {f g : Multiset α} (hf : ∀ x ∈ f, Irreducible x)
    (hg : ∀ x ∈ g, Irreducible x) (h : f.prod ~ᵤ g.prod) : Multiset.Rel Associated f g

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
{f g : Multiset α}
(hf : ∀ x ∈ f, Irreducible x)
(hg : ∀ x ∈ g, Irreducible x)
(h : f.prod ~ᵤ g.prod)


theorem mem_dite_univ_left (p : Prop) [Decidable p] (t : ¬p → Set α) (x : α) :
    (x ∈ if h : p then univ else t h) ↔ ∀ h : ¬p, x ∈ t h

{α : Type u}
(p : Prop)
[Decidable p]
(t : ¬p → Set α)
(x : α)

(x ∈ if h : p then Set.univ else t h) ↔ ∀ (h : ¬p), x ∈ t h


@[simp, rclike_simps]
theorem ofRealCLM_coe : (@ofRealCLM K _ : ℝ →ₗ[ℝ] K) = ofRealAm.toLinearMap


@[to_additive (attr := elab_as_elim)]
theorem induction_of_closure_eq_top_right {s : Set M} {p : M → Prop} (hs : closure s = ⊤) (x : M)
    (H1 : p 1) (Hmul : ∀ (x), ∀ y ∈ s, p x → p (x * y)) : p x

(Hmul : ∀ (x y : M), y ∈ s → p x → p (x * y))


@[to_additive]
theorem comp_mul [Mul M] [CommSemigroup N] [CommSemigroup P] (g : N →ₙ* P) (f₁ f₂ : M →ₙ* N) :
    g.comp (f₁ * f₂) = g.comp f₁ * g.comp f₂

{M : Type u_3}
{N : Type u_4}
{P : Type u_5}
[Mul M]
[CommSemigroup N]
[CommSemigroup P]
(g : N →ₙ* P)
(f₁ f₂ : M →ₙ* N)


lemma FamilyOfElements.restrict_map
    (p : FamilyOfElements P R) (φ : P ⟶ Q) {R' : Presieve X} (h : R' ≤ R) :
    (p.restrict h).map φ = (p.map φ).restrict h

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

(p : CategoryTheory.Presieve.FamilyOfElements P R)

(CategoryTheory.Presieve.FamilyOfElements.restrict h p).map φ =
  CategoryTheory.Presieve.FamilyOfElements.restrict h (p.map φ)


theorem eq (hs : IsStrongAntichain r s) {a b c : α} (ha : a ∈ s) (hb : b ∈ s) (hac : r a c)
    (hbc : r b c) : a = b

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
(hs : IsStrongAntichain r s)
{a b c : α}
(ha : a ∈ s)
(hb : b ∈ s)
(hac : r a c)
(hbc : r b c)


/-- A finite sequence of Lp functions is uniformly tight. -/
theorem unifTight_finite [Finite ι] (hp_top : p ≠ ∞) {f : ι → α → β}
    (hf : ∀ i, Memℒp (f i) p μ) : UnifTight f p μ

{f : ι → α → β}

(hf : ∀ (i : ι), MeasureTheory.Memℒp (f i) p μ)


theorem ker_codRestrict {τ₂₁ : R₂ →+* R} (p : Submodule R M) (f : M₂ →ₛₗ[τ₂₁] M) (hf) :
    ker (codRestrict p f hf) = ker f

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_6}
{M₂ : Type u_8}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₂₁ : R₂ →+* R}
(p : Submodule R M)
(f : M₂ →ₛₗ[τ₂₁] M)
(hf : ∀ (c : M₂), f c ∈ p)

LinearMap.ker (LinearMap.codRestrict p f hf) = LinearMap.ker f


@[simp]
theorem mem_toFinset {o : Part α} [Decidable o.Dom] {x : α} : x ∈ o.toFinset ↔ x ∈ o

{α : Type u_1}
{o : Part α}
[Decidable o.Dom]
{x : α}


theorem lintegral_pos_iff_support {f : α → ℝ≥0∞} (hf : Measurable f) :
    (0 < ∫⁻ a, f a ∂μ) ↔ 0 < μ (Function.support f)

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hf : Measurable f)

0 < ∫⁻ (a : α), f a ∂μ ↔ 0 < μ (Function.support f)


@[simp] lemma ofENat_mul (m n : ℕ∞) : ofENat (m * n) = m * n


@[to_additive]
theorem contMDiff_finprod (h : ∀ i, ContMDiff I' I n (f i))
    (hfin : LocallyFinite fun i => mulSupport (f i)) : ContMDiff I' I n fun x => ∏ᶠ i, f i x

(hfin : LocallyFinite fun i => Function.support (f i))

ContMDiff I' I n fun x => ∑ᶠ (i : ι), f i x


@[simp]
theorem restrictScalars_inj {V₁ V₂ : Submodule R M} :
    restrictScalars S V₁ = restrictScalars S V₂ ↔ V₁ = V₂

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

Submodule.restrictScalars S V₁ = Submodule.restrictScalars S V₂ ↔ V₁ = V₂


protected lemma sum_div (hf : ∀ i ∈ s, n ∣ f i) : (∑ i ∈ s, f i) / n = ∑ i ∈ s, f i / n

{ι : Type u_6}
{s : Finset ι}
{f : ι → ℤ}
{n : ℤ}
(hf : ∀ i ∈ s, n ∣ f i)


@[simp]
theorem piComm_symm {φ : α → β → Sort*} : (piComm φ).symm = (piComm <| swap φ)

{α : Sort u_2}
{β : Sort u_3}
{φ : α → β → Sort u_1}

(Equiv.piComm φ).symm = Equiv.piComm (Function.swap φ)


lemma isCoatom_compl_singleton (a : α) : IsCoatom ({a}ᶜ : Finset α)

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


@[simp]
theorem pullback_obj_left (f : X ⟶ Y) (g : MonoOver Y) :
    ((pullback f).obj g : C) = Limits.pullback g.arrow f

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

((CategoryTheory.MonoOver.pullback f).obj g).obj.left = CategoryTheory.Limits.pullback g.arrow f


@[to_additive]
theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β}
    (i : ∀ a ∈ s, f a ≠ 1 → γ) (hi : ∀ a h₁ h₂, i a h₁ h₂ ∈ t)
    (i_inj : ∀ a₁ h₁₁ h₁₂ a₂ h₂₁ h₂₂, i a₁ h₁₁ h₁₂ = i a₂ h₂₁ h₂₂ → a₁ = a₂)
    (i_surj : ∀ b ∈ t, g b ≠ 1 → ∃ a h₁ h₂, i a h₁ h₂ = b) (h : ∀ a h₁ h₂, f a = g (i a h₁ h₂)) :
    ∏ x ∈ s, f x = ∏ x ∈ t, g x

(hi : ∀ (a : α) (h₁ : a ∈ s) (h₂ : f a ≠ 0), i a h₁ h₂ ∈ t)

(i_inj :
  ∀ (a₁ : α) (h₁₁ : a₁ ∈ s) (h₁₂ : f a₁ ≠ 0) (a₂ : α) (h₂₁ : a₂ ∈ s) (h₂₂ : f a₂ ≠ 0),
    i a₁ h₁₁ h₁₂ = i a₂ h₂₁ h₂₂ → a₁ = a₂)

(i_surj : ∀ b ∈ t, g b ≠ 0 → ∃ a, ∃ (h₁ : a ∈ s) (h₂ : f a ≠ 0), i a h₁ h₂ = b)

(h : ∀ (a : α) (h₁ : a ∈ s) (h₂ : f a ≠ 0), f a = g (i a h₁ h₂))


theorem add_mod_add_ite (a b c : ℕ) :
    ((a + b) % c + if c ≤ a % c + b % c then c else 0) = a % c + b % c


lemma apply {ι : Type*} {p : ι → Type*} {g : α → ∀ x, p x}
    (h : EventuallyConst g l) (i : ι) : EventuallyConst (g · i) l

{α : Type u_1}
{l : Filter α}
{ι : Type u_5}
{p : ι → Type u_6}
{g : α → (x : ι) → p x}
(h : Filter.EventuallyConst g l)
(i : ι)

Filter.EventuallyConst (fun x => g x i) l


theorem hlast' (i : Fin N.succ) (h : 1 ≤ τ) : a.r (last N) ≤ τ * a.r i

{α : Type u_1}
[MetricSpace α]
{N : ℕ}
{τ : ℝ}
(a : Besicovitch.SatelliteConfig α N τ)
(i : Fin N.succ)
(h : 1 ≤ τ)


@[to_additive (attr := gcongr) sub_le_sub]
theorem div_le_div'' (hab : a ≤ b) (hcd : c ≤ d) : a / d ≤ b / c

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


@[simp, norm_cast]
theorem coe_append (s : Sym α n) (s' : Sym α n') : (s.append s' : Multiset α) = s + s'

{α : Type u_1}
{n n' : ℕ}
(s : Sym α n)
(s' : Sym α n')


theorem union_diff_cancel {s t : Set α} (h : s ⊆ t) : s ∪ t \ s = t


lemma bot_mul_coe_of_pos {x : ℝ} (h : 0 < x) : (⊥ : EReal) * x = ⊥


theorem balanced_iInter {f : ι → Set E} (h : ∀ i, Balanced 𝕜 (f i)) : Balanced 𝕜 (⋂ i, f i)

{𝕜 : Type u_1}
{E : Type u_3}
{ι : Sort u_4}
[SeminormedRing 𝕜]
[SMul 𝕜 E]
{f : ι → Set E}
(h : ∀ (i : ι), Balanced 𝕜 (f i))


/-- If there are distinct ordinals with equal value then
  every value succeding the smaller ordinal are fixed points -/
lemma lfpApprox_mem_fixedPoints_of_eq {a b c : Ordinal}
    (h_init : x ≤ f x) (h_ab : a < b) (h_ac : a ≤ c) (h_fab : lfpApprox f x a = lfpApprox f x b) :
    lfpApprox f x c ∈ fixedPoints f

(h_fab : OrdinalApprox.lfpApprox f x a = OrdinalApprox.lfpApprox f x b)

OrdinalApprox.lfpApprox f x c ∈ Function.fixedPoints ⇑f


theorem IsCycleOn.extendDomain {p : β → Prop} [DecidablePred p] (f : α ≃ Subtype p)
    (h : g.IsCycleOn s) : (g.extendDomain f).IsCycleOn ((↑) ∘ f '' s)

{α : Type u_2}
{β : Type u_3}
{g : Equiv.Perm α}
{s : Set α}
{p : β → Prop}
[DecidablePred p]
(f : α ≃ Subtype p)
(h : g.IsCycleOn s)

(g.extendDomain f).IsCycleOn (Subtype.val ∘ ⇑f '' s)


@[aesop safe apply (rule_sets := [SetLike])]
theorem intCast_mem (n : ℤ) : (n : R) ∈ s

{R : Type u}
{S : Type v}
[Ring R]
[SetLike S R]
[hSR : SubringClass S R]
(s : S)
(n : ℤ)


@[to_additive (attr := simp)]
theorem isLUB_inv : IsLUB s⁻¹ a ↔ IsGLB s a⁻¹

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

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


@[simp]
theorem centralizer_univ {R} [Semiring R] : centralizer Set.univ = center R

Subsemiring.centralizer Set.univ = Subsemiring.center R


/-- A subgroup is closed under division. -/
@[to_additive "An `AddSubgroup` is closed under subtraction."]
protected theorem div_mem {x y : G} (hx : x ∈ H) (hy : y ∈ H) : x / y ∈ H

{G : Type u_1}
[AddGroup G]
(H : AddSubgroup G)
{x y : G}
(hx : x ∈ H)
(hy : y ∈ H)


theorem _root_.Multiset.toFinset_card_eq_one_iff [DecidableEq α] (s : Multiset α) :
    s.toFinset.card = 1 ↔ Multiset.card s ≠ 0 ∧ ∃ a : α, s = Multiset.card s • {a}

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

s.toFinset.card = 1 ↔ Multiset.card s ≠ 0 ∧ ∃ a, s = Multiset.card s • {a}


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

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{D1 D2 : LieDerivation R L L}
(a : L)


theorem subtypeEquivCodomain_symm_apply_ne
    (f : { x' // x' ≠ x } → Y) (y : Y) (x' : X) (h : x' ≠ x) :
    ((subtypeEquivCodomain f).symm y : X → Y) x' = f ⟨x', h⟩

{X : Sort u_2}
[DecidableEq X]
{x : X}
{Y : Sort u_1}
(f : { x' // x' ≠ x } → Y)
(y : Y)
(x' : X)
(h : x' ≠ x)

↑((Equiv.subtypeEquivCodomain f).symm y) x' = f ⟨x', h⟩


@[simp] lemma intCast_mul_right (h : Commute a b) (m : ℤ) : Commute a (m * b)

{α : Type u_3}
[Ring α]
{a b : α}
(h : Commute a b)
(m : ℤ)


lemma set_smul_mono_left {s t : Set S} (le : s ≤ t) :
    s • N ≤ t • N

{R : Type u_2}
{M : Type u_3}
[Semiring R]
{S : Type u_4}
[Monoid S]
[AddCommMonoid M]
[Module R M]
[DistribMulAction S M]
(N : Submodule R M)
{s t : Set S}
(le : s ≤ t)


@[to_additive] lemma prod_eq_one_iff : l.prod = 1 ↔ ∀ x ∈ l, x = (1 : M)

{M : Type u_3}
[CanonicallyOrderedAddCommMonoid M]
{l : List M}


theorem mk_bounded_subset {α : Type*} (h : ∀ x < #α, (2^x) < #α) {r : α → α → Prop}
    [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α

{α : Type u_2}
(h : ∀ x < #α, 2 ^ x < #α)
{r : α → α → Prop}
[IsWellOrder α r]
(hr : (#α).ord = Ordinal.type r)


@[reassoc (attr := simp)]
theorem right_comp_retraction (f g : A ⟶ B) [IsCoreflexivePair f g] :
    g ≫ commonRetraction f g = 𝟙 A

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{A B : C}
(f g : A ⟶ B)
[CategoryTheory.IsCoreflexivePair f g]

CategoryTheory.CategoryStruct.comp g (CategoryTheory.commonRetraction f g) = CategoryTheory.CategoryStruct.id A


theorem dist_eq : dist f g = sInf { C | 0 ≤ C ∧ ∀ x : α, dist (f x) (g x) ≤ C }

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
{f g : BoundedContinuousFunction α β}

dist f g = sInf {C | 0 ≤ C ∧ ∀ (x : α), dist (f x) (g x) ≤ C}


@[simp]
theorem of_zero_pow (a : A 0) : ∀ n : ℕ, of A 0 (a ^ n) = of A 0 a ^ n

{ι : Type u_1}
[DecidableEq ι]
(A : ι → Type u_2)
[(i : ι) → AddCommMonoid (A i)]
[AddMonoid ι]
[DirectSum.GSemiring A]
(a : A 0)
(n : ℕ)

(DirectSum.of A 0) (a ^ n) = (DirectSum.of A 0) a ^ n


/-- `QuaternionAlgebra.linearEquivTuple` as a `LinearIsometryEquiv`. -/
@[simps apply symm_apply]
noncomputable def linearIsometryEquivTuple : ℍ ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin 4)

Quaternion.linearIsometryEquivTuple.symm a = { re := a 0, imI := a 1, imJ := a 2, imK := a 3 }


@[simp]
theorem mem_blur' (q : Semiquot α) {s : Set α} (h : q.s ⊆ s) {a : α} : a ∈ blur' q h ↔ a ∈ s

{α : Type u_1}
(q : Semiquot α)
{s : Set α}
(h : q.s ⊆ s)
{a : α}


@[simp]
theorem consRecOn_empty {motive : Word M → Sort*} (h_empty : motive empty)
    (h_cons : ∀ (i) (m : M i) (w) h1 h2, motive w → motive (cons m w h1 h2)) :
    consRecOn empty h_empty h_cons = h_empty

{motive : Monoid.CoprodI.Word M → Sort u_4}

(h_empty : motive Monoid.CoprodI.Word.empty)

(h_cons :
  (i : ι) →
    (m : M i) →
      (w : Monoid.CoprodI.Word M) →
        (h1 : w.fstIdx ≠ some i) → (h2 : m ≠ 1) → motive w → motive (Monoid.CoprodI.Word.cons m w h1 h2))

Monoid.CoprodI.Word.consRecOn Monoid.CoprodI.Word.empty h_empty h_cons = h_empty


@[to_additive]
lemma prod_preimage' (f : ι → κ) [DecidablePred (· ∈ Set.range f)] (s : Finset κ) (hf) (g : κ → β) :
    ∏ x ∈ s.preimage f hf, g (f x) = ∏ x ∈ s.filter (· ∈ Set.range f), g x

[DecidablePred fun x => x ∈ Set.range f]

∏ x ∈ s.preimage f hf, g (f x) = ∏ x ∈ Finset.filter (fun x => x ∈ Set.range f) s, g x


theorem trans_toRingEquiv (f : α ≃+*o β) (g : β ≃+*o γ) :
    (OrderRingIso.trans f g).toRingEquiv = RingEquiv.trans f.toRingEquiv g.toRingEquiv

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Mul α]
[Add α]
[LE α]
[Mul β]
[Add β]
[LE β]
[Mul γ]
[Add γ]
[LE γ]
(f : α ≃+*o β)
(g : β ≃+*o γ)

(f.trans g).toRingEquiv = f.trans g.toRingEquiv


/--
The closure of a singleton `{a}` in the lower topology is the left-closed right-infinite interval
[a, ∞).
-/
@[simp]
theorem closure_singleton (a : α) : closure {a} = Ici a

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]
[Topology.IsLower α]
(a : α)


@[to_additive]
theorem leftInv_eq_inv : S.leftInv = S⁻¹

{M : Type u_1}
[AddGroup M]
(S : AddSubmonoid M)


theorem div_tendsto_atTop_of_degree_gt (hdeg : Q.degree < P.degree) (hQ : Q ≠ 0)
    (hnng : 0 ≤ P.leadingCoeff / Q.leadingCoeff) :
    Tendsto (fun x => eval x P / eval x Q) atTop atTop

Filter.Tendsto (fun x => Polynomial.eval x P / Polynomial.eval x Q) Filter.atTop Filter.atTop


@[ext]
theorem ext : (s : Set α) = t → s = t


theorem UniformEmbedding.comp {g : β → γ} (hg : UniformEmbedding g) {f : α → β}
    (hf : UniformEmbedding f) : UniformEmbedding (g ∘ f)

{α : Type u}
{β : Type v}
{γ : Type w}
[UniformSpace α]
[UniformSpace β]
[UniformSpace γ]
{g : β → γ}
(hg : UniformEmbedding g)
{f : α → β}
(hf : UniformEmbedding f)


@[to_additive (attr := simp)]
theorem inv_eq_one : a⁻¹ = 1 ↔ a = 1

{α : Type u_1}
[DivisionMonoid α]
{a : α}


theorem age.jointEmbedding : JointEmbedding (L.age M)

{L : FirstOrder.Language}
(M : Type w)
[L.Structure M]


/-- For the `I`-adic topology, the neighborhoods of zero has basis given by the powers of `I`. -/
theorem hasBasis_nhds_zero_adic (I : Ideal R) :
    HasBasis (@nhds R I.adicTopology (0 : R)) (fun _n : ℕ => True) fun n =>
      ((I ^ n : Ideal R) : Set R)

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

(𝓝 0).HasBasis (fun _n => True) fun n => ↑(I ^ n)


theorem HasBasis.principal_inf (hl : l.HasBasis p s) (s' : Set α) :
    (𝓟 s' ⊓ l).HasBasis p fun i => s' ∩ s i

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


theorem Sized.balance' {l x r} (hl : @Sized α l) (hr : Sized r) : Sized (balance' l x r)

{α : Type u_1}
{l : Ordnode α}
{x : α}
{r : Ordnode α}
(hl : l.Sized)
(hr : r.Sized)


theorem norm_map (u : unitary (H →L[𝕜] H)) (x : H) : ‖(u : H →L[𝕜] H) x‖ = ‖x‖

{𝕜 : Type u_1}
[RCLike 𝕜]
{H : Type u_5}
[NormedAddCommGroup H]
[InnerProductSpace 𝕜 H]
[CompleteSpace H]
(u : ↥(unitary (H →L[𝕜] H)))
(x : H)

‖↑u x‖ = ‖x‖


/-- The difference of two completed even Hurwitz zeta functions is differentiable at `s = 1`. -/
lemma differentiableAt_one_completedHurwitzZetaEven_sub_completedHurwitzZetaEven
    (a b : UnitAddCircle) :
    DifferentiableAt ℂ (fun s ↦ completedHurwitzZetaEven a s - completedHurwitzZetaEven b s) 1

DifferentiableAt ℂ (fun s => HurwitzZeta.completedHurwitzZetaEven a s - HurwitzZeta.completedHurwitzZetaEven b s) 1


lemma angle_one_right (hx : x ≠ 0) : angle x 1 = |x.arg|

InnerProductGeometry.angle x 1 = |x.arg|


theorem BddAbove.bddAbove_image2_of_bddBelow :
    BddAbove s → BddBelow t → BddAbove (Set.image2 f s t)

{f : α → β → γ}

(h₀ : ∀ (b : β), Monotone (Function.swap f b))


lemma Functor.cover_lift [G.IsCocontinuous J K] {U : C} {S : Sieve (G.obj U)}
    (hS : S ∈ K (G.obj U)) : S.functorPullback G ∈ J U

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

CategoryTheory.Sieve.functorPullback G S ∈ J.sieves U


@[to_additive]
private lemma devosMulRel_of_le (mul : (x.1 * x.2).card ≤ (y.1 * y.2).card)
    (hadd : y.1.card + y.2.card < x.1.card + x.2.card) : DevosMulRel x y


@[simp]
theorem toLinearMap_toOpposite (f : A →ₐ[R] B) (hf : ∀ x y, Commute (f x) (f y)) :
    (f.toOpposite hf).toLinearMap = (opLinearEquiv R : B ≃ₗ[R] Bᵐᵒᵖ) ∘ₗ f.toLinearMap

{R : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : A →ₐ[R] B)
(hf : ∀ (x y : A), Commute (f x) (f y))

(f.toOpposite hf).toLinearMap = ↑(MulOpposite.opLinearEquiv R) ∘ₗ f.toLinearMap


theorem isometryEquiv_comap_mkMetric (m : ℝ≥0∞ → ℝ≥0∞) (f : X ≃ᵢ Y) :
    comap f (mkMetric m) = mkMetric m

{X : Type u_2}
{Y : Type u_3}
[EMetricSpace X]
[EMetricSpace Y]
(m : ℝ≥0∞ → ℝ≥0∞)
(f : X ≃ᵢ Y)

(MeasureTheory.OuterMeasure.comap ⇑f) (MeasureTheory.OuterMeasure.mkMetric m) = MeasureTheory.OuterMeasure.mkMetric m


theorem replicate_succ {a : α} {n : ℕ} : replicate n.succ a = a ::ₛ replicate n a

Sym.replicate n.succ a = a ::ₛ Sym.replicate n a


theorem le_div {a b c : Ordinal} (c0 : c ≠ 0) : a ≤ b / c ↔ c * a ≤ b


@[simp]
theorem range_re : range re = univ


theorem HasGradientAt.unique {gradf gradg : F}
    (hf : HasGradientAt f gradf x) (hg : HasGradientAt f gradg x) :
    gradf = gradg

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{x gradf gradg : F}
(hf : HasGradientAt f gradf x)
(hg : HasGradientAt f gradg x)


theorem ratio_ne_zero [DilationClass F α β] (f : F) : ratio f ≠ 0

{α : Type u_1}
{β : Type u_2}
{F : Type u_4}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
[FunLike F α β]
[DilationClass F α β]
(f : F)


/-- The oriented angle between two vectors equals the unoriented angle if the sign is positive. -/
theorem oangle_eq_angle_of_sign_eq_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 comap_iInf_map_of_injective (S : ι → L.Substructure M) :
    (⨅ i, (S i).map f).comap f = iInf S

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{ι : Type u_3}
{f : L.Hom M N}
(hf : Function.Injective ⇑f)
(S : ι → L.Substructure M)

FirstOrder.Language.Substructure.comap f (⨅ i, FirstOrder.Language.Substructure.map f (S i)) = iInf S


theorem Convex.lipschitzWith_gauge {r : ℝ≥0} (hc : Convex ℝ s) (hr : 0 < r)
    (hs : Metric.ball (0 : E) r ⊆ s) : LipschitzWith r⁻¹ (gauge s)

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{s : Set E}
{r : ℝ≥0}
(hc : Convex ℝ s)
(hr : 0 < r)
(hs : Metric.ball 0 ↑r ⊆ s)


@[simp] theorem pop_data (arr : Array α) : arr.pop.data = arr.data.dropLast


@[to_additive]
lemma prod_fiberwise [DecidableEq κ] (g : ι → κ) (f : ι → α) :
    ∏ j, ∏ i : {i // g i = j}, f i = ∏ i, f i

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[Fintype ι]
[Fintype κ]
[CommMonoid α]
[DecidableEq κ]
(g : ι → κ)
(f : ι → α)

∏ j : κ, ∏ i : { i // g i = j }, f ↑i = ∏ i : ι, f i


/-- The image of a Haar measure under a continuous surjective proper group homomorphism is again
a Haar measure. See also `MulEquiv.isHaarMeasure_map`. -/
@[to_additive
"The image of an additive Haar measure under a continuous surjective proper additive group
homomorphism is again an additive Haar measure. See also `AddEquiv.isAddHaarMeasure_map`."]
theorem isHaarMeasure_map [BorelSpace G] [TopologicalGroup G] {H : Type*} [Group H]
    [TopologicalSpace H] [MeasurableSpace H] [BorelSpace H] [T2Space H] [TopologicalGroup H]
    (f : G →* H) (hf : Continuous f) (h_surj : Surjective f)
    (h_prop : Tendsto f (cocompact G) (cocompact H)) : IsHaarMeasure (Measure.map f μ)

(h_prop : Filter.Tendsto (⇑f) (Filter.cocompact G) (Filter.cocompact H))


@[simp, rclike_simps]
theorem normSq_pos {z : K} : 0 < normSq z ↔ z ≠ 0


theorem iSup_add_iSup {ι : Sort*} {f g : ι → ℝ≥0∞} (h : ∀ i j, ∃ k, f i + g j ≤ f k + g k) :
    iSup f + iSup g = ⨆ a, f a + g a

(h : ∀ (i j : ι), ∃ k, f i + g j ≤ f k + g k)


theorem mem_unitaryGroup_iff : A ∈ Matrix.unitaryGroup n α ↔ A * star A = 1

{n : Type u}
[DecidableEq n]
[Fintype n]
{α : Type v}
[CommRing α]
[StarRing α]
{A : Matrix n n α}


theorem mem_iff_get {a} {l : List α} : a ∈ l ↔ ∃ n, get l n = a


/-- Face of a box in `ℝⁿ⁺¹ = Fin (n + 1) → ℝ`: the box in `ℝⁿ = Fin n → ℝ` with corners at
`I.lower ∘ Fin.succAbove i` and `I.upper ∘ Fin.succAbove i`. -/
@[simps (config := { simpRhs := true })]
def face {n} (I : Box (Fin (n + 1))) (i : Fin (n + 1)) : Box (Fin n)

{n : ℕ}
(I : BoxIntegral.Box (Fin (n + 1)))
(i : Fin (n + 1))

∀ (a : Fin n), (I.face i).lower a = I.lower (i.succAbove a)


theorem norm_def' (a : 𝓜(𝕜, A)) : ‖a‖ = ‖toProdMulOppositeHom a‖

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]
(a : 𝓜(𝕜, A))

‖a‖ = ‖DoubleCentralizer.toProdMulOppositeHom a‖


@[simp]
theorem fromBlocks_one : fromBlocks (1 : Matrix l l α) 0 0 (1 : Matrix m m α) = 1

{l : Type u_1}
{m : Type u_2}
{α : Type u_12}
[DecidableEq l]
[DecidableEq m]
[Zero α]
[One α]


@[to_additive ite_nonneg]
lemma one_le_ite [LE α] (ha : 1 ≤ a) (hb : 1 ≤ b) : 1 ≤ ite p a b

{α : Type u_2}
[Zero α]
{p : Prop}
[Decidable p]
{a b : α}
[LE α]
(ha : 0 ≤ a)
(hb : 0 ≤ b)


theorem ball_disjoint_closedBall (h : δ + ε ≤ dist x y) : Disjoint (ball x δ) (closedBall y ε)

{α : Type u}
[PseudoMetricSpace α]
{x y : α}
{δ ε : ℝ}
(h : δ + ε ≤ dist x y)

Disjoint (Metric.ball x δ) (Metric.closedBall y ε)


theorem familyOfElements_compatible : hx.familyOfElements.Compatible

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

{x : (i : I) → P.obj (Opposite.op (X i))}

(hx : CategoryTheory.Presieve.Arrows.Compatible P π x)


theorem Subfield.isClosed_topologicalClosure (s : Subfield α) :
    IsClosed (s.topologicalClosure : Set α)

{α : Type u_2}
[Field α]
[TopologicalSpace α]
[TopologicalDivisionRing α]
(s : Subfield α)


protected theorem pow' {p a : α} (hp : Prime p) (ha : Finite p a) :
    ∀ {k : ℕ}, get (multiplicity p (a ^ k)) (finite_pow hp ha) = k * get (multiplicity p a) ha

{α : Type u_1}
[CancelCommMonoidWithZero α]
[DecidableRel fun x x_1 => x ∣ x_1]
{p a : α}
(hp : Prime p)
(ha : multiplicity.Finite p a)
{k : ℕ}

(multiplicity p (a ^ k)).get ⋯ = k * (multiplicity p a).get ha


lemma measurableSet_countablePartitionSet (n : ℕ) (a : α) :
    MeasurableSet (countablePartitionSet n a)

[h : MeasurableSpace.CountablyGenerated α]

MeasurableSet (MeasurableSpace.countablePartitionSet n a)


theorem map_srange (g : S →ₙ+* T) (f : R →ₙ+* S) : map g (srange f) = srange (g.comp f)

{R : Type u}
{S : Type v}
{T : Type w}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
[NonUnitalNonAssocSemiring T]
(g : S →ₙ+* T)
(f : R →ₙ+* S)

NonUnitalSubsemiring.map g (NonUnitalRingHom.srange f) = NonUnitalRingHom.srange (g.comp f)


theorem map_subtype_embedding_Ico : (Ico a b).map (Embedding.subtype _) = Ico ↑a ↑b

Finset.map (Function.Embedding.subtype fun n => 0 < n) (Finset.Ico a b) = Finset.Ico ↑a ↑b


@[simp]
theorem mem_mk_iff' (p : Submodule R M) (h) {x : M} :
    x ∈ (⟨p, h⟩ : LieSubmodule R L M) ↔ x ∈ p

(h : ∀ {x : L} {m : M}, m ∈ p.carrier → ⁅x, m⁆ ∈ p.carrier)

x ∈ { toSubmodule := p, lie_mem := h } ↔ x ∈ p


theorem And.imp_left (h : a → b) : a ∧ c → b ∧ c


theorem equivMapDomain_eq_mapDomain {M} [AddCommMonoid M] (f : α ≃ β) (l : α →₀ M) :
    equivMapDomain f l = mapDomain f l

{α : Type u_1}
{β : Type u_2}
{M : Type u_13}
[AddCommMonoid M]
(f : α ≃ β)
(l : α →₀ M)

Finsupp.equivMapDomain f l = Finsupp.mapDomain (⇑f) l


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

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

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

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


@[to_additive]
theorem mul_eq {x y : PUnit} : x * y = unit


@[simp, norm_cast]
theorem coe_sSup {S : Set (Opens α)} : (↑(sSup S) : Set α) = ⋃ i ∈ S, ↑i

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


/-- A complemented modular coatomic lattice is strongly coatomic.
Not an instance to prevent loops. -/
theorem ComplementedLattice.isStronglyCoatomic [IsCoatomic α] : IsStronglyCoatomic α

{α : Type u_2}
[Lattice α]
[BoundedOrder α]
[IsModularLattice α]
[ComplementedLattice α]
[IsCoatomic α]


@[mono]
theorem seq_mono {f₁ f₂ : Filter (α → β)} {g₁ g₂ : Filter α} (hf : f₁ ≤ f₂) (hg : g₁ ≤ g₂) :
    f₁.seq g₁ ≤ f₂.seq g₂

{α : Type u}
{β : Type v}
{f₁ f₂ : Filter (α → β)}
{g₁ g₂ : Filter α}
(hf : f₁ ≤ f₂)
(hg : g₁ ≤ g₂)


lemma Monovary.mul_right₀ (hg₁ : 0 ≤ g₁) (hg₂ : 0 ≤ g₂) (h₁ : Monovary f g₁) (h₂ : Monovary f g₂) :
    Monovary f (g₁ * g₂)

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedSemiring α]
[LinearOrderedSemiring β]
{f : ι → α}
{g₁ g₂ : ι → β}
(hg₁ : 0 ≤ g₁)
(hg₂ : 0 ≤ g₂)
(h₁ : Monovary f g₁)
(h₂ : Monovary f g₂)


theorem Tendsto.mono_right {f : α → β} {x : Filter α} {y z : Filter β} (hy : Tendsto f x y)
    (hz : y ≤ z) : Tendsto f x z

{α : Type u}
{β : Type v}
{f : α → β}
{x : Filter α}
{y z : Filter β}
(hy : Filter.Tendsto f x y)
(hz : y ≤ z)


@[simp] theorem zero_ediv : ∀ b : Int, 0 / b = 0


theorem sSup_simples_le (N : Submodule R M) :
    sSup { m : Submodule R M | IsSimpleModule R m ∧ m ≤ N } = N

{R : Type u_2}
[Ring R]
{M : Type u_4}
[AddCommGroup M]
[Module R M]
[IsSemisimpleModule R M]
(N : Submodule R M)

sSup {m | IsSimpleModule R ↥m ∧ m ≤ N} = N


lemma interior_iInter (f : ι → Set α) : interior (⋂ i, f i) = ⋂ i, interior (f i)

{ι : Sort u_1}
{α : Type u_3}
[TopologicalSpace α]
[AlexandrovDiscrete α]
(f : ι → Set α)


/-- Auxiliary definition for `grothendieckTypeToCat`, to speed up elaboration. -/
-- Porting note:
-- `simps` is incorrectly producing Prop-valued projections here,
-- so we manually specify which ones to produce.
-- See https://leanprover.zulipchat.com/#narrow/stream/144837-PR-reviews/topic/!4.233204.20simps.20bug.20.28Grothendieck.20construction.29
@[simps! obj_base obj_fiber_as map_base]
def grothendieckTypeToCatInverse : G.Elements ⥤ Grothendieck (G ⋙ typeToCat)

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
(G : CategoryTheory.Functor C (Type w))

∀ {X Y : G.Elements} (f : X ⟶ Y), ((CategoryTheory.Grothendieck.grothendieckTypeToCatInverse G).map f).base = ↑f


theorem IsEquivalent.div (htu : t ~[l] u) (hvw : v ~[l] w) :
    (fun x ↦ t x / v x) ~[l] fun x ↦ u x / w x

{α : Type u_1}
{β : Type u_2}
[NormedField β]
{t u v w : α → β}
{l : Filter α}
(htu : t ~[l] u)
(hvw : v ~[l] w)

(fun x => t x / v x) ~[l] fun x => u x / w x


@[simp]
theorem tensorUnit_map {X Y} {f : X ⟶ Y} : (𝟙_ (C ⥤ D)).map f = 𝟙 (𝟙_ D)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.MonoidalCategory D]
{X Y : C}
{f : X ⟶ Y}


theorem stdBasis_apply (i : ι) (b : φ i) : stdBasis R φ i b = update (0 : (a : ι) → φ a) i b

(R : Type u_1)
{ι : Type u_2}
[Semiring R]
(φ : ι → Type u_3)
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
[DecidableEq ι]
(i : ι)
(b : φ i)

(LinearMap.stdBasis R φ i) b = Function.update 0 i b


@[simp]
theorem taylor_zero' : taylor (0 : R) = LinearMap.id


@[simp]
theorem restrict_zero {_m0 : MeasurableSpace α} (s : Set α) : (0 : Measure α).restrict s = 0

{α : Type u_2}
{_m0 : MeasurableSpace α}
(s : Set α)


theorem sub_modEq_iff_modEq_add : a - b ≡ c [PMOD p] ↔ a ≡ c + b [PMOD p]

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


@[to_additive (attr := simp)]
theorem self_eq_mul_left : b = a * b ↔ a = 1

{M : Type u}
[AddRightCancelMonoid M]
{a b : M}


lemma neg_sub {x y : EReal} (h1 : x ≠ ⊥ ∨ y ≠ ⊥) (h2 : x ≠ ⊤ ∨ y ≠ ⊤) :
    - (x - y) = - x + y


protected theorem TendstoLocallyUniformly.tendstoLocallyUniformlyOn
    (h : TendstoLocallyUniformly F f p) : TendstoLocallyUniformlyOn F f p s

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


@[simp]
theorem zero_apply (m : ∀ i, M₁ i) : (0 : ContinuousMultilinearMap R M₁ M₂) m = 0

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


theorem _root_.isRoot_of_unity_iff (h : 0 < n) (R : Type*) [CommRing R] [IsDomain R] {ζ : R} :
    ζ ^ n = 1 ↔ ∃ i ∈ n.divisors, (cyclotomic i R).IsRoot ζ

{n : ℕ}
(h : 0 < n)
(R : Type u_2)
[CommRing R]
[IsDomain R]
{ζ : R}

ζ ^ n = 1 ↔ ∃ i ∈ n.divisors, (Polynomial.cyclotomic i R).IsRoot ζ


/-- If `F.cocones` is corepresented by `X`, any cocone is the extension of the colimit cocone by the
corresponding morphism. -/
theorem cocone_fac (s : Cocone F) : (colimitCocone h).extend (homOfCocone h s) = s

(h : CategoryTheory.coyoneda.obj (Opposite.op X) ⋙ CategoryTheory.uliftFunctor.{u₁, v₃} ≅ F.cocones)

(CategoryTheory.Limits.IsColimit.OfNatIso.colimitCocone h).extend
    (CategoryTheory.Limits.IsColimit.OfNatIso.homOfCocone h s) =
  s


/-- Note this also holds for `z = 0`, but we do not need this case for `sin_pi_mul_eq`. -/
theorem integral_cos_mul_cos_pow_even (n : ℕ) (hz : z ≠ 0) :
    (((1 : ℂ) - z ^ 2 / ((n : ℂ) + 1) ^ 2) *
        ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n + 2)) =
      (2 * n + 1 : ℂ) / (2 * n + 2) *
        ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n)


@[simp]
theorem snd_inl [Zero A] (r : R) : (inl r : Unitization R A).snd = 0

{R : Type u_1}
(A : Type u_2)
[Zero A]
(r : R)


theorem Associated.ne_zero_iff [MonoidWithZero α] {a b : α} (h : a ~ᵤ b) : a ≠ 0 ↔ b ≠ 0

{α : Type u_1}
[MonoidWithZero α]
{a b : α}
(h : a ~ᵤ b)


/-- Composition of a continuous map with dense range and a function with dense range has dense
range. -/
theorem DenseRange.comp {g : Y → Z} {f : α → Y} (hg : DenseRange g) (hf : DenseRange f)
    (cg : Continuous g) : DenseRange (g ∘ f)

{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace Y]
[TopologicalSpace Z]
{α : Type u_4}
{g : Y → Z}
{f : α → Y}
(hg : DenseRange g)
(hf : DenseRange f)
(cg : Continuous g)


@[simp]
theorem toAntisymmetrization_ofAntisymmetrization (a : Antisymmetrization α r) :
    toAntisymmetrization r (ofAntisymmetrization r a) = a

{α : Type u_1}
(r : α → α → Prop)
[IsPreorder α r]
(a : Antisymmetrization α r)


@[simp, mfld_simps]
theorem hasMFDerivWithinAt_univ :
    HasMFDerivWithinAt I I' f univ x f' ↔ HasMFDerivAt I I' f x f'

{f' : TangentSpace I x →L[𝕜] TangentSpace I' (f x)}

HasMFDerivWithinAt I I' f Set.univ x f' ↔ HasMFDerivAt I I' f x f'


/-- See also `CompleteLattice.independent_iff_linearIndependent_of_ne_zero`. -/
theorem LinearIndependent.independent_span_singleton (hv : LinearIndependent R v) :
    CompleteLattice.Independent fun i => R ∙ v i

{ι : Type u'}
{R : Type u_2}
{M : Type u_4}
{v : ι → M}
[Ring R]
[AddCommGroup M]
[Module R M]
(hv : LinearIndependent R v)

CompleteLattice.Independent fun i => Submodule.span R {v i}


theorem Eq.congr_left {x y z : α} (h : x = y) : x = z ↔ y = z


lemma isOpen_iff_Iic_compl_or_univ (U : Set α) :
    IsOpen U ↔ (∃ (a : α), U = (Iic a)ᶜ) ∨ U = univ

{α : Type u_1}
[CompleteLinearOrder α]
[TopologicalSpace α]
[Topology.IsScott α]
(U : Set α)

IsOpen U ↔ (∃ a, U = (Set.Iic a)ᶜ) ∨ U = Set.univ


theorem disjoint_span_singleton {K E : Type*} [DivisionRing K] [AddCommGroup E] [Module K E]
    {s : Submodule K E} {x : E} : Disjoint s (K ∙ x) ↔ x ∈ s → x = 0

{K : Type u_9}
{E : Type u_10}
[DivisionRing K]
[AddCommGroup E]
[Module K E]
{s : Submodule K E}
{x : E}

Disjoint s (Submodule.span K {x}) ↔ x ∈ s → x = 0


/--
If `F ⊣ G` and `F' ⊣ G'` are adjunctions, then giving a natural isomorphism `G ≅ G'` is the
same as giving a natural transformation `F' ≅ F`.
-/
@[simps]
def natIsoEquiv {F F' : C ⥤ D} {G G' : D ⥤ C} (adj1 : F ⊣ G) (adj2 : F' ⊣ G') :
    (G ≅ G') ≃ (F' ≅ F)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
{F F' : C ⥤ D}
{G G' : D ⥤ C}
(adj1 : F ⊣ G)
(adj2 : F' ⊣ G')
(i : G ≅ G')

((adj1.natIsoEquiv adj2) i).hom = (adj1.natTransEquiv adj2) i.hom


/-- A package with a name known at type-level. -/
structure NPackage (name : Name) extends Package where
  name_eq : toPackage.name = name

{name : Lake.Name}
(self : Lake.NPackage name)


/-- ε-characterization of the closure in pseudoemetric spaces -/
theorem mem_closure_iff : x ∈ closure s ↔ ∀ ε > 0, ∃ y ∈ s, edist x y < ε

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


theorem toJordanDecomposition_zero : (0 : SignedMeasure α).toJordanDecomposition = 0

MeasureTheory.SignedMeasure.toJordanDecomposition 0 = 0


@[to_additive (attr := simp)]
theorem Quotient.mk_smul_out' [QuotientAction β H] (b : β) (q : α ⧸ H) :
    QuotientGroup.mk (b • q.out') = b • q

{α : Type u}
{β : Type v}
[AddGroup α]
[AddMonoid β]
[AddAction β α]
(H : AddSubgroup α)
[AddAction.QuotientAction β H]
(b : β)
(q : α ⧸ H)


lemma abs_cpow_inv_two_im (x : ℂ) : |(x ^ (2⁻¹ : ℂ)).im| = sqrt ((abs x - x.re) / 2)

|(x ^ 2⁻¹).im| = √((Complex.abs x - x.re) / 2)


@[simp]
theorem BinaryBiproduct.bicone_snd : (BinaryBiproduct.bicone X Y).snd = biprod.snd

(CategoryTheory.Limits.BinaryBiproduct.bicone X Y).snd = CategoryTheory.Limits.biprod.snd


/-- `LinearMap.inr` as an isometry. -/
@[simps!]
def Isometry.inr (Q₁ : QuadraticMap R M₁ P) (Q₂ : QuadraticMap R M₂ P) : Q₂ →qᵢ (Q₁.prod Q₂)

{R : Type u_2}
{M₁ : Type u_3}
{M₂ : Type u_4}
{P : Type u_7}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid P]
[Module R M₁]
[Module R M₂]
[Module R P]
(Q₁ : QuadraticMap R M₁ P)
(Q₂ : QuadraticMap R M₂ P)
(i : M₂)

(QuadraticMap.Isometry.inr Q₁ Q₂) i = (0, i)


@[simp]
theorem pathEquivList_symm_cons (l : List α) (a : α) :
    pathEquivList.symm (a :: l) = Path.cons (pathEquivList.symm l) a

Quiver.SingleObj.pathEquivList.symm (a :: l) = (Quiver.SingleObj.pathEquivList.symm l).cons a


@[simp]
theorem sumLexDualAntidistrib_symm_inl :
    (sumLexDualAntidistrib α β).symm (inl (toDual b)) = toDual (inr b)

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

(OrderIso.sumLexDualAntidistrib α β).symm (Sum.inl (OrderDual.toDual b)) = OrderDual.toDual (Sum.inr b)


@[simp]
theorem TotalSpace.range_mk (b : B) : range ((↑) : E b → TotalSpace F E) = π F E ⁻¹' {b}

{B : Type u_1}
{F : Type u_2}
{E : B → Type u_3}
(b : B)

Set.range (Bundle.TotalSpace.mk b) = Bundle.TotalSpace.proj ⁻¹' {b}


protected theorem derivWithin (hxs : UniqueDiffWithinAt 𝕜 s x) :
    derivWithin (fun x => p.eval x) s x = p.derivative.eval x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{s : Set 𝕜}
(p : 𝕜[X])
(hxs : UniqueDiffWithinAt 𝕜 s x)

derivWithin (fun x => Polynomial.eval x p) s x = Polynomial.eval x (Polynomial.derivative p)


theorem IsIntegral.of_subring {x : B} (T : Subring R) (hx : IsIntegral T x) : IsIntegral R x

{R : Type u_1}
{B : Type u_3}
[CommRing R]
[Ring B]
[Algebra R B]
{x : B}
(T : Subring R)
(hx : IsIntegral (↥T) x)


@[to_additive] lemma IsUnit.pow (n : ℕ) : IsUnit a → IsUnit (a ^ n)

{M : Type u_1}
[Monoid M]
{a : M}
(n : ℕ)


@[to_additive]
theorem conj_mem' (nH : H.Normal) (n : G) (hn : n ∈ H) (g : G) :
    g⁻¹ * n * g ∈ H

{G : Type u_1}
[Group G]
{H : Subgroup G}
(nH : H.Normal)
(n : G)
(hn : n ∈ H)
(g : G)


theorem Tendsto.congr' {f₁ f₂ : α → β} {l₁ : Filter α} {l₂ : Filter β} (hl : f₁ =ᶠ[l₁] f₂)
    (h : Tendsto f₁ l₁ l₂) : Tendsto f₂ l₁ l₂

{α : Type u}
{β : Type v}
{f₁ f₂ : α → β}
{l₁ : Filter α}
{l₂ : Filter β}
(hl : f₁ =ᶠ[l₁] f₂)
(h : Filter.Tendsto f₁ l₁ l₂)


theorem Int.pow_add_pow {x y : ℤ} (hxy : ↑p ∣ x + y) (hx : ¬↑p ∣ x) {n : ℕ} (hn : Odd n) :
    multiplicity (↑p) (x ^ n + y ^ n) = multiplicity (↑p) (x + y) + multiplicity p n

{p : ℕ}
(hp : Nat.Prime p)
(hp1 : Odd p)
{x y : ℤ}
(hxy : ↑p ∣ x + y)
(hx : ¬↑p ∣ x)
{n : ℕ}
(hn : Odd n)


@[simp, norm_cast]
theorem coe_prodMap' {D : Type*} [Semiring D] [TopologicalSpace D] [Algebra R D] (f₁ : A →A[R] B)
    (f₂ : C →A[R] D) : ⇑(f₁.prodMap f₂) = Prod.map f₁ f₂

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
{B : Type u_3}
[Semiring B]
[TopologicalSpace B]
[Algebra R A]
[Algebra R B]
{C : Type u_4}
[Semiring C]
[Algebra R C]
[TopologicalSpace C]
{D : Type u_6}
[Semiring D]
[TopologicalSpace D]
[Algebra R D]
(f₁ : A →A[R] B)
(f₂ : C →A[R] D)


@[simp] lemma logHomeomorph_symm : logHomeomorph.symm = expHomeomorph


@[to_additive]
theorem mem_prod_list_ofFn {a : α} {s : Fin n → Finset α} :
    a ∈ (List.ofFn s).prod ↔ ∃ f : ∀ i : Fin n, s i, (List.ofFn fun i => (f i : α)).prod = a

{α : Type u_2}
[DecidableEq α]
[AddMonoid α]
{n : ℕ}
{a : α}
{s : Fin n → Finset α}

a ∈ (List.ofFn s).sum ↔ ∃ f, (List.ofFn fun i => ↑(f i)).sum = a


@[symm]
protected theorem Monovary.symm (h : Monovary f g) : Monovary g f

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[LinearOrder β]
{f : ι → α}
{g : ι → β}
(h : Monovary f g)


/-- If an antitone function sending `top` to `bot` is continuous at the indexed infimum over
a `Sort`, then it sends this indexed infimum to the indexed supremum of the composition. -/
theorem Antitone.map_iInf_of_continuousAt {ι : Sort*} {f : α → β} {g : ι → α}
    (Cf : ContinuousAt f (iInf g)) (Af : Antitone f) (ftop : f ⊤ = ⊥) : f (iInf g) = iSup (f ∘ g)

{α : Type u_1}
{β : Type u_2}
[CompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[CompleteLinearOrder β]
[TopologicalSpace β]
[OrderClosedTopology β]
{ι : Sort u_4}
{f : α → β}
{g : ι → α}
(Cf : ContinuousAt f (iInf g))
(Af : Antitone f)
(ftop : f ⊤ = ⊥)


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


theorem prod_embeddings_eq_finrank_pow [Algebra L F] [IsScalarTower K L F] [IsAlgClosed E]
    [Algebra.IsSeparable K F] [FiniteDimensional K F] (pb : PowerBasis K L) :
    ∏ σ : F →ₐ[K] E, σ (algebraMap L F pb.gen) =
      ((@Finset.univ _ (PowerBasis.AlgHom.fintype pb)).prod
        fun σ : L →ₐ[K] E => σ pb.gen) ^ finrank L F

{K : Type u_4}
{L : Type u_5}
(F : Type u_6)
[Field K]
[Field L]
[Field F]
[Algebra K L]
[Algebra K F]
(E : Type u_7)
[Field E]
[Algebra K E]
[Algebra L F]
[IsScalarTower K L F]
[IsAlgClosed E]
[Algebra.IsSeparable K F]
[FiniteDimensional K F]
(pb : PowerBasis K L)

∏ σ : F →ₐ[K] E, σ ((algebraMap L F) pb.gen) = (∏ σ : L →ₐ[K] E, σ pb.gen) ^ FiniteDimensional.finrank L F


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


theorem isRegular_bot : IsRegular (⊥ : α)


@[simp]
theorem mem_restrict : J₁ ∈ π.restrict J ↔ ∃ J' ∈ π, (J₁ : WithBot (Box ι)) = ↑J ⊓ ↑J'

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

J₁ ∈ π.restrict J ↔ ∃ J' ∈ π, ↑J₁ = ↑J ⊓ ↑J'


theorem iterate_injOn_Iio_minimalPeriod : (Iio <| minimalPeriod f x).InjOn (f^[·] x)

Set.InjOn (fun x_1 => f^[x_1] x) (Set.Iio (Function.minimalPeriod f x))


@[simp] lemma num_pow (q : ℚ≥0) (n : ℕ) : (q ^ n).num = q.num ^ n


theorem orderIsoMapComap_symm_apply' (e : M ≃ₛₗ[τ₁₂] M₂) (p : Submodule R₂ M₂) :
    (orderIsoMapComap e).symm p = map e.symm p

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
{τ₂₁ : R₂ →+* R}
[RingHomInvPair τ₁₂ τ₂₁]
[RingHomInvPair τ₂₁ τ₁₂]
(e : M ≃ₛₗ[τ₁₂] M₂)
(p : Submodule R₂ M₂)

(Submodule.orderIsoMapComap e).symm p = Submodule.map e.symm p


/-- The quotient of a second countable space by a group action is second countable. -/
@[to_additive "The quotient of a second countable space by an additive group action is second
countable."]
theorem ContinuousConstSMul.secondCountableTopology [SecondCountableTopology T]
    [ContinuousConstSMul Γ T] : SecondCountableTopology (Quotient (MulAction.orbitRel Γ T))

{Γ : Type u_4}
[AddGroup Γ]
{T : Type u_5}
[TopologicalSpace T]
[AddAction Γ T]
[SecondCountableTopology T]
[ContinuousConstVAdd Γ T]

SecondCountableTopology (Quotient (AddAction.orbitRel Γ T))


@[simp]
theorem lift_of : lift of = MonoidHom.id (Abelianization G)

Abelianization.lift Abelianization.of = MonoidHom.id (Abelianization G)


/-- Turn a limit of `F : J ⥤ Cᵒᵖ` into a colimit of `F.leftOp : Jᵒᵖ ⥤ C`. -/
@[simps]
def isColimitCoconeLeftOpOfCone (F : J ⥤ Cᵒᵖ) {c : Cone F} (hc : IsLimit c) :
    IsColimit (coconeLeftOpOfCone c)

(s : CategoryTheory.Limits.Cocone F.leftOp)

(CategoryTheory.Limits.isColimitCoconeLeftOpOfCone F hc).desc s =
  (hc.lift (CategoryTheory.Limits.coneOfCoconeLeftOp s)).unop


lemma lt_iff_max'_mem {s t : Colex α} :
    s < t ↔ ∃ h : s ≠ t, (ofColex s ∆ ofColex t).max' (max_mem_aux h) ∈ ofColex t

{α : Type u_1}
[LinearOrder α]
{s t : Finset.Colex α}

s < t ↔ ∃ (h : s ≠ t), (symmDiff s.ofColex t.ofColex).max' ⋯ ∈ t.ofColex


theorem sshiftRight_eq {x : BitVec n} {i : Nat} :
    x.sshiftRight i = BitVec.ofInt n (x.toInt >>> i)


theorem rcons_eq_smul {i} (p : Pair M i) :
    rcons p = of p.head • p.tail

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
[(i : ι) → DecidableEq (M i)]
[DecidableEq ι]
{i : ι}
(p : Monoid.CoprodI.Word.Pair M i)

Monoid.CoprodI.Word.rcons p = Monoid.CoprodI.of p.head • p.tail


/-- The Čech conerve construction, as a functor from `Arrow C`. -/
@[simps]
def cechConerve : Arrow C ⥤ CosimplicialObject C

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

∀ {X Y : CategoryTheory.Arrow C} (F : X ⟶ Y),
  CategoryTheory.CosimplicialObject.cechConerve.map F = CategoryTheory.Arrow.mapCechConerve F


@[reassoc (attr := simp)]
lemma pullback.lift_fst {W : Stonean} (a : W ⟶ X) (b : W ⟶ Y) (w : a ≫ f = b ≫ i) :
    pullback.lift f hi a b w ≫ pullback.fst f hi = a

{X Y Z : Stonean}
(f : X ⟶ Z)
{i : Y ⟶ Z}
(hi : OpenEmbedding ⇑i)
{W : Stonean}
(a : W ⟶ X)
(b : W ⟶ Y)
(w : a ≫ f = b ≫ i)

Stonean.pullback.lift f hi a b w ≫ Stonean.pullback.fst f hi = a


@[simp]
theorem map_id (p : G.Walk u v) : p.map Hom.id = p

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

∀ (p : G.Walk u v), SimpleGraph.Walk.map SimpleGraph.Hom.id p = p


theorem det_ne_zero [Nontrivial R] (g : SpecialLinearGroup n R) : det ↑ₘg ≠ 0

{n : Type u}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
[Nontrivial R]
(g : Matrix.SpecialLinearGroup n R)


theorem Scheme.restrictFunctor_map_base {U V : X.Opens} (i : U ⟶ V) :
    (X.restrictFunctor.map i).1.val.base = (Opens.toTopCat _).map i

{X : AlgebraicGeometry.Scheme}
{U V : X.Opens}
(i : U ⟶ V)

(X.restrictFunctor.map i).left.val.base = (TopologicalSpace.Opens.toTopCat ↑X.toPresheafedSpace).map i


private lemma totalDegree_f₁_add_totalDegree_f₂ {a : ι → ZMod p} :
    (f₁ s a).totalDegree + (f₂ s a).totalDegree < 2 * p - 1

{ι : Type u_1}
{p : ℕ}
[Fact (Nat.Prime p)]
{s : Finset ι}
{a : ι → ZMod p}