@[reassoc (attr := simp)]
theorem PInfty_on_Γ₀_splitting_summand_eq_self (K : ChainComplex C ℕ) {n : ℕ} :
    ((Γ₀.splitting K).cofan _).inj (Splitting.IndexSet.id (op [n])) ≫
      (PInfty : K[Γ₀.obj K] ⟶ _).f n =
      ((Γ₀.splitting K).cofan _).inj (Splitting.IndexSet.id (op [n]))

((AlgebraicTopology.DoldKan.Γ₀.splitting K).cofan (Opposite.op [n])).inj
      (SimplicialObject.Splitting.IndexSet.id (Opposite.op [n])) ≫
    AlgebraicTopology.DoldKan.PInfty.f n =
  ((AlgebraicTopology.DoldKan.Γ₀.splitting K).cofan (Opposite.op [n])).inj
    (SimplicialObject.Splitting.IndexSet.id (Opposite.op [n]))


/-- If a a formal multilinear series has a positive radius of convergence, then its right inverse
also has a positive radius of convergence. -/
theorem radius_rightInv_pos_of_radius_pos (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F)
    (hp : 0 < p.radius) : 0 < (p.rightInv i).radius

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
(i : E ≃L[𝕜] F)
(hp : 0 < p.radius)


/-- Given an invariant measure then it gives the same mass to measurable sets with
compact closure as any other invariant measure, up to the scalar `haarScalarFactor μ' μ`.

Auxiliary lemma in the proof of the more general
`measure_isMulInvariant_eq_smul_of_isCompact_closure`, which removes the
measurability assumption. -/
@[to_additive measure_isAddInvariant_eq_smul_of_isCompact_closure_of_measurableSet
"Given an invariant measure then it gives the same mass to measurable sets with
compact closure as any other invariant measure, up to the scalar `addHaarScalarFactor μ' μ`.

Auxiliary lemma in the proof of the more general
`measure_isAddInvariant_eq_smul_of_isCompact_closure`, which removes the
measurability assumption."]
lemma measure_isMulInvariant_eq_smul_of_isCompact_closure_of_measurableSet [LocallyCompactSpace G]
    (μ' μ : Measure G) [IsHaarMeasure μ] [IsFiniteMeasureOnCompacts μ'] [IsMulLeftInvariant μ']
    {s : Set G} (hs : MeasurableSet s) (h's : IsCompact (closure s)) :
    μ' s = haarScalarFactor μ' μ • μ s


@[to_additive (attr := simp)]
lemma orbitRel.Quotient.orbit_inj {x y : orbitRel.Quotient G α} : x.orbit = y.orbit ↔ x = y

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
{x y : AddAction.orbitRel.Quotient G α}


theorem val_le_one_or_val_inv_lt_one (v : Valuation K Γ₀) (x : K) : v x ≤ 1 ∨ v x⁻¹ < 1

{K : Type u_1}
[DivisionRing K]
{Γ₀ : Type u_4}
[LinearOrderedCommGroupWithZero Γ₀]
(v : Valuation K Γ₀)
(x : K)


theorem succ_mul_succ (a b) : succ a * succ b = a * b + a + b + 1


lemma BddBelow.isBounded_inter (hs : BddBelow s) (ht : BddAbove t) : IsBounded (s ∩ t)

{α : Type u_1}
[Bornology α]
{s t : Set α}
[Preorder α]
[IsOrderBornology α]
(hs : BddBelow s)
(ht : BddAbove t)


theorem smeval_ascPochhammer_nat_cast [NatPowAssoc R] (n k : ℕ) :
    smeval (ascPochhammer ℕ k) (n : R) = smeval (ascPochhammer ℕ k) n

{R : Type u_1}
[NonAssocRing R]
[Pow R ℕ]
[NatPowAssoc R]
(n k : ℕ)

(ascPochhammer ℕ k).smeval ↑n = ↑((ascPochhammer ℕ k).smeval n)


@[simp]
theorem smul_bot (a : α) : a • (⊥ : Submonoid M) = ⊥

{α : Type u_1}
{M : Type u_3}
[Monoid M]
[Monoid α]
[MulDistribMulAction α M]
(a : α)


lemma _root_.Real.lipschitzWith_toNNReal : LipschitzWith 1 Real.toNNReal


@[simp] theorem not_ofBool : ~~~ (ofBool b) = ofBool (!b)


@[simp]
theorem count_support_takeUntil_eq_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) :
    (p.takeUntil u h).support.count u = 1

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

List.count u (p.takeUntil u h).support = 1


/-- Class `ContinuousVAdd M X` says that the additive action `(+ᵥ) : M → X → X`
is continuous in both arguments. We use the same class for all kinds of additive actions,
including (semi)modules and algebras. -/
class ContinuousVAdd (M X : Type*) [VAdd M X] [TopologicalSpace M] [TopologicalSpace X] :
    Prop where
  /-- The additive action `(+ᵥ)` is continuous. -/
  continuous_vadd : Continuous fun p : M × X => p.1 +ᵥ p.2

{M : Type u_1}
{X : Type u_2}
[VAdd M X]
[TopologicalSpace M]
[TopologicalSpace X]
[self : ContinuousVAdd M X]


protected theorem add_le_add_left (a b : ℤ√d) (ab : a ≤ b) (c : ℤ√d) : c + a ≤ c + b

{d : ℕ}
(a b : ℤ√↑d)
(ab : a ≤ b)
(c : ℤ√↑d)


@[simp]
theorem algebraMap_apply (r : R) : algebraMap R (MvPolynomial σ S₁) r = C (algebraMap R S₁ r)

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
[Algebra R S₁]
(r : R)

(algebraMap R (MvPolynomial σ S₁)) r = MvPolynomial.C ((algebraMap R S₁) r)


theorem Tendsto.prod_map_prod_atBot [SemilatticeInf γ] {F : Filter α} {G : Filter β} {f : α → γ}
    {g : β → γ} (hf : Tendsto f F atBot) (hg : Tendsto g G atBot) :
    Tendsto (Prod.map f g) (F ×ˢ G) atBot

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[SemilatticeInf γ]
{F : Filter α}
{G : Filter β}
{f : α → γ}
{g : β → γ}
(hf : Filter.Tendsto f F Filter.atBot)
(hg : Filter.Tendsto g G Filter.atBot)

Filter.Tendsto (Prod.map f g) (F ×ˢ G) Filter.atBot


theorem neg_pi_div_two_le_arg_iff {z : ℂ} : -(π / 2) ≤ arg z ↔ 0 ≤ re z ∨ 0 ≤ im z


theorem count_ofSums_zero {n : ℕ} {l : Multiset ℕ} (hl : l.sum = n) :
    (ofSums n l hl).parts.count 0 = 0

Multiset.count 0 (Nat.Partition.ofSums n l hl).parts = 0


theorem eq_push_pop_back_of_size_ne_zero [Inhabited α] {as : Array α} (h : as.size ≠ 0) :
    as = as.pop.push as.back

{α : Type u_1}
[Inhabited α]
{as : Array α}
(h : as.size ≠ 0)


lemma isLocallySurjective_comp_iff
    {F₁ F₂ F₃ : Cᵒᵖ ⥤ A} (f₁ : F₁ ⟶ F₂) (f₂ : F₂ ⟶ F₃)
    [IsLocallyInjective J f₂] [IsLocallySurjective J f₂] :
    IsLocallySurjective J (f₁ ≫ f₂) ↔ IsLocallySurjective J f₁

(J : CategoryTheory.GrothendieckTopology C)

CategoryTheory.Presheaf.IsLocallySurjective J (f₁ ≫ f₂) ↔ CategoryTheory.Presheaf.IsLocallySurjective J f₁


@[simp]
theorem reflect_sub (f g : R[X]) (N : ℕ) : reflect N (f - g) = reflect N f - reflect N g

{R : Type u_1}
[Ring R]
(f g : Polynomial R)
(N : ℕ)

Polynomial.reflect N (f - g) = Polynomial.reflect N f - Polynomial.reflect N g


@[to_additive (attr := simp)]
lemma one_smul (b : α) : (1 : M) • b = b

(M : Type u_1)
{α : Type u_7}
[Monoid M]
[MulAction M α]
(b : α)


/-- The infimum of a singleton is the element of the singleton-/
@[simp]
theorem csInf_singleton (a : α) : sInf {a} = a

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


theorem val_le_iff_val_subset {a : Finset α} {b : Multiset α} : a.val ≤ b ↔ a.val ⊆ b

{α : Type u_1}
{a : Finset α}
{b : Multiset α}


@[to_additive pi_nnnorm_le_iff]
lemma pi_nnnorm_le_iff' {r : ℝ≥0} : ‖x‖₊ ≤ r ↔ ∀ i, ‖x i‖₊ ≤ r

{ι : Type u_1}
{π : ι → Type u_4}
[Fintype ι]
[(i : ι) → SeminormedGroup (π i)]
{x : (i : ι) → π i}
{r : ℝ≥0}

‖x‖₊ ≤ r ↔ ∀ (i : ι), ‖x i‖₊ ≤ r


@[simp] lemma piTensorHomMap₂_tprod_tprod_tprod
    (f : ∀ i, s i →ₗ[R] t i →ₗ[R] t' i) (a : ∀ i, s i) (b : ∀ i, t i) :
    piTensorHomMap₂ (tprod R f) (tprod R a) (tprod R b) = tprod R (fun i ↦ f i (a i) (b i))

(f : (i : ι) → s i →ₗ[R] t i →ₗ[R] t' i)

((PiTensorProduct.piTensorHomMap₂ ((PiTensorProduct.tprod R) f)) ((PiTensorProduct.tprod R) a))
    ((PiTensorProduct.tprod R) b) =
  ⨂ₜ[R] (i : ι), ((f i) (a i)) (b i)


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

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

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

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


@[reassoc (attr := simp)]
lemma tensorHom_app_snd {F₁ F₁' F₂ F₂' : J ⥤ C} (f : F₁ ⟶ F₁') (g : F₂ ⟶ F₂') (j : J) :
    (f ⊗ g).app j ≫ snd _ _ = snd _ _ ≫ g.app j

{F₁ F₁' F₂ F₂' : CategoryTheory.Functor J C}

CategoryTheory.CategoryStruct.comp ((CategoryTheory.MonoidalCategory.tensorHom f g).app j)
    (CategoryTheory.ChosenFiniteProducts.snd (F₁'.obj j) (F₂'.obj j)) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.ChosenFiniteProducts.snd (F₁.obj j) (F₂.obj j)) (g.app j)


/-- This lemma is analogous to `Quotient.out_eq'`. -/
@[simp]
theorem proj_out (x : hs.Quotient) : hs.proj (hs.out x) = x

{ι : Type u_1}
{α : Type u_2}
{s : ι → Set α}
(hs : IndexedPartition s)
(x : hs.Quotient)


theorem hammingDist_smul_le_hammingDist [∀ i, SMul α (β i)] {k : α} {x y : ∀ i, β i} :
    hammingDist (k • x) (k • y) ≤ hammingDist x y

{α : Type u_1}
{ι : Type u_2}
{β : ι → Type u_3}
[Fintype ι]
[(i : ι) → DecidableEq (β i)]
[(i : ι) → SMul α (β i)]
{k : α}
{x y : (i : ι) → β i}


@[simp]
theorem inv_inv_inv (A : Matrix n n α) : A⁻¹⁻¹⁻¹ = A⁻¹

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

A⁻¹⁻¹⁻¹ = A⁻¹


/-- Given `α : L ⋙ F' ⟶ F`, the property `F'.IsRightKanExtension α` asserts that
`(F', α)` is a terminal object in the category `RightExtension L F`, i.e. that `(F', α)`
is a right Kan extension of `F` along `L`. -/
class IsRightKanExtension : Prop where
  nonempty_isUniversal : Nonempty (RightExtension.mk F' α).IsUniversal

{C : Type u_1}
{H : Type u_3}
{D : Type u_5}
[CategoryTheory.Category.{u_7, u_1} C]
[CategoryTheory.Category.{u_8, u_3} H]
[CategoryTheory.Category.{u_9, u_5} D]
{F' : CategoryTheory.Functor D H}
{L : CategoryTheory.Functor C D}
{F : CategoryTheory.Functor C H}
{α : L.comp F' ⟶ F}
[self : F'.IsRightKanExtension α]

Nonempty (CategoryTheory.CostructuredArrow.IsUniversal (CategoryTheory.Functor.RightExtension.mk F' α))


theorem toFinset_ssubset_univ [Fintype α] {s : Set α} [Fintype s] :
    s.toFinset ⊂ Finset.univ ↔ s ⊂ univ

{α : Type u_1}
[Fintype α]
{s : Set α}
[Fintype ↑s]


theorem nhds_ofDual (x : X) : 𝓝 (ofDual x) = map ofDual (𝓝 x)

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

𝓝 (OrderDual.ofDual x) = Filter.map (⇑OrderDual.ofDual) (𝓝 x)


theorem zero_not_mem_frange {f : α →₀ M} : (0 : M) ∉ f.frange

{α : Type u_1}
{M : Type u_5}
[Zero M]
{f : α →₀ M}


@[simp] theorem ofBaseOfFinite_base {E : Set α} (hE : E.Finite) Base exists_base
    base_exchange subset_ground : (Matroid.ofBaseOfFinite
      hE Base exists_base base_exchange subset_ground).Base = Base

(base_exchange : Matroid.ExchangeProperty Base)

(subset_ground : ∀ (B : Set α), Base B → B ⊆ E)


@[to_additive (attr := simp)]
theorem snd_comp_toProd : (MonoidHom.snd M N).comp toProd = snd

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

(MonoidHom.snd M N).comp Monoid.Coprod.toProd = Monoid.Coprod.snd


/-- A real continuous linear map on the complex plane is conformal if and only if the map or its
    conjugate is complex linear, and the map is nonvanishing. -/
theorem isConformalMap_iff_is_complex_or_conj_linear :
    IsConformalMap g ↔
      ((∃ map : ℂ →L[ℂ] ℂ, map.restrictScalars ℝ = g) ∨
          ∃ map : ℂ →L[ℂ] ℂ, map.restrictScalars ℝ = g ∘L ↑conjCLE) ∧
        g ≠ 0

IsConformalMap g ↔
  ((∃ map, ContinuousLinearMap.restrictScalars ℝ map = g) ∨
      ∃ map, ContinuousLinearMap.restrictScalars ℝ map = g.comp ↑Complex.conjCLE) ∧
    g ≠ 0


theorem normSq_eq_norm_mul_self (a : ℍ) : normSq a = ‖a‖ * ‖a‖


theorem tendsto_iff_tendstoUniformly {ι : Type*} {F : ι → α →ᵇ β} {f : α →ᵇ β} {l : Filter ι} :
    Tendsto F l (𝓝 f) ↔ TendstoUniformly (fun i => F i) f l

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
{ι : Type u_2}
{F : ι → BoundedContinuousFunction α β}
{f : BoundedContinuousFunction α β}
{l : Filter ι}

Filter.Tendsto F l (𝓝 f) ↔ TendstoUniformly (fun i => ⇑(F i)) (⇑f) l


lemma isGalois_of_isSplittingField_X_pow_sub_C : IsGalois K L

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

[Polynomial.IsSplittingField K L (Polynomial.X ^ n - Polynomial.C a)]


@[simp]
theorem Ici_sSup (S : Set α) : Ici (sSup S) = ⨆ a ∈ S, Ici a

{α : Type u_1}
[CompleteLattice α]
(S : Set α)

UpperSet.Ici (sSup S) = ⨆ a ∈ S, UpperSet.Ici a


@[simp, nolint simpNF]
theorem supIndep_attach : (s.attach.SupIndep fun a => f a) ↔ s.SupIndep f

{α : Type u_1}
{ι : Type u_3}
[Lattice α]
[OrderBot α]
{s : Finset ι}
{f : ι → α}

(s.attach.SupIndep fun a => f ↑a) ↔ s.SupIndep f


theorem mul_self_lt_top_iff {a : ℝ≥0∞} : a * a < ⊤ ↔ a < ⊤


theorem coeff_mul_monomial_zero (p : R[X]) (d : ℕ) (r : R) :
    coeff (p * monomial 0 r) d = coeff p d * r

{R : Type u}
[Semiring R]
(p : R[X])
(d : ℕ)
(r : R)

(p * (Polynomial.monomial 0) r).coeff d = p.coeff d * r


theorem ae_le_condexp [LE E] (hf : Submartingale f ℱ μ) {i j : ι} (hij : i ≤ j) :
    f i ≤ᵐ[μ] μ[f j|ℱ i]

(hf : MeasureTheory.Submartingale f ℱ μ)


@[simp]
theorem as_ideal_lt_as_ideal (x y : ProjectiveSpectrum 𝒜) :
    x.asHomogeneousIdeal < y.asHomogeneousIdeal ↔ x < y

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
(x y : ProjectiveSpectrum 𝒜)


@[simp]
theorem Finset.card_add_card_compl [DecidableEq α] [Fintype α] (s : Finset α) :
    s.card + sᶜ.card = Fintype.card α

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


theorem comp_add (f : X ⟶ Y) (g h : Y ⟶ Z) : f ≫ (g + h) = f ≫ g + f ≫ h


/-- The disjoint union of antidiagonals `Σ (n : A), antidiagonal n` is equivalent to the product
    `A × A`. This is such an equivalence, obtained by mapping `(n, (k, l))` to `(k, l)`. -/
@[simps]
def sigmaAntidiagonalEquivProd [AddMonoid A] [HasAntidiagonal A] :
    (Σ n : A, antidiagonal n) ≃ A × A

(x : (n : A) × { x // x ∈ Finset.antidiagonal n })

Finset.sigmaAntidiagonalEquivProd x = ↑x.snd


/-- If `f` tends to a countably generated filter `l` along `Filter.cofinite`,
then for all but countably many elements, `f x ∈ l.ker`. -/
theorem Tendsto.countable_compl_preimage_ker {f : α → β}
    {l : Filter β} [l.IsCountablyGenerated] (h : Tendsto f cofinite l) :
    Set.Countable (f ⁻¹' l.ker)ᶜ

(h : Filter.Tendsto f Filter.cofinite l)


theorem tendsto_atBot_atBot_of_monotone [Preorder α] [Preorder β] {f : α → β} (hf : Monotone f)
    (h : ∀ b, ∃ a, f a ≤ b) : Tendsto f atBot atBot

{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : α → β}
(hf : Monotone f)
(h : ∀ (b : β), ∃ a, f a ≤ b)

Filter.Tendsto f Filter.atBot Filter.atBot


@[simp]
protected theorem «forall» {q : { a // p a } → Prop} : (∀ x, q x) ↔ ∀ a b, q ⟨a, b⟩

{α : Sort u_1}
{p : α → Prop}
{q : { a // p a } → Prop}

(∀ (x : { a // p a }), q x) ↔ ∀ (a : α) (b : p a), q ⟨a, b⟩


theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => ‖f y‖ ^ 2

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{f : G → E}
(hf : Differentiable ℝ f)


lemma Limits.IsZero.projective {X : C} (h : IsZero X) : Projective X

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


theorem digits_add (b : ℕ) (h : 1 < b) (x y : ℕ) (hxb : x < b) (hxy : x ≠ 0 ∨ y ≠ 0) :
    digits b (x + b * y) = x :: digits b y


theorem toPartENat_surjective : Surjective toPartENat


theorem Ideal.isHomogeneous_iff_forall_subset :
    I.IsHomogeneous 𝒜 ↔ ∀ i, (I : Set A) ⊆ GradedRing.proj 𝒜 i ⁻¹' I

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[Semiring A]
[SetLike σ A]
[AddSubmonoidClass σ A]
(𝒜 : ι → σ)
[DecidableEq ι]
[AddMonoid ι]
[GradedRing 𝒜]
(I : Ideal A)

Ideal.IsHomogeneous 𝒜 I ↔ ∀ (i : ι), ↑I ⊆ ⇑(GradedRing.proj 𝒜 i) ⁻¹' ↑I


@[to_additive]
theorem sup_eq_closure (H H' : Subgroup G) : H ⊔ H' = closure ((H : Set G) ∪ (H' : Set G))

{G : Type u_1}
[AddGroup G]
(H H' : AddSubgroup G)


theorem target_inter_preimage_symm_source_eq (e f : Pretrivialization F proj) :
    f.target ∩ f.toPartialEquiv.symm ⁻¹' e.source = (e.baseSet ∩ f.baseSet) ×ˢ univ

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
(e f : Pretrivialization F proj)

f.target ∩ ↑f.symm ⁻¹' e.source = (e.baseSet ∩ f.baseSet) ×ˢ Set.univ


theorem concat_append {u v w x : V} (p : G.Walk u v) (h : G.Adj v w) (q : G.Walk w x) :
    (p.concat h).append q = p.append (cons h q)

{V : Type u}
{G : SimpleGraph V}
{u v w x : V}
(p : G.Walk u v)
(h : G.Adj v w)
(q : G.Walk w x)

(p.concat h).append q = p.append (SimpleGraph.Walk.cons h q)


{α : Type u}
[SemilatticeInf α]
[OrderTop α]
(a : α)


@[to_additive finsum_nonneg]
theorem one_le_finprod' {M : Type*} [OrderedCommMonoid M] {f : α → M} (hf : ∀ i, 1 ≤ f i) :
    1 ≤ ∏ᶠ i, f i

{α : Sort u_4}
{M : Type u_7}
[OrderedAddCommMonoid M]
{f : α → M}
(hf : ∀ (i : α), 0 ≤ f i)


theorem map_id : (Option.map id : Option α → Option α) = id


/-- If a function is bounded on a discrete space, it is automatically continuous,
and therefore gives rise to an element of the type of bounded continuous functions. -/
@[simps]
def mkOfDiscrete [DiscreteTopology α] (f : α → β) (C : ℝ) (h : ∀ x y : α, dist (f x) (f y) ≤ C) :
    α →ᵇ β

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
[DiscreteTopology α]
(f : α → β)
(C : ℝ)
(h : ∀ (x y : α), dist (f x) (f y) ≤ C)

∀ (a : α), (BoundedContinuousFunction.mkOfDiscrete f C h) a = f a


@[simp]
theorem keys_ext {s₁ s₂ : AList β} : keys ⟦s₁⟧ = keys ⟦s₂⟧ ↔ s₁.keys ~ s₂.keys

{α : Type u}
{β : α → Type v}
{s₁ s₂ : AList β}

⟦s₁⟧.keys = ⟦s₂⟧.keys ↔ s₁.keys ~ s₂.keys


/-- Baire theorem: the intersection of two dense Gδ sets is dense. -/
theorem Dense.inter_of_Gδ {s t : Set X} (hs : IsGδ s) (ht : IsGδ t) (hsc : Dense s)
    (htc : Dense t) : Dense (s ∩ t)

{X : Type u_1}
[TopologicalSpace X]
[BaireSpace X]
{s t : Set X}
(hs : IsGδ s)
(ht : IsGδ t)
(hsc : Dense s)
(htc : Dense t)


/-- The cosine of the angle between two vectors. -/
theorem cos_angle (x y : V) : Real.cos (angle x y) = ⟪x, y⟫ / (‖x‖ * ‖y‖)

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
(x y : V)

Real.cos (InnerProductGeometry.angle x y) = ⟪x, y⟫_ℝ / (‖x‖ * ‖y‖)


theorem map_smul_left (r : R) (f : M →ₗ[R] P) (g : N →ₗ[R] Q) : map (r • f) g = r • map f g

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
{Q : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[Module R M]
[Module R N]
[Module R P]
[Module R Q]
(r : R)
(f : M →ₗ[R] P)
(g : N →ₗ[R] Q)

TensorProduct.map (r • f) g = r • TensorProduct.map f g


theorem monomial_pow : monomial s a ^ e = monomial (e • s) (a ^ e)

{R : Type u}
{σ : Type u_1}
{a : R}
{e : ℕ}
{s : σ →₀ ℕ}
[CommSemiring R]

(MvPolynomial.monomial s) a ^ e = (MvPolynomial.monomial (e • s)) (a ^ e)


lemma induce_union_connected {H : G.Subgraph} {s t : Set V}
    (sconn : (H.induce s).Connected) (tconn : (H.induce t).Connected)
    (sintert : (s ⊓ t).Nonempty) :
    (H.induce (s ∪ t)).Connected

{V : Type u}
{G : SimpleGraph V}
{H : G.Subgraph}
{s t : Set V}
(sconn : (H.induce s).Connected)
(tconn : (H.induce t).Connected)
(sintert : (s ⊓ t).Nonempty)


theorem FintypeCat.discreteTopology (A : FintypeCat) : DiscreteTopology A


private theorem calc_norm_le_one {n : ℕ} {z : ℤ_[p]} (hz : ih n z) :
    ‖(↑(F.eval z) : ℚ_[p]) / ↑(F.derivative.eval z)‖ ≤ 1

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

‖↑(Polynomial.eval z F) / ↑(Polynomial.eval z (Polynomial.derivative F))‖ ≤ 1


theorem GradedRing.proj_recompose (a : ⨁ i, 𝒜 i) (i : ι) :
    GradedRing.proj 𝒜 i ((decompose 𝒜).symm a) = (decompose 𝒜).symm (DirectSum.of _ i (a i))

{ι : Type u_1}
{A : Type u_3}
{σ : Type u_4}
[DecidableEq ι]
[AddMonoid ι]
[Semiring A]
[SetLike σ A]
[AddSubmonoidClass σ A]
(𝒜 : ι → σ)
[GradedRing 𝒜]
(a : ⨁ (i : ι), ↥(𝒜 i))
(i : ι)

(GradedRing.proj 𝒜 i) ((DirectSum.decompose 𝒜).symm a) =
  (DirectSum.decompose 𝒜).symm ((DirectSum.of (fun i => ↥(𝒜 i)) i) (a i))


lemma Exact.mono_g' (hS : S.Exact) (h : RightHomologyData S) : Mono h.g'

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{S : CategoryTheory.ShortComplex C}
(hS : S.Exact)
(h : S.RightHomologyData)


@[simp]
theorem leadingCoeff_X_pow_sub_C {n : ℕ} (hn : 0 < n) {r : R} :
    (X ^ n - C r).leadingCoeff = 1

{R : Type u}
[Ring R]
{n : ℕ}
(hn : 0 < n)
{r : R}

(Polynomial.X ^ n - Polynomial.C r).leadingCoeff = 1


@[simp]
theorem forall_subset_range_iff {f : α → β} {p : Set β → Prop} :
    (∀ s, s ⊆ range f → p s) ↔ ∀ s, p (f '' s)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{p : Set β → Prop}

(∀ s ⊆ Set.range f, p s) ↔ ∀ (s : Set α), p (f '' s)


theorem inf_mono_fun {g : β → α} (h : ∀ b ∈ s, f b ≤ g b) : s.inf f ≤ s.inf g

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
[OrderTop α]
{s : Finset β}
{f g : β → α}
(h : ∀ b ∈ s, f b ≤ g b)


@[simp]
theorem fst_linear : (fst : P1 × P2 →ᵃ[k] P1).linear = LinearMap.fst k V1 V2

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
{V2 : Type u_4}
{P2 : Type u_5}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]
[AffineSpace V2 P2]

AffineMap.fst.linear = LinearMap.fst k V1 V2


theorem AsTrue.get {c : Prop} [h₁ : Decidable c] (_ : AsTrue c) : c


@[simp]
theorem comp_onTerm {L'' : Language} (φ : L' →ᴸ L'') (ψ : L →ᴸ L') :
    ((φ.comp ψ).onTerm : L.Term α → L''.Term α) = φ.onTerm ∘ ψ.onTerm

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
{α : Type u'}
{L'' : FirstOrder.Language}
(φ : L' →ᴸ L'')
(ψ : L →ᴸ L')


@[simp]
theorem HomogeneousIdeal.mem_irrelevant_iff (a : A) :
    a ∈ HomogeneousIdeal.irrelevant 𝒜 ↔ proj 𝒜 0 a = 0

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[Semiring A]
[DecidableEq ι]
[CanonicallyOrderedAddCommMonoid ι]
[SetLike σ A]
[AddSubmonoidClass σ A]
(𝒜 : ι → σ)
[GradedRing 𝒜]
(a : A)

a ∈ HomogeneousIdeal.irrelevant 𝒜 ↔ (GradedRing.proj 𝒜 0) a = 0


theorem mem_reesAlgebra_iff (f : R[X]) : f ∈ reesAlgebra I ↔ ∀ i, f.coeff i ∈ I ^ i

{R : Type u}
[CommRing R]
(I : Ideal R)
(f : R[X])

f ∈ reesAlgebra I ↔ ∀ (i : ℕ), f.coeff i ∈ I ^ i


theorem arcsin_le_pi_div_two (x : ℝ) : arcsin x ≤ π / 2


@[to_additive (attr := simp)]
theorem mulIndicator_inter_mulSupport (s : Set α) (f : α → M) :
    mulIndicator (s ∩ mulSupport f) f = mulIndicator s f

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

(s ∩ Function.support f).indicator f = s.indicator f


protected theorem coe_mul (x y : S) : (↑(x * y) : A) = ↑x * ↑y

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
{S : NonUnitalSubalgebra R A}
(x y : ↥S)


theorem mem_keys_kinsert {a a'} {b' : β a'} {l : List (Sigma β)} :
    a ∈ (kinsert a' b' l).keys ↔ a = a' ∨ a ∈ l.keys

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a a' : α}
{b' : β a'}
{l : List (Sigma β)}

a ∈ (List.kinsert a' b' l).keys ↔ a = a' ∨ a ∈ l.keys


theorem setOf_app_iff {p : α → Prop} {x : α} : { x | p x } x ↔ p x


lemma rotate_distinguished_triangle (T : Triangle (HomotopyCategory C (ComplexShape.up ℤ))) :
    T ∈ distinguishedTriangles C ↔ T.rotate ∈ distinguishedTriangles C

(T : CategoryTheory.Pretriangulated.Triangle (HomotopyCategory C (ComplexShape.up ℤ)))

T ∈ HomotopyCategory.Pretriangulated.distinguishedTriangles C ↔
  T.rotate ∈ HomotopyCategory.Pretriangulated.distinguishedTriangles C


@[simp]
theorem constantCoeff_xInTermsOfW [hp : Fact p.Prime] [Invertible (p : R)] (n : ℕ) :
    constantCoeff (xInTermsOfW p R n) = 0

(p : ℕ)
(R : Type u_1)
[CommRing R]
[hp : Fact (Nat.Prime p)]
[Invertible ↑p]
(n : ℕ)

MvPolynomial.constantCoeff (xInTermsOfW p R n) = 0


/-- Induction principle starting at a non-zero number.
To use in an induction proof, the syntax is `induction n, hn using Nat.le_induction` (or the same
for `induction'`).

This is an alias of `Nat.leRec`, specialized to `Prop`. -/
@[elab_as_elim]
lemma le_induction {m : ℕ} {P : ∀ n, m ≤ n → Prop} (base : P m m.le_refl)
    (succ : ∀ n hmn, P n hmn → P (n + 1) (le_succ_of_le hmn)) : ∀ n hmn, P n hmn

(succ : ∀ (n : ℕ) (hmn : m ≤ n), P n hmn → P (n + 1) ⋯)


@[to_additive]
theorem multipliable_iff_nat_tprod_vanishing {f : ℕ → G} : Multipliable f ↔
    ∀ e ∈ 𝓝 1, ∃ N : ℕ, ∀ t ⊆ {n | N ≤ n}, (∏' n : t, f n) ∈ e

{G : Type u_2}
[AddCommGroup G]
[UniformSpace G]
[UniformAddGroup G]
[CompleteSpace G]
{f : ℕ → G}

Summable f ↔ ∀ e ∈ 𝓝 0, ∃ N, ∀ t ⊆ {n | N ≤ n}, ∑' (n : ↑t), f ↑n ∈ e


/-- The Double Negation Theorem: `¬¬P` is equivalent to `P`.
The left-to-right direction, double negation elimination (DNE),
is classically true but not constructively. -/
@[simp] theorem not_not : ¬¬a ↔ a


theorem forall_in_swap {β : Type*} {p : Set α → β → Prop} :
    (∀ a ∈ f, ∀ (b), p a b) ↔ ∀ (b), ∀ a ∈ f, p a b

{α : Type u}
{f : Filter α}
{β : Type u_1}
{p : Set α → β → Prop}

(∀ a ∈ f, ∀ (b : β), p a b) ↔ ∀ (b : β), ∀ a ∈ f, p a b


/-- If `j` is initial in the index category, then the map `limit.π F j` is an isomorphism.
-/
theorem isIso_π_of_isInitial {j : J} (I : IsInitial j) (F : J ⥤ C) [HasLimit F] :
    IsIso (limit.π F j)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{J : Type u}
[CategoryTheory.Category.{v, u} J]
{j : J}
(I : CategoryTheory.Limits.IsInitial j)
(F : J ⥤ C)
[CategoryTheory.Limits.HasLimit F]

CategoryTheory.IsIso (CategoryTheory.Limits.limit.π F j)


lemma mulOption_lt_iff_P1 {i j k l} :
    (⟦mulOption x y i k⟧ : Game) < -⟦mulOption x (-y) j l⟧ ↔
    P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l)

{x y : SetTheory.PGame}
{i j : x.LeftMoves}
{k : y.LeftMoves}
{l : (-y).LeftMoves}

⟦x.mulOption y i k⟧ < -⟦x.mulOption (-y) j l⟧ ↔
  Surreal.Multiplication.P1 (x.moveLeft i) x (x.moveLeft j) y (y.moveLeft k) (-(-y).moveLeft l)


theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
    0 < mgf X μ t

(h_int_X : MeasureTheory.Integrable (fun ω => rexp (t * X ω)) μ)


/--
Given a monad morphism from `T₂` to `T₁`, we get a functor from the algebras of `T₁` to algebras of
`T₂`.
-/
@[simps]
def algebraFunctorOfMonadHom {T₁ T₂ : Monad C} (h : T₂ ⟶ T₁) : Algebra T₁ ⥤ Algebra T₂

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{T₁ T₂ : CategoryTheory.Monad C}
(h : T₂ ⟶ T₁)
(A : T₁.Algebra)

((CategoryTheory.Monad.algebraFunctorOfMonadHom h).obj A).A = A.A


theorem integerLattice.inter_ball_finite [NumberField K] (r : ℝ) :
    ((integerLattice K : Set ((K →+* ℂ) → ℂ)) ∩ Metric.closedBall 0 r).Finite

(K : Type u_1)
[Field K]
[NumberField K]
(r : ℝ)

(↑(NumberField.canonicalEmbedding.integerLattice K) ∩ Metric.closedBall 0 r).Finite


/-- The equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)` given by yoneda lemma. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_inv counitIso_hom counitIso_inv]
def costructuredArrowYonedaEquivalence (F : Cᵒᵖ ⥤ Type v) :
    F.Elementsᵒᵖ ≌ CostructuredArrow yoneda F

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

(CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence F).unitIso.inv =
  CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.CategoryOfElements.toCostructuredArrow F).comp
          (CategoryTheory.CategoryOfElements.fromCostructuredArrow F).rightOp).leftUnitor.inv
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.whiskerRight (CategoryTheory.NatTrans.op (CategoryTheory.eqToHom ⋯))
        ((CategoryTheory.CategoryOfElements.toCostructuredArrow F).comp
          (CategoryTheory.CategoryOfElements.fromCostructuredArrow F).rightOp))
      (CategoryTheory.CategoryStruct.comp
        ((CategoryTheory.CategoryOfElements.toCostructuredArrow F).associator
            (CategoryTheory.CategoryOfElements.fromCostructuredArrow F).rightOp
            ((CategoryTheory.CategoryOfElements.toCostructuredArrow F).comp
              (CategoryTheory.CategoryOfElements.fromCostructuredArrow F).rightOp)).hom
        (CategoryTheory.CategoryStruct.comp
          (CategoryTheory.whiskerLeft (CategoryTheory.CategoryOfElements.toCostructuredArrow F)
            ((CategoryTheory.CategoryOfElements.fromCostructuredArrow F).rightOp.associator
                (CategoryTheory.CategoryOfElements.toCostructuredArrow F)
                (CategoryTheory.CategoryOfElements.fromCostructuredArrow F).rightOp).inv)
          (CategoryTheory.CategoryStruct.comp
            (CategoryTheory.whiskerLeft (CategoryTheory.CategoryOfElements.toCostructuredArrow F)
              (CategoryTheory.whiskerRight (CategoryTheory.eqToHom ⋯)
                (CategoryTheory.CategoryOfElements.fromCostructuredArrow F).rightOp))
            (CategoryTheory.CategoryStruct.comp
              (CategoryTheory.whiskerLeft (CategoryTheory.CategoryOfElements.toCostructuredArrow F)
                (CategoryTheory.CategoryOfElements.fromCostructuredArrow F).rightOp.leftUnitor.hom)
              (CategoryTheory.NatTrans.op (CategoryTheory.eqToHom ⋯)))))))


/-- The Fourier coefficients of `B₀(x) = 1`. -/
theorem bernoulli_zero_fourier_coeff {n : ℤ} (hn : n ≠ 0) : bernoulliFourierCoeff 0 n = 0


lemma smul_equiv (P : Fin 3 → R) {u : R} (hu : IsUnit u) : u • P ≈ P

{R : Type u}
[CommRing R]
(P : Fin 3 → R)
{u : R}
(hu : IsUnit u)


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

(h : ∀ (a : A), f.toFun (star a) = star (f.toFun a))

⇑{ toNonUnitalAlgHom := f, map_star' := h } = ⇑f


@[simp]
theorem mk_whiskerLeft (X : F C) {Y₁ Y₂ : F C} (f : Y₁ ⟶ᵐ Y₂) :
    ⟦f.whiskerLeft X⟧ = MonoidalCategory.whiskerLeft (C := F C) (X := X) (f := ⟦f⟧)

(X : CategoryTheory.FreeMonoidalCategory C)

{Y₁ Y₂ : CategoryTheory.FreeMonoidalCategory C}

⟦CategoryTheory.FreeMonoidalCategory.Hom.whiskerLeft X f⟧ = CategoryTheory.MonoidalCategory.whiskerLeft X ⟦f⟧


theorem toNat_injective {n : Nat} : Function.Injective (BitVec.toNat : BitVec n → _)


lemma coroot_root_eq_pairing : P.toLin.flip (P.coroot i) (P.root j) = P.pairing j i

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(P : RootPairing ι R M N)
(i j : ι)

(P.toLin.flip (P.coroot i)) (P.root j) = P.pairing j i


theorem ofNat_mul_subNatNat (m n k : Nat) :
    m * subNatNat n k = subNatNat (m * n) (m * k)

↑m * Int.subNatNat n k = Int.subNatNat (m * n) (m * k)


@[to_additive (attr := fun_prop)]
theorem ContinuousOn.smul (hf : ContinuousOn f s) (hg : ContinuousOn g s) :
    ContinuousOn (fun x => f x • g x) s

{M : Type u_1}
{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace M]
[TopologicalSpace X]
[TopologicalSpace Y]
[VAdd M X]
[ContinuousVAdd M X]
{f : Y → M}
{g : Y → X}
{s : Set Y}
(hf : ContinuousOn f s)
(hg : ContinuousOn g s)


/-- If `f : G → H` is a homomorphism between two additive magmas, then `Finsupp.mapDomain f` is a
non-unital algebra homomorphism between their additive magma algebras. -/
@[simps apply]
def mapDomainNonUnitalAlgHom (k A : Type*) [CommSemiring k] [Semiring A] [Algebra k A]
    {G H F : Type*} [Add G] [Add H] [FunLike F G H] [AddHomClass F G H] (f : F) :
    A[G] →ₙₐ[k] A[H]

(k : Type u_3)
(A : Type u_4)
[CommSemiring k]
[Semiring A]
[Algebra k A]
{G : Type u_5}
{H : Type u_6}
{F : Type u_7}
[Add G]
[Add H]
[FunLike F G H]
[AddHomClass F G H]
(f : F)

∀ (a : G →₀ A), (AddMonoidAlgebra.mapDomainNonUnitalAlgHom k A f) a = (↑(Finsupp.mapDomain.addMonoidHom ⇑f)).toFun a


/-- If the composition of two continuous functions `f : X → Y` and `g : Y → Z` is proper
and `Y` is T2, then `f` is proper. -/
lemma isProperMap_of_comp_of_t2 [T2Space Y] (hf : Continuous f) (hg : Continuous g)
    (hgf : IsProperMap (g ∘ f)) : IsProperMap f

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


@[simp] theorem toListRev_eq (arr : Array α) : arr.toListRev = arr.data.reverse


theorem eLpNorm'_lt_top_of_eLpNorm'_lt_top_of_exponent_le {p q : ℝ} [IsFiniteMeasure μ]
    (hf : AEStronglyMeasurable f μ) (hfq_lt_top : eLpNorm' f q μ < ∞) (hp_nonneg : 0 ≤ p)
    (hpq : p ≤ q) : eLpNorm' f p μ < ∞

(hf : MeasureTheory.AEStronglyMeasurable f μ)

(hfq_lt_top : MeasureTheory.eLpNorm' f q μ < ⊤)


@[to_additive]
theorem Dense.smul (c : G) {s : Set α} (hs : Dense s) : Dense (c • s)

{α : Type u_2}
{G : Type u_4}
[TopologicalSpace α]
[Group G]
[MulAction G α]
[ContinuousConstSMul G α]
(c : G)
{s : Set α}
(hs : Dense s)


theorem pointReflection_apply (x y : P₁) : pointReflection k x y = x -ᵥ y +ᵥ x

(k : Type u_1)
{P₁ : Type u_2}
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
(x y : P₁)

(AffineEquiv.pointReflection k x) y = x -ᵥ y +ᵥ x


@[simp, norm_cast]
lemma coe_nsmul (a : α) (n : ℕ) : ↑(n • a) = n • (a : WithBot α)

{α : Type u}
[AddMonoid α]
(a : α)
(n : ℕ)


@[simp]
theorem get_zero_iterate (f : α → α) (a : α) : get (iterate f a) 0 = a


theorem Forall₂.length_eq : ∀ {l₁ l₂}, Forall₂ R l₁ l₂ → length l₁ = length l₂

{α : Type u_1}
{β : Type u_2}
{R : α → β → Prop}
{l₁ : List α}
{l₂ : List β}

List.Forall₂ R l₁ l₂ → l₁.length = l₂.length


theorem target_inter_inv_preimage_preimage (s : Set Y) :
    e.target ∩ e.symm ⁻¹' (e ⁻¹' s) = e.target ∩ s

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

e.target ∩ ↑e.symm ⁻¹' (↑e ⁻¹' s) = e.target ∩ s


private lemma auxInv_auxHom : (auxInv S r).comp (auxHom (S := S) r).toRingHom = RingHom.id _

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

(IsLocalization.Away.auxInv S r).comp (IsLocalization.Away.auxHom S r).toRingHom =
  RingHom.id (MvPolynomial Unit R ⧸ Ideal.span {MvPolynomial.C r * MvPolynomial.X () - 1})


@[fun_prop]
theorem continuousOn_apply {ι : Type*} {π : ι → Type*} [∀ i, TopologicalSpace (π i)]
    (i : ι) (s) : ContinuousOn (fun p : ∀ i, π i => p i) s

{ι : Type u_7}
{π : ι → Type u_8}
[(i : ι) → TopologicalSpace (π i)]
(i : ι)
(s : Set ((i : ι) → π i))


theorem lt_tsub_of_add_lt_right : a + c < b → a < b - c

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


theorem flip (p : BicartesianSq f g h i) : BicartesianSq g f i h

(p : CategoryTheory.BicartesianSq f g h i)


@[to_additive]
lemma mulIndicator_le {s : Set α} {f g : α → M} (hfg : ∀ a ∈ s, f a ≤ g a) :
    mulIndicator s f ≤ g

{α : Type u_2}
{M : Type u_4}
[CanonicallyOrderedAddCommMonoid M]
{s : Set α}
{f g : α → M}
(hfg : ∀ a ∈ s, f a ≤ g a)


/-- The product of any function over an empty set is `1`. -/
@[to_additive "The sum of any function over an empty set is `0`."]
theorem finprod_mem_empty : (∏ᶠ i ∈ (∅ : Set α), f i) = 1

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


@[simp, norm_cast]
theorem toENNReal_lt : (m : ℝ≥0∞) < n ↔ m < n


@[simp] theorem exists_const (α) [i : Nonempty α] : (∃ _ : α, b) ↔ b

{b : Prop}
(α : Sort u_1)
[i : Nonempty α]


theorem hom_refl (C : G.ComponentCompl L) : C.hom (subset_refl L) = C

{V : Type u}
{G : SimpleGraph V}
{L : Set V}
(C : G.ComponentCompl L)


@[simp]
theorem upperClosure_singleton (a : α) : upperClosure ({a} : Set α) = UpperSet.Ici a


protected theorem map_smul [Module R₁ M₂] (f : M₁ →L[R₁] M₂) (c : R₁) (x : M₁) :
    f (c • x) = c • f x

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₁ M₂]
(f : M₁ →L[R₁] M₂)
(c : R₁)
(x : M₁)


theorem image2_upperBounds_lowerBounds_subset_upperBounds_image2 :
    image2 f (upperBounds s) (lowerBounds t) ⊆ upperBounds (image2 f s t)

{f : α → β → γ}

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

Set.image2 f (upperBounds s) (lowerBounds t) ⊆ upperBounds (Set.image2 f s t)


@[simp]
theorem mk'_zero (s : M) : IsLocalization.mk' S 0 s = 0

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


theorem sup_toAddSubmonoid : (p ⊔ p').toAddSubmonoid = p.toAddSubmonoid ⊔ p'.toAddSubmonoid

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(p p' : Submodule R M)


theorem nextCoeffUp_of_constantCoeff_eq_zero (p : R[X]) (hp : coeff p 0 = 0) :
    nextCoeffUp p = p.coeff (p.natTrailingDegree + 1)

{R : Type u}
[Semiring R]
(p : R[X])
(hp : p.coeff 0 = 0)

p.nextCoeffUp = p.coeff (p.natTrailingDegree + 1)


theorem Filter.Tendsto.inseparable_iff_uniformity {l : Filter β} [NeBot l] {f g : β → α} {a b : α}
    (ha : Tendsto f l (𝓝 a)) (hb : Tendsto g l (𝓝 b)) :
    Inseparable a b ↔ Tendsto (fun x ↦ (f x, g x)) l (𝓤 α)

{α : Type u}
{β : Type v}
[UniformSpace α]
{l : Filter β}
[l.NeBot]
{f g : β → α}
{a b : α}
(ha : Filter.Tendsto f l (𝓝 a))
(hb : Filter.Tendsto g l (𝓝 b))

Inseparable a b ↔ Filter.Tendsto (fun x => (f x, g x)) l (𝓤 α)


theorem mem_insert (x y : ZFSet) : x ∈ insert x y


/-- The supremum of a chain in the product `ω`-CPO. -/
@[simps]
protected def ωSup (c : Chain (α × β)) : α × β

(c : OmegaCompletePartialOrder.Chain (α × β))

(Prod.ωSup c).2 = OmegaCompletePartialOrder.ωSup (c.map OrderHom.snd)


theorem mul_le_mul_of_nonneg [PosMulMono α] [MulPosMono α]
    (h₁ : a ≤ b) (h₂ : c ≤ d) (a0 : 0 ≤ a) (d0 : 0 ≤ d) : a * c ≤ b * d

{α : Type u_1}
{a b c d : α}
[Mul α]
[Zero α]
[Preorder α]
[PosMulMono α]
[MulPosMono α]
(h₁ : a ≤ b)
(h₂ : c ≤ d)
(a0 : 0 ≤ a)
(d0 : 0 ≤ d)


theorem contains (c) : ∀ {s}, ValidFor l m r s → (s.contains c ↔ c ∈ m)

{l m r : List Char}
(c : Char)
{s : Substring}

Substring.ValidFor l m r s → (s.contains c = true ↔ c ∈ m)


/-- Two formal power series are equal if all their coefficients are equal. -/
@[ext]
theorem ext {φ ψ : R⟦X⟧} (h : ∀ n, coeff R n φ = coeff R n ψ) : φ = ψ

(h : ∀ (n : ℕ), (PowerSeries.coeff R n) φ = (PowerSeries.coeff R n) ψ)


@[to_additive (attr := simp)]
theorem relindex_self : H.relindex H = 1

{G : Type u_1}
[AddGroup G]
(H : AddSubgroup G)


/-- A submonoid of a monoid `M` is a subset containing 1 and closed under multiplication. -/
structure Submonoid (M : Type*) [MulOneClass M] extends Subsemigroup M where
  /-- A submonoid contains `1`. -/
  one_mem' : (1 : M) ∈ carrier

{M : Type u_4}
[MulOneClass M]
(self : Submonoid M)


theorem mdifferentiable_jacobiTheta : MDifferentiable 𝓘(ℂ) 𝓘(ℂ) (jacobiTheta ∘ (↑) : ℍ → ℂ)

MDifferentiable 𝓘(ℂ, ℂ) 𝓘(ℂ, ℂ) (jacobiTheta ∘ UpperHalfPlane.coe)


@[simp]
theorem destruct_nil : destruct (nil : Seq α) = none


@[simp]
theorem coeFn_add (Q Q' : QuadraticMap R M N) : ⇑(Q + Q') = Q + Q'

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
(Q Q' : QuadraticMap R M N)


@[simp]
theorem map_comp_obj' (f : X ⟶ Y) (g : Y ⟶ Z) (U) (p) :
    (map (f ≫ g)).obj ⟨U, p⟩ = (map f).obj ((map g).obj ⟨U, p⟩)

{X Y Z : TopCat}
(f : X ⟶ Y)
(g : Y ⟶ Z)
(U : Set ↑Z)
(p : IsOpen U)

(TopologicalSpace.Opens.map (f ≫ g)).obj { carrier := U, is_open' := p } =
  (TopologicalSpace.Opens.map f).obj ((TopologicalSpace.Opens.map g).obj { carrier := U, is_open' := p })


lemma coe_ker : RingHom.ker f = RingHom.ker (f : A →+* B)

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


theorem multiplicity_prime_le_multiplicity_image_by_factor_orderIso {m p : Associates M}
    {n : Associates N} (hp : p ∈ normalizedFactors m) (d : Set.Iic m ≃o Set.Iic n) :
    multiplicity p m ≤ multiplicity (↑(d ⟨p, dvd_of_mem_normalizedFactors hp⟩)) n

(hp : p ∈ UniqueFactorizationMonoid.normalizedFactors m)

multiplicity p m ≤ multiplicity (↑(d ⟨p, ⋯⟩)) n


theorem sum_blocksFun : ∑ i, c.blocksFun i = n


theorem induced_topology_eq_preorder [Preorder α] [Preorder β] [TopologicalSpace β]
    [OrderTopology β] {f : α → β} (hf : ∀ {x y}, f x < f y ↔ x < y)
    (H₁ : ∀ {a b x}, b < f a → ¬(b < f x) → ∃ y, y < a ∧ b ≤ f y)
    (H₂ : ∀ {a b x}, f a < b → ¬(f x < b) → ∃ y, a < y ∧ f y ≤ b) :
    induced f ‹TopologicalSpace β› = Preorder.topology α

(H₁ : ∀ {a : α} {b : β} {x : α}, b < f a → ¬b < f x → ∃ y < a, b ≤ f y)

(H₂ : ∀ {a : α} {b : β} {x : α}, f a < b → ¬f x < b → ∃ y, a < y ∧ f y ≤ b)

TopologicalSpace.induced f inst✝ = Preorder.topology α


theorem contDiff_arsinh {n : ℕ∞} : ContDiff ℝ n arsinh


@[to_additive]
theorem zpow_trick_one {G : Type*} [Group G] (a b : G) (m : ℤ) :
    a * b * b ^ m = a * b ^ (m + 1)

{G : Type u_1}
[Group G]
(a b : G)
(m : ℤ)


lemma shiftShortComplexFunctorIso_add'_hom_app
    (n m mn : ℤ) (hmn : m + n = mn) (a a' a'' : ℤ) (ha' : n + a = a') (ha'' : m + a' = a'')
    (K : CochainComplex C ℤ) :
    (shiftShortComplexFunctorIso C mn a a'' (by rw [← ha'', ← ha', ← add_assoc, hmn])).hom.app K =
      (shortComplexFunctor C (ComplexShape.up ℤ) a).map
        ((CategoryTheory.shiftFunctorAdd' (CochainComplex C ℤ) m n mn hmn).hom.app K) ≫
        (shiftShortComplexFunctorIso C n a a' ha').hom.app (K⟦m⟧) ≫
        (shiftShortComplexFunctorIso C m a' a'' ha'' ).hom.app K

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(n m mn : ℤ)
(hmn : m + n = mn)
(a a' a'' : ℤ)
(ha' : n + a = a')
(ha'' : m + a' = a'')
(K : CochainComplex C ℤ)

(CochainComplex.shiftShortComplexFunctorIso C mn a a'' ⋯).hom.app K =
  (HomologicalComplex.shortComplexFunctor C (ComplexShape.up ℤ) a).map
      ((CategoryTheory.shiftFunctorAdd' (CochainComplex C ℤ) m n mn hmn).hom.app K) ≫
    (CochainComplex.shiftShortComplexFunctorIso C n a a' ha').hom.app
        ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) m).obj K) ≫
      (CochainComplex.shiftShortComplexFunctorIso C m a' a'' ha'').hom.app K


/-- A functor between categories induces a functor between
the categories of `G`-actions within those categories. -/
@[simps]
def mapAction (F : V ⥤ W) (G : MonCat.{u}) : Action V G ⥤ Action W G

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{W : Type (u + 1)}
[CategoryTheory.LargeCategory W]
(F : V ⥤ W)
(G : MonCat)
(M : Action V G)


/-- To prove an inequality between the lifts to a common universe of two different supremums,
it suffices to show that the lift of each cardinal from the smaller supremum
if bounded by the lift of some cardinal from the larger supremum.
-/
theorem lift_iSup_le_lift_iSup {ι : Type v} {ι' : Type v'} {f : ι → Cardinal.{w}}
    {f' : ι' → Cardinal.{w'}} (hf : BddAbove (range f)) (hf' : BddAbove (range f')) {g : ι → ι'}
    (h : ∀ i, lift.{w'} (f i) ≤ lift.{w} (f' (g i))) : lift.{w'} (iSup f) ≤ lift.{w} (iSup f')

(h : ∀ (i : ι), Cardinal.lift.{w', w} (f i) ≤ Cardinal.lift.{w, w'} (f' (g i)))

Cardinal.lift.{w', w} (iSup f) ≤ Cardinal.lift.{w, w'} (iSup f')


/--
Implementation of the functor `PresheafOfModules R ⥤ Cᵒᵖ ⥤ ModuleCat (R.obj X)`
when `X` is initial.

The functor is implemented as, on object level `M ↦ (c ↦ M(c))` where the `R(X)`-module structure
on `M(c)` is given by restriction of scalars along the unique morphism `R(c) ⟶ R(X)`; and on
morphism level `(f : M ⟶ N) ↦ (c ↦ f(c))`.
-/
@[simps]
noncomputable def forgetToPresheafModuleCatObj
    (X : Cᵒᵖ) (hX : Limits.IsInitial X) (M : PresheafOfModules.{v} R) :
    Cᵒᵖ ⥤ ModuleCat (R.1.obj X)

(hX : CategoryTheory.Limits.IsInitial X)

(PresheafOfModules.forgetToPresheafModuleCatObj X hX M).obj c =
  (ModuleCat.restrictScalars (R.map (hX.to c))).obj (M.obj c)


/-- If a family of sets `𝒜` is contained in an algebra of sets `ℬ`, then so is the algebra of sets
generated by `𝒜`. -/
theorem generateSetAlgebra_subset {ℬ : Set (Set α)} (h : 𝒜 ⊆ ℬ)
    (hℬ : IsSetAlgebra ℬ) : generateSetAlgebra 𝒜 ⊆ ℬ

{α : Type u_1}
{𝒜 ℬ : Set (Set α)}
(h : 𝒜 ⊆ ℬ)
(hℬ : MeasureTheory.IsSetAlgebra ℬ)


lemma WEqualsLocallyBijective.transport : J.WEqualsLocallyBijective A

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

[(G.sheafPushforwardContinuous A K J).EssSurj]

(hG : CategoryTheory.CoverPreserving K J G)


/-- We say that a type has `MeasurableMul` if `(c * ·)` and `(· * c)` are measurable functions.
For a typeclass assuming measurability of `uncurry (*)` see `MeasurableMul₂`. -/
@[to_additive]
class MeasurableMul (M : Type*) [MeasurableSpace M] [Mul M] : Prop where
  measurable_const_mul : ∀ c : M, Measurable (c * ·)
  measurable_mul_const : ∀ c : M, Measurable (· * c)

{M : Type u_2}
[MeasurableSpace M]
[Mul M]
[self : MeasurableMul M]
(c : M)


/-- `DilationEquiv.toEquiv` as a monoid homomorphism. -/
@[simps]
def toPerm : (X ≃ᵈ X) →* Equiv.Perm X

{X : Type u_1}
[PseudoEMetricSpace X]
(e : X ≃ᵈ X)


/-- This is the `iff` version of `Matrix.IsDiag.fromBlocks`. -/
theorem isDiag_fromBlocks_iff [Zero α] {A : Matrix m m α} {B : Matrix m n α} {C : Matrix n m α}
    {D : Matrix n n α} : (A.fromBlocks B C D).IsDiag ↔ A.IsDiag ∧ B = 0 ∧ C = 0 ∧ D.IsDiag

{α : Type u_1}
{n : Type u_4}
{m : Type u_5}
[Zero α]
{A : Matrix m m α}
{B : Matrix m n α}
{C : Matrix n m α}
{D : Matrix n n α}

(Matrix.fromBlocks A B C D).IsDiag ↔ A.IsDiag ∧ B = 0 ∧ C = 0 ∧ D.IsDiag


@[to_additive]
theorem rel_prod {R : M → N → Prop} (h : R 1 1) (hf : (R ⇒ R ⇒ R) (· * ·) (· * ·)) :
    (Forall₂ R ⇒ R) prod prod

(hf : (R ⇒ R ⇒ R) (fun x x_1 => x + x_1) fun x x_1 => x + x_1)


lemma span_selfAdjoint : span ℂ (selfAdjoint A : Set A) = ⊤

{A : Type u_1}
[AddCommGroup A]
[Module ℂ A]
[StarAddMonoid A]
[StarModule ℂ A]


theorem toLin'_symm_apply (A : SpecialLinearGroup n R) (v : n → R) :
    A.toLin'.symm v = Matrix.toLin' (↑ₘA⁻¹) v

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

(Matrix.SpecialLinearGroup.toLin' A).symm v = (Matrix.toLin' ↑A⁻¹) v


theorem comap_iInf {ι β} (f : α → β) (m : ι → OuterMeasure β) :
    comap f (⨅ i, m i) = ⨅ i, comap f (m i)

{α : Type u_1}
{ι : Sort u_2}
{β : Type u_3}
(f : α → β)
(m : ι → MeasureTheory.OuterMeasure β)

(MeasureTheory.OuterMeasure.comap f) (⨅ i, m i) = ⨅ i, (MeasureTheory.OuterMeasure.comap f) (m i)


theorem isCoprime_zero_left : IsCoprime 0 x ↔ IsUnit x


theorem exists_mem_cons_iff (p : α → Prop) (a : α) (l : List α) :
    (∃ x ∈ a :: l, p x) ↔ p a ∨ ∃ x ∈ l, p x

{α : Type u}
(p : α → Prop)
(a : α)
(l : List α)

(∃ x, x ∈ a :: l ∧ p x) ↔ p a ∨ ∃ x, x ∈ l ∧ p x


lemma Indep.mem_closure_iff (hI : M.Indep I) :
    x ∈ M.closure I ↔ M.Dep (insert x I) ∨ x ∈ I

{α : Type u_2}
{M : Matroid α}
{I : Set α}
{x : α}
(hI : M.Indep I)


@[simp]
theorem spanningCoe_top : (⊤ : Subgraph G).spanningCoe = G


@[simp]
lemma comp_autMap {A B : C} [IsConnected A] [IsGalois B] (f : A ⟶ B) (σ : Aut A) :
    f ≫ (autMap f σ).hom = σ.hom ≫ f

CategoryTheory.CategoryStruct.comp f (CategoryTheory.PreGaloisCategory.autMap f σ).hom =
  CategoryTheory.CategoryStruct.comp σ.hom f


@[simp, reassoc]
lemma comp_hom₂ {X Y Z : Triangle C} (f : X ⟶ Y) (g : Y ⟶ Z) :
    (f ≫ g).hom₂ = f.hom₂ ≫ g.hom₂

{X Y Z : CategoryTheory.Pretriangulated.Triangle C}


theorem pairwise_replicate {α : Type _} {r : α → α → Prop} {x : α} (hx : r x x) :
    ∀ n : Nat, Pairwise r (List.replicate n x)

{α : Type u_1}
{r : α → α → Prop}
{x : α}
(hx : r x x)
(n : Nat)


theorem eq_neg_one_of_two_right [NoZeroDivisors R] {ζ : R} (h : IsPrimitiveRoot ζ 2) : ζ = -1

{R : Type u_4}
[CommRing R]
[NoZeroDivisors R]
{ζ : R}
(h : IsPrimitiveRoot ζ 2)


/-- This is a simple version of the **Unfolding Trick**: Given a subgroup `Γ` of a group `G`, the
  integral of a function `f` on `G` with respect to a right-invariant measure `μ` is equal to the
  integral over the quotient `G ⧸ Γ` of the automorphization of `f`. -/
@[to_additive "This is a simple version of the **Unfolding Trick**: Given a subgroup `Γ` of an
  additive  group `G`, the integral of a function `f` on `G` with respect to a right-invariant
  measure `μ` is equal to the integral over the quotient `G ⧸ Γ` of the automorphization of `f`."]
lemma QuotientGroup.integral_eq_integral_automorphize {E : Type*} [NormedAddCommGroup E]
    [NormedSpace ℝ E] [μ.IsMulRightInvariant] {f : G → E}
    (hf₁ : Integrable f μ) (hf₂ : AEStronglyMeasurable (automorphize f) μ_𝓕) :
    ∫ x : G, f x ∂μ = ∫ x : G ⧸ Γ, automorphize f x ∂μ_𝓕

(h𝓕 : MeasureTheory.IsFundamentalDomain (↥Γ.op) 𝓕 μ)

(hf₂ :
  MeasureTheory.AEStronglyMeasurable (QuotientGroup.automorphize f)
    (MeasureTheory.Measure.map QuotientGroup.mk (μ.restrict 𝓕)))

∫ (x : G), f x ∂μ =
  ∫ (x : G ⧸ Γ), QuotientGroup.automorphize f x ∂MeasureTheory.Measure.map QuotientGroup.mk (μ.restrict 𝓕)


@[to_additive (attr := simp, norm_cast)]
theorem coe_div [Div M] (f g : α → M) : ↑(f / g) = (f / g : Germ l M)

{α : Type u_1}
{l : Filter α}
{M : Type u_5}
[Div M]
(f g : α → M)


@[simp]
theorem lcm_cons (a : α) (s : Multiset α) : (a ::ₘ s).lcm = GCDMonoid.lcm a s.lcm

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
(a : α)
(s : Multiset α)


lemma map_basis_iff' {I X : Set β} {hf} :
    (M.map f hf).Basis I X ↔ ∃ I₀ X₀, M.Basis I₀ X₀ ∧ I = f '' I₀ ∧ X = f '' X₀

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{M : Matroid α}
{I X : Set β}
{hf : Set.InjOn f M.E}


@[to_additive]
theorem smul_finset_inter_subset : a • (s₁ ∩ s₂) ⊆ a • s₁ ∩ a • s₂

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

a • (s₁ ∩ s₂) ⊆ a • s₁ ∩ a • s₂


theorem sub_lt_of_le {a b c : Ordinal} (h : b ≤ a) : a - b < c ↔ a < b + c


/-- The Hausdorff edistance of a set to itself vanishes. -/
@[simp]
theorem hausdorffEdist_self : hausdorffEdist s s = 0

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


@[simp] lemma toENat_le_nat {a : Cardinal} {n : ℕ} : toENat a ≤ n ↔ a ≤ n


@[simp]
theorem untrop_inj_iff (x y : Tropical R) : untrop x = untrop y ↔ x = y

Tropical.untrop x = Tropical.untrop y ↔ x = y


theorem bool_iff_false {b : Bool} : ¬b ↔ b = false


lemma eulerMascheroniSeq_lt_eulerMascheroniConstant (n : ℕ) :
    eulerMascheroniSeq n < eulerMascheroniConstant

Real.eulerMascheroniSeq n < Real.eulerMascheroniConstant


@[simp]
theorem mem_zero (x : E) : x ∈ (0 : ProperCone 𝕜 E) ↔ x = 0

{𝕜 : Type u_1}
[OrderedSemiring 𝕜]
{E : Type u_2}
[AddCommMonoid E]
[TopologicalSpace E]
[T1Space E]
[Module 𝕜 E]
(x : E)


theorem admissible_of_one_lt_sumInv_aux' {p q r : ℕ+} (hpq : p ≤ q) (hqr : q ≤ r)
    (H : 1 < sumInv {p, q, r}) : Admissible {p, q, r}

(H : 1 < ADEInequality.sumInv {p, q, r})


theorem mk_preimage_of_subset_range (f : α → β) (s : Set β) (h : s ⊆ range f) :
    #s ≤ #(f ⁻¹' s)

{α β : Type u}
(f : α → β)
(s : Set β)
(h : s ⊆ Set.range f)


@[to_additive]
theorem mul_inv_lt_one_iff : b * a⁻¹ < 1 ↔ b < a

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


@[to_additive (attr := simp)]
theorem mk_div_mk [Div G] [Div H] (x₁ x₂ : G) (y₁ y₂ : H) :
    (x₁, y₁) / (x₂, y₂) = (x₁ / x₂, y₁ / y₂)

{G : Type u_3}
{H : Type u_4}
[Div G]
[Div H]
(x₁ x₂ : G)
(y₁ y₂ : H)


@[to_additive]
theorem prod_range_succ_div_prod : ((∏ i ∈ range (n + 1), f i) / ∏ i ∈ range n, f i) = f n

{M : Type u_3}
(f : ℕ → M)
{n : ℕ}
[AddCommGroup M]

∑ i ∈ Finset.range (n + 1), f i - ∑ i ∈ Finset.range n, f i = f n


theorem mem_upperBounds_image2_of_mem_lowerBounds (ha : a ∈ lowerBounds s)
    (hb : b ∈ lowerBounds t) : f a b ∈ upperBounds (image2 f s t)

{f : α → β → γ}

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


/-- A proper cone is a pointed cone `K` that is closed. Proper cones have the nice property that
they are equal to their double dual, see `ProperCone.dual_dual`.
This makes them useful for defining cone programs and proving duality theorems. -/
structure ProperCone (𝕜 : Type*) (E : Type*) [OrderedSemiring 𝕜] [AddCommMonoid E]
    [TopologicalSpace E] [Module 𝕜 E] extends Submodule {c : 𝕜 // 0 ≤ c} E where
  isClosed' : IsClosed (carrier : Set E)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[TopologicalSpace E]
[Module 𝕜 E]
(self : ProperCone 𝕜 E)


@[simp] theorem any_cons : (a::l).any f = (f a || l.any f)

∀ {α : Type u_1} {a : α} {l : List α} {f : α → Bool}, (a :: l).any f = (f a || l.any f)


@[simp]
theorem continuousWithinAt_compl_self {f : α → β} {a : α} :
    ContinuousWithinAt f {a}ᶜ a ↔ ContinuousAt f a

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{a : α}


@[simp]
theorem uncurry_apply_pair {α β γ} (f : α → β → γ) (x : α) (y : β) : uncurry f (x, y) = f x y

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


/-- This universal property states that a functor `L : C ⥤ D` inverts morphisms
in `W` and the all functors `D ⥤ E` (for a fixed category `E`) uniquely factors
through `L`. -/
structure StrictUniversalPropertyFixedTarget where
  /-- the functor `L` inverts `W` -/
  inverts : W.IsInvertedBy L
  /-- any functor `C ⥤ E` which inverts `W` can be lifted as a functor `D ⥤ E`  -/
  lift : ∀ (F : C ⥤ E) (_ : W.IsInvertedBy F), D ⥤ E
  /-- there is a factorisation involving the lifted functor  -/
  fac : ∀ (F : C ⥤ E) (hF : W.IsInvertedBy F), L ⋙ lift F hF = F
  /-- uniqueness of the lifted functor -/
  uniq : ∀ (F₁ F₂ : D ⥤ E) (_ : L ⋙ F₁ = L ⋙ F₂), F₁ = F₂

(self : CategoryTheory.Localization.StrictUniversalPropertyFixedTarget L W E)


theorem Gamma_eq_zero_iff (s : ℂ) : Gamma s = 0 ↔ ∃ m : ℕ, s = -m


theorem _root_.Pi.lex_eq_finsupp_lex {r : α → α → Prop} {s : N → N → Prop} (a b : α →₀ N) :
    Pi.Lex r s a b = Finsupp.Lex r s a b

{α : Type u_1}
{N : Type u_2}
[Zero N]
{r : α → α → Prop}
{s : N → N → Prop}
(a b : α →₀ N)

Pi.Lex r (fun {i} => s) ⇑a ⇑b = Finsupp.Lex r s a b


theorem measurableSet_of_continuousAt {β} [EMetricSpace β] (f : α → β) :
    MeasurableSet { x | ContinuousAt f x }

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
{β : Type u_6}
[EMetricSpace β]
(f : α → β)


/-- Reindexing by the inverse of an equivalence and that equivalence yields the original simplex. -/
@[simp]
theorem reindex_symm_reindex {m n : ℕ} (s : Simplex k P m) (e : Fin (n + 1) ≃ Fin (m + 1)) :
    (s.reindex e.symm).reindex e = s

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{m n : ℕ}
(s : Affine.Simplex k P m)
(e : Fin (n + 1) ≃ Fin (m + 1))


theorem card_memberSubfamily_add_card_nonMemberSubfamily (a : α) (𝒜 : Finset (Finset α)) :
    (𝒜.memberSubfamily a).card + (𝒜.nonMemberSubfamily a).card = 𝒜.card

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

(Finset.memberSubfamily a 𝒜).card + (Finset.nonMemberSubfamily a 𝒜).card = 𝒜.card


theorem WithTop.range_eq {α β} (f : WithTop α → β) :
    range f = insert (f ⊤) (range (f ∘ WithBot.some : α → β))

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

Set.range f = insert (f ⊤) (Set.range (f ∘ WithBot.some))


theorem infinite_image2 (hfs : ∀ b ∈ t, InjOn (fun a => f a b) s) (hft : ∀ a ∈ s, InjOn (f a) t) :
    (image2 f s t).Infinite ↔ s.Infinite ∧ t.Nonempty ∨ t.Infinite ∧ s.Nonempty

{f : α → β → γ}

(hfs : ∀ b ∈ t, Set.InjOn (fun a => f a b) s)

(Set.image2 f s t).Infinite ↔ s.Infinite ∧ t.Nonempty ∨ t.Infinite ∧ s.Nonempty


theorem Real.smul_iInf_of_nonneg (ha : 0 ≤ a) (f : ι → ℝ) : (a • ⨅ i, f i) = ⨅ i, a • f i

{ι : Sort u_1}
{α : Type u_2}
[LinearOrderedField α]
[MulActionWithZero α ℝ]
[OrderedSMul α ℝ]
{a : α}
(ha : 0 ≤ a)
(f : ι → ℝ)


@[simp]
theorem id_comp (f : CoheytingHom α β) : (CoheytingHom.id β).comp f = f

{α : Type u_2}
{β : Type u_3}
[CoheytingAlgebra α]
[CoheytingAlgebra β]
(f : CoheytingHom α β)


@[to_additive (attr := simp)]
theorem map_apply_inl (f : M →* M') (g : N →* N') (x : M) : map f g (inl x) = inl (f x)

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

(Monoid.Coprod.map f g) (Monoid.Coprod.inl x) = Monoid.Coprod.inl (f x)


theorem iSup_partialSups_eq (f : ℕ → α) : ⨆ n, partialSups f n = ⨆ n, f n

{α : Type u_1}
[CompleteLattice α]
(f : ℕ → α)


theorem upperCrossingTime_lt_succ (hab : a < b) (hn : upperCrossingTime a b f N (n + 1) ω ≠ N) :
    upperCrossingTime a b f N n ω < upperCrossingTime a b f N (n + 1) ω

{f : ℕ → Ω → ℝ}

(hn : MeasureTheory.upperCrossingTime a b f N (n + 1) ω ≠ N)

MeasureTheory.upperCrossingTime a b f N n ω < MeasureTheory.upperCrossingTime a b f N (n + 1) ω


theorem coeff_sub_eq_left_of_lt (dg : q.natDegree < n) : (p - q).coeff n = p.coeff n

{R : Type u}
{n : ℕ}
[Ring R]
{p q : R[X]}
(dg : q.natDegree < n)


theorem atTop_hasCountableBasis_of_archimedean [StrictOrderedSemiring R] [Archimedean R] :
    (atTop : Filter R).HasCountableBasis (fun _ : ℕ => True) fun n => Ici n

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

Filter.atTop.HasCountableBasis (fun x => True) fun n => Set.Ici ↑n


/-- The formula `Ring.inverse (x + t) = Ring.inverse (1 + x⁻¹ * t) * x⁻¹` holds for `t` sufficiently
small. -/
theorem inverse_add (x : Rˣ) :
    ∀ᶠ t in 𝓝 0, inverse ((x : R) + t) = inverse (1 + ↑x⁻¹ * t) * ↑x⁻¹

{R : Type u_1}
[NormedRing R]
[CompleteSpace R]
(x : Rˣ)

∀ᶠ (t : R) in 𝓝 0, Ring.inverse (↑x + t) = Ring.inverse (1 + ↑x⁻¹ * t) * ↑x⁻¹


@[simp]
theorem norm_eq_zero {x : ℤ[i]} : norm x = 0 ↔ x = 0


/-- Two finite measures on a Borel space are equal if they agree on all left-closed right-infinite
intervals. -/
theorem ext_of_Ici {α : Type*} [TopologicalSpace α] {m : MeasurableSpace α}
    [SecondCountableTopology α] [LinearOrder α] [OrderTopology α] [BorelSpace α] (μ ν : Measure α)
    [IsFiniteMeasure μ] (h : ∀ a, μ (Ici a) = ν (Ici a)) : μ = ν

(h : ∀ (a : α), μ (Set.Ici a) = ν (Set.Ici a))


theorem rtendsto'_nhds {r : Rel Y X} {l : Filter Y} {x : X} :
    RTendsto' r l (𝓝 x) ↔ ∀ s, IsOpen s → x ∈ s → r.preimage s ∈ l

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
{r : Rel Y X}
{l : Filter Y}
{x : X}

Filter.RTendsto' r l (𝓝 x) ↔ ∀ (s : Set X), IsOpen s → x ∈ s → r.preimage s ∈ l


theorem uniformContinuous_coe_real : UniformContinuous ((↑) : ℚ → ℝ)


theorem indepSets_of_indepSets_of_le_right {s₁ s₂ s₃ : Set (Set Ω)} {_mΩ : MeasurableSpace Ω}
    {κ : Kernel α Ω} {μ : Measure α} (h_indep : IndepSets s₁ s₂ κ μ) (h32 : s₃ ⊆ s₂) :
    IndepSets s₁ s₃ κ μ

(h_indep : ProbabilityTheory.Kernel.IndepSets s₁ s₂ κ μ)

ProbabilityTheory.Kernel.IndepSets s₁ s₃ κ μ


theorem toEnd' (it : Iterator) : ValidFor it.s.1.reverse [] it.toEnd

String.Iterator.ValidFor it.s.data.reverse [] it.toEnd


theorem Measure.FiniteAtFilter.integrableAtFilter_of_tendsto {l : Filter α}
    [IsMeasurablyGenerated l] (hfm : StronglyMeasurableAtFilter f l μ) (hμ : μ.FiniteAtFilter l) {b}
    (hf : Tendsto f l (𝓝 b)) : IntegrableAtFilter f l μ


@[simp]
theorem swap_mul_self (i j : α) : swap i j * swap i j = 1


theorem left_comm : Commutative f → Associative f → LeftCommutative f


protected theorem Inducing.comp (hg : Inducing g) (hf : Inducing f) :
    Inducing (g ∘ f)

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


theorem opNorm_mulLeftRight_apply_le (x : 𝕜') : ‖mulLeftRight 𝕜 𝕜' x‖ ≤ ‖x‖

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
(𝕜' : Type u_3)
[NonUnitalSeminormedRing 𝕜']
[NormedSpace 𝕜 𝕜']
[IsScalarTower 𝕜 𝕜' 𝕜']
[SMulCommClass 𝕜 𝕜' 𝕜']
(x : 𝕜')

‖(ContinuousLinearMap.mulLeftRight 𝕜 𝕜') x‖ ≤ ‖x‖


protected theorem surjective (e : X ≃ᵈ Y) : Surjective e

{X : Type u_1}
{Y : Type u_2}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
(e : X ≃ᵈ Y)


@[simp] theorem xor_true : Xor' True = Not


/-- a function `f : α × β → ℚ → ℝ` is called a rational conditional kernel CDF of `κ` with respect
to `ν` if is measurable, if `fun b ↦ f (a, b) x` is `(ν a)`-integrable for all `a : α` and `x : ℝ`
and for all measurable sets `s : Set β`, `∫ b in s, f (a, b) x ∂(ν a) = (κ a (s ×ˢ Iic x)).toReal`.
Also the `ℚ → ℝ` function `f (a, b)` should satisfy the properties of a Sieltjes function for
`(ν a)`-almost all `b : β`. -/
structure IsRatCondKernelCDF (f : α × β → ℚ → ℝ) (κ : Kernel α (β × ℝ)) (ν : Kernel α β) : Prop :=
  measurable : Measurable f
  isRatStieltjesPoint_ae (a : α) : ∀ᵐ b ∂(ν a), IsRatStieltjesPoint f (a, b)
  integrable (a : α) (q : ℚ) : Integrable (fun b ↦ f (a, b) q) (ν a)
  setIntegral (a : α) {s : Set β} (_hs : MeasurableSet s) (q : ℚ) :
    ∫ b in s, f (a, b) q ∂(ν a) = (κ a (s ×ˢ Iic (q : ℝ))).toReal

{f : α × β → ℚ → ℝ}

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

(self : ProbabilityTheory.IsRatCondKernelCDF f κ ν)


lemma ωSup_eq_of_isLUB {c : Chain α} {a : α} (h : IsLUB (Set.range c) a) : a = ωSup c

{α : Type u}
[OmegaCompletePartialOrder α]
{c : OmegaCompletePartialOrder.Chain α}
{a : α}
(h : IsLUB (Set.range ⇑c) a)


lemma InfClosed.finsetInf_mem [OrderTop α] (hs : InfClosed s) (ht : t.Nonempty) :
    (∀ i ∈ t, f i ∈ s) → t.inf f ∈ s

{α : Type u_2}
[SemilatticeInf α]
{ι : Type u_4}
{f : ι → α}
{s : Set α}
{t : Finset ι}
[OrderTop α]
(hs : InfClosed s)
(ht : t.Nonempty)


private theorem list_casesOn' {f : α → List β} {g : α → σ} {h : α → β × List β → σ}
    (hf : haveI := prim H; Primrec f) (hg : Primrec g) (hh : haveI := prim H; Primrec₂ h) :
    @Primrec _ σ _ _ fun a => List.casesOn (f a) (g a) fun b l => h a (b, l)

(H : Nat.Primrec fun n => Encodable.encode (Encodable.decode n))

Primrec fun a => List.casesOn (f a) (g a) fun b l => h a (b, l)


/-- If `C, D` has all colimits of shape `J`, and `G` preserves them, then `preservesColimitIso`
is functorial wrt `F`. -/
@[simps!]
def preservesColimitNatIso : colim ⋙ G ≅ (whiskeringRight J C D).obj G ⋙ colim

(CategoryTheory.preservesColimitNatIso G).hom.app X = (CategoryTheory.preservesColimitIso G X).hom


@[simp, norm_cast]
theorem coe_add (x y : { x : M // 0 < x }) : ↑(x + y) = (x + y : M)

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


@[to_additive (attr := simp)]
theorem ofDual_inv [Inv α] (a : αᵒᵈ) : ofDual a⁻¹ = (ofDual a)⁻¹

OrderDual.ofDual (-a) = -OrderDual.ofDual a


/-- Continuous path connecting two points `x` and `y` in a topological space -/
-- porting note (#5171): removed @[nolint has_nonempty_instance]
structure Path (x y : X) extends C(I, X) where
  /-- The start point of a `Path`. -/
  source' : toFun 0 = x
  /-- The end point of a `Path`. -/
  target' : toFun 1 = y

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
(self : Path x y)


theorem support_single_ne_zero {i : ι} {b : β i} (hb : b ≠ 0) : (single i b).support = {i}

[(i : ι) → (x : β i) → Decidable (x ≠ 0)]


@[simp]
theorem conj_zpow {i : ℤ} {a b : α} : (a * b * a⁻¹) ^ i = a * b ^ i * a⁻¹

{α : Type u}
[Group α]
{i : ℤ}
{a b : α}


theorem fract_floor (a : α) : fract (⌊a⌋ : α) = 0

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(a : α)


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

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

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


lemma primeFactors_pow_succ (n k : ℕ) : (n ^ (k + 1)).primeFactors = n.primeFactors


theorem support_cycleOf_eq_nil_iff [DecidableEq α] [Fintype α] :
    (f.cycleOf x).support = ∅ ↔ x ∉ f.support

{α : Type u_2}
{f : Equiv.Perm α}
{x : α}
[DecidableRel f.SameCycle]
[DecidableEq α]
[Fintype α]


/-- We can prove the `eq` along with the lemma. Thus this is bundled together here, and the
lemma itself is separated below.
-/
theorem snd_invApp_t_app' (i j k : D.J) (U : Opens (pullback (D.f i j) (D.f i k)).carrier) :
    ∃ eq,
      (π₂⁻¹ i, j, k) U ≫ (D.t k i).c.app _ ≫ (D.V (k, i)).presheaf.map (eqToHom eq) =
        (D.t' k i j).c.app _ ≫ (π₁⁻¹ k, j, i) (unop _)

(D : AlgebraicGeometry.PresheafedSpace.GlueData C)

(U : TopologicalSpace.Opens ↑↑(CategoryTheory.Limits.pullback (D.f i j) (D.f i k)))

∃ (eq :
  (TopologicalSpace.Opens.map (D.t k i).base).op.obj
      (Opposite.op
        ((AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.opensFunctor
              (CategoryTheory.Limits.pullback.snd (D.f i j) (D.f i k))).obj
          U)) =
    Opposite.op
      ((AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.opensFunctor
            (CategoryTheory.Limits.pullback.fst (D.f k i) (D.f k j))).obj
        (Opposite.unop
          (Opposite.op { carrier := ⇑(D.t' k i j).base ⁻¹' ↑(Opposite.unop (Opposite.op U)), is_open' := ⋯ })))),
  AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp (CategoryTheory.Limits.pullback.snd (D.f i j) (D.f i k)) U ≫
      (D.t k i).c.app
          (Opposite.op
            ((AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.opensFunctor
                  (CategoryTheory.Limits.pullback.snd (D.f i j) (D.f i k))).obj
              U)) ≫
        (D.V (k, i)).presheaf.map (CategoryTheory.eqToHom eq) =
    (D.t' k i j).c.app (Opposite.op U) ≫
      AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp (CategoryTheory.Limits.pullback.fst (D.f k i) (D.f k j))
        (Opposite.unop
          (Opposite.op { carrier := ⇑(D.t' k i j).base ⁻¹' ↑(Opposite.unop (Opposite.op U)), is_open' := ⋯ }))


@[elab_as_elim]
theorem induction_on₃ {α' β' : Type*} [MeasurableSpace α'] [TopologicalSpace β'] {μ' : Measure α'}
    {α'' β'' : Type*} [MeasurableSpace α''] [TopologicalSpace β''] {μ'' : Measure α''}
    (f : α →ₘ[μ] β) (f' : α' →ₘ[μ'] β') (f'' : α'' →ₘ[μ''] β'')
    {p : (α →ₘ[μ] β) → (α' →ₘ[μ'] β') → (α'' →ₘ[μ''] β'') → Prop}
    (H : ∀ f hf f' hf' f'' hf'', p (mk f hf) (mk f' hf') (mk f'' hf'')) : p f f' f''

(H :
  ∀ (f : α → β) (hf : MeasureTheory.AEStronglyMeasurable f μ) (f' : α' → β')
    (hf' : MeasureTheory.AEStronglyMeasurable f' μ') (f'' : α'' → β'')
    (hf'' : MeasureTheory.AEStronglyMeasurable f'' μ''),
    p (MeasureTheory.AEEqFun.mk f hf) (MeasureTheory.AEEqFun.mk f' hf') (MeasureTheory.AEEqFun.mk f'' hf''))


@[simp]
lemma add_v {n : ℤ} (z₁ z₂ : Cochain F G n) (p q : ℤ) (hpq : p + n = q) :
    (z₁ + z₂).v p q hpq = z₁.v p q hpq + z₂.v p q hpq

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


@[simp]
theorem pullbackConeOfLeftIso_π_app_left : (pullbackConeOfLeftIso f g).π.app left = g ≫ inv f

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

(CategoryTheory.Limits.pullbackConeOfLeftIso f g).π.app CategoryTheory.Limits.WalkingCospan.left =
  g ≫ CategoryTheory.inv f


theorem lookupAll_length_le_one (a : α) {l : List (Sigma β)} (h : l.NodupKeys) :
    length (lookupAll a l) ≤ 1

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
{l : List (Sigma β)}
(h : l.NodupKeys)


theorem sub (hf : IsBoundedLinearMap 𝕜 f) (hg : IsBoundedLinearMap 𝕜 g) :
    IsBoundedLinearMap 𝕜 fun e => f e - g e

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


@[simp]
theorem getI_cons_zero : getI (x :: xs) 0 = x

{α : Type u}
(x : α)
(xs : List α)
[Inhabited α]


class IncidenceGeometry where
  Point : Type u₁
  Line : Type u₂
  Circle : Type u₃

  between : Point → Point → Point → Prop -- implies colinearity
  onLine : Point → Line → Prop
  onCircle : Point → Circle → Prop
  inCircle : Point → Circle → Prop
  centerCircle : Point → Circle → Prop
  circlesInter : Circle → Circle → Prop

  ne_23_of_between : ∀ {a b c : Point}, between a b c → b ≠ c
  line_unique_of_pts : ∀ {a b : Point}, ∀ {L M : Line},
    a ≠ b → onLine a L → onLine b L → onLine a M → onLine b M → L = M
  onLine_2_of_between : ∀ {a b c : Point}, ∀ {L : Line},
    between a b c → onLine a L → onLine c L → onLine b L
  line_of_pts : ∀ a b, ∃ L, onLine a L ∧ onLine b L
  circle_of_ne : ∀ a b, a ≠ b → ∃ C, centerCircle a C ∧ onCircle b C
  circlesInter_of_onCircle_inCircle :
    ∀ {a b α β}, onCircle b α → onCircle a β → inCircle a α →
    inCircle b β → circlesInter α β
  pts_of_circlesInter : ∀ {α β}, circlesInter α β →
    ∃ a b, a ≠ b ∧ onCircle a α ∧ onCircle a β ∧ onCircle b α ∧ onCircle b β
  inCircle_of_centerCircle : ∀ {a α}, centerCircle a α → inCircle a α

[self : IncidenceGeometry]
{a b c : IncidenceGeometry.Point}
{L : IncidenceGeometry.Line}

IncidenceGeometry.between a b c →
  IncidenceGeometry.onLine a L → IncidenceGeometry.onLine c L → IncidenceGeometry.onLine b L


theorem forall_fin_succ {P : Fin (n + 1) → Prop} : (∀ i, P i) ↔ P 0 ∧ ∀ i : Fin n, P i.succ

(∀ (i : Fin (n + 1)), P i) ↔ P 0 ∧ ∀ (i : Fin n), P i.succ


protected theorem repr_self (b : HilbertBasis ι 𝕜 E) (i : ι) :
    b.repr (b i) = lp.single 2 i (1 : 𝕜)

{ι : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(b : HilbertBasis ι 𝕜 E)
(i : ι)

b.repr ((fun i => b.repr.symm (lp.single 2 i 1)) i) = lp.single 2 i 1


@[simp]
theorem ord_lt_ord {c₁ c₂} : ord c₁ < ord c₂ ↔ c₁ < c₂


/-- Used to bootstrap the proof of `isJacobson_polynomial_iff_isJacobson`.
  That theorem is more general and should be used instead of this one. -/
private theorem isJacobson_polynomial_of_domain (R : Type*) [CommRing R] [IsDomain R]
    [hR : IsJacobson R] (P : Ideal R[X]) [IsPrime P] (hP : ∀ x : R, C x ∈ P → x = 0) :
    P.jacobson = P

(hP : ∀ (x : R), Polynomial.C x ∈ P → x = 0)


@[to_additive]
theorem Submonoid.powers_fg (r : M) : (Submonoid.powers r).FG


theorem piCongrLeft_preimage_univ_pi (f : ι' ≃ ι) (t : ∀ i, Set (α i)) :
    f.piCongrLeft α ⁻¹' univ.pi t = univ.pi fun i => t (f i)

{ι : Type u_1}
{ι' : Type u_2}
{α : ι → Type u_3}
(f : ι' ≃ ι)
(t : (i : ι) → Set (α i))

⇑(Equiv.piCongrLeft α f) ⁻¹' Set.univ.pi t = Set.univ.pi fun i => t (f i)


@[simp]
lemma toProd_one_tmul_ι (m₂ : M₂) : toProd Q₁ Q₂ (1 ᵍ⊗ₜ ι _ m₂) = ι _ (0, m₂)

{R : Type u_1}
{M₁ : Type u_2}
{M₂ : Type u_3}
[CommRing R]
[AddCommGroup M₁]
[AddCommGroup M₂]
[Module R M₁]
[Module R M₂]
(Q₁ : QuadraticForm R M₁)
(Q₂ : QuadraticForm R M₂)
(m₂ : M₂)

(CliffordAlgebra.toProd Q₁ Q₂) (1 ᵍ⊗ₜ[R] (CliffordAlgebra.ι Q₂) m₂) =
  (CliffordAlgebra.ι (QuadraticMap.prod Q₁ Q₂)) (0, m₂)


/-- A constant multiplier of the weights in `weightedVSubOfPoint` may be moved outside the
sum. -/
theorem weightedVSubOfPoint_const_smul (w : ι → k) (p : ι → P) (b : P) (c : k) :
    s.weightedVSubOfPoint p b (c • w) = c • s.weightedVSubOfPoint p b w

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
(w : ι → k)
(p : ι → P)
(b : P)
(c : k)

(s.weightedVSubOfPoint p b) (c • w) = c • (s.weightedVSubOfPoint p b) w


theorem IsCycleOn.of_pow {n : ℕ} (hf : (f ^ n).IsCycleOn s) (h : Set.BijOn f s s) : f.IsCycleOn s

{α : Type u_2}
{f : Equiv.Perm α}
{s : Set α}
{n : ℕ}
(hf : (f ^ n).IsCycleOn s)
(h : Set.BijOn (⇑f) s s)


@[reassoc (attr := simp)]
lemma rightDerivedZeroIsoSelf_inv_hom_id :
    F.toRightDerivedZero ≫ F.rightDerivedZeroIsoSelf.hom = 𝟙 _

CategoryTheory.CategoryStruct.comp F.toRightDerivedZero F.rightDerivedZeroIsoSelf.hom =
  CategoryTheory.CategoryStruct.id F


/-- Construct a pseudofunctor from a lax functor whose `mapId` and `mapComp` are isomorphisms. -/
@[simps!]
noncomputable def mkOfLax' (F : LaxFunctor B C) [∀ a, IsIso (F.mapId a)]
    [∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), IsIso (F.mapComp f g)] : Pseudofunctor B C

[∀ (a : B), CategoryTheory.IsIso (F.mapId a)]

[∀ {a b c : B} (f : a ⟶ b) (g : b ⟶ c), CategoryTheory.IsIso (F.mapComp f g)]

∀ {a b c : B} (f : a ⟶ b) (g : b ⟶ c),
  ((CategoryTheory.Pseudofunctor.mkOfLax' F).mapComp f g).hom = CategoryTheory.inv (F.mapComp f g)


theorem QuotientRing.quotientMap_coe_coe : QuotientMap fun p : R × R => (mk N p.1, mk N p.2)

{R : Type u_1}
[TopologicalSpace R]
[CommRing R]
(N : Ideal R)
[TopologicalRing R]

QuotientMap fun p => ((Ideal.Quotient.mk N) p.1, (Ideal.Quotient.mk N) p.2)


/-- The category of multiforks is equivalent to the category of forks over `∏ᶜ I.left ⇉ ∏ᶜ I.right`.
It then follows from `CategoryTheory.IsLimit.ofPreservesConeTerminal` (or `reflects`) that it
preserves and reflects limit cones.
-/
@[simps]
noncomputable def multiforkEquivPiFork : Multifork I ≌ Fork I.fstPiMap I.sndPiMap

(I : CategoryTheory.Limits.MulticospanIndex C)


theorem liftAddHom_apply_single [AddCommMonoid M] [AddCommMonoid N] (f : α → M →+ N) (a : α)
    (b : M) : (liftAddHom (α := α) (M := M) (N := N)) f (single a b) = f a b

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[AddCommMonoid M]
[AddCommMonoid N]
(f : α → M →+ N)
(a : α)
(b : M)

(Finsupp.liftAddHom f) (Finsupp.single a b) = (f a) b


theorem Iso.connected_iff {G : SimpleGraph V} {H : SimpleGraph V'} (e : G ≃g H) :
    G.Connected ↔ H.Connected

{V : Type u}
{V' : Type v}
{G : SimpleGraph V}
{H : SimpleGraph V'}
(e : G ≃g H)


/-- `biproduct_comparison' F f` is a split monomorphism. -/
@[simps]
def splitMonoBiproductComparison' : SplitMono (biproductComparison' F f)

[CategoryTheory.Limits.HasBiproduct (F.obj ∘ f)]

(F.splitMonoBiproductComparison' f).retraction = F.biproductComparison f


theorem card_interedges_add_card_interedges_compl (s : Finset α) (t : Finset β) :
    (interedges r s t).card + (interedges (fun x y ↦ ¬r x y) s t).card = s.card * t.card

{α : Type u_4}
{β : Type u_5}
(r : α → β → Prop)
[(a : α) → DecidablePred (r a)]
(s : Finset α)
(t : Finset β)

(Rel.interedges r s t).card + (Rel.interedges (fun x y => ¬r x y) s t).card = s.card * t.card


@[simp]
theorem symm_refl : (PEquiv.refl α).symm = PEquiv.refl α


/-- To prove something for an arbitrary `Memℒp` function in a second countable
Borel normed group, it suffices to show that
* the property holds for (multiples of) characteristic functions;
* is closed under addition;
* the set of functions in the `Lᵖ` space for which the property holds is closed.
* the property is closed under the almost-everywhere equal relation.

It is possible to make the hypotheses in the induction steps a bit stronger, and such conditions
can be added once we need them (for example in `h_add` it is only necessary to consider the sum of
a simple function with a multiple of a characteristic function and that the intersection
of their images is a subset of `{0}`).
-/
@[elab_as_elim]
theorem Memℒp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop)
    (h_ind : ∀ (c : E) ⦃s⦄, MeasurableSet s → μ s < ∞ → P (s.indicator fun _ => c))
    (h_add : ∀ ⦃f g : α → E⦄, Disjoint (support f) (support g) → Memℒp f p μ → Memℒp g p μ →
      P f → P g → P (f + g))
    (h_closed : IsClosed { f : Lp E p μ | P f })
    (h_ae : ∀ ⦃f g⦄, f =ᵐ[μ] g → Memℒp f p μ → P f → P g) :
    ∀ ⦃f : α → E⦄, Memℒp f p μ → P f

(h_ind : ∀ (c : E) ⦃s : Set α⦄, MeasurableSet s → μ s < ⊤ → P (s.indicator fun x => c))

(h_add :
  ∀ ⦃f g : α → E⦄,
    Disjoint (Function.support f) (Function.support g) →
      MeasureTheory.Memℒp f p μ → MeasureTheory.Memℒp g p μ → P f → P g → P (f + g))

(h_ae : ∀ ⦃f g : α → E⦄, f =ᵐ[μ] g → MeasureTheory.Memℒp f p μ → P f → P g)


theorem toNat_mul (x y : Cardinal) : toNat (x * y) = toNat x * toNat y

Cardinal.toNat (x * y) = Cardinal.toNat x * Cardinal.toNat y


@[to_additive]
theorem closure_singleton_le_iff_mem (m : M) (p : Subsemigroup M) : closure {m} ≤ p ↔ m ∈ p

{M : Type u_1}
[Mul M]
(m : M)
(p : Subsemigroup M)


theorem contDiff_one_iff_deriv : ContDiff 𝕜 1 f₂ ↔ Differentiable 𝕜 f₂ ∧ Continuous (deriv f₂)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f₂ : 𝕜 → F}


@[simp]
theorem takeWhile_eq_self_iff : takeWhile p l = l ↔ ∀ x ∈ l, p x

{α : Type u}
{p : α → Bool}
{l : List α}

List.takeWhile p l = l ↔ ∀ (x : α), x ∈ l → p x = true


/-- Left multiplication by a matrix, as an `AddMonoidHom` from matrices to matrices. -/
@[simps]
def addMonoidHomMulLeft [Fintype m] (M : Matrix l m α) : Matrix m n α →+ Matrix l n α

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonUnitalNonAssocSemiring α]
[Fintype m]
(M : Matrix l m α)
(x : Matrix m n α)


@[simp]
theorem trailingDegree_zero : trailingDegree (0 : R[X]) = ⊤


/-- If `I : Ideal S` has a finite basis over `R`,
`x ∈ I` iff it is a linear combination of basis vectors. -/
theorem Basis.mem_ideal_iff' {ι R S : Type*} [Fintype ι] [CommRing R] [CommRing S] [Algebra R S]
    {I : Ideal S} (b : Basis ι R I) {x : S} : x ∈ I ↔ ∃ c : ι → R, x = ∑ i, c i • (b i : S)

{ι : Type u_1}
{R : Type u_2}
{S : Type u_3}
[Fintype ι]
[CommRing R]
[CommRing S]
[Algebra R S]
{I : Ideal S}
(b : Basis ι R ↥I)
{x : S}


@[to_additive]
theorem mul_inv_eq_of_eq_mul (h : a = c * b) : a * b⁻¹ = c

{G : Type u_3}
[Group G]
{a b c : G}
(h : a = c * b)


theorem map_congr (f : α → β) {s t : WSeq α} (h : s ~ʷ t) : map f s ~ʷ map f t

{α : Type u}
{β : Type v}
(f : α → β)
{s t : Stream'.WSeq α}
(h : s ~ʷ t)

Stream'.WSeq.map f s ~ʷ Stream'.WSeq.map f t


@[simp]
theorem equivOfIsometry_refl :
    (equivOfIsometry <| QuadraticMap.IsometryEquiv.refl Q₁) = AlgEquiv.refl

{R : Type u_1}
[CommRing R]
{M₁ : Type u_4}
[AddCommGroup M₁]
[Module R M₁]
{Q₁ : QuadraticForm R M₁}

CliffordAlgebra.equivOfIsometry (QuadraticMap.IsometryEquiv.refl Q₁) = AlgEquiv.refl


@[simp]
lemma homologyMap_sub : homologyMap (φ - ψ) i = homologyMap φ i - homologyMap ψ i

{C : Type u_1}
{ι : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{c : ComplexShape ι}
{K L : HomologicalComplex C c}
(φ ψ : K ⟶ L)
(i : ι)
[K.HasHomology i]
[L.HasHomology i]

HomologicalComplex.homologyMap (φ - ψ) i = HomologicalComplex.homologyMap φ i - HomologicalComplex.homologyMap ψ i


/-- A non-unital subring is closed under multiplication. -/
protected theorem mul_mem {x y : R} : x ∈ s → y ∈ s → x * y ∈ s

{R : Type u}
[NonUnitalNonAssocRing R]
(s : NonUnitalSubring R)
{x y : R}


theorem nhds_mono {t₁ t₂ : TopologicalSpace α} {a : α} (h : t₁ ≤ t₂) :
    @nhds α t₁ a ≤ @nhds α t₂ a

{α : Type u}
{t₁ t₂ : TopologicalSpace α}
{a : α}
(h : t₁ ≤ t₂)


@[simp]
theorem uncurry_pre (f : B ⟶ A) (X : C) :
    MonoidalClosed.uncurry ((pre f).app X) = f ▷ _ ≫ (ihom.ev A).app X

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

CategoryTheory.MonoidalClosed.uncurry ((CategoryTheory.MonoidalClosed.pre f).app X) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerRight f ((CategoryTheory.ihom A).obj X))
    ((CategoryTheory.ihom.ev A).app X)


/-- An odd prime `p` is a square in `F` iff the quadratic character of `ZMod p` does not
take the value `-1` on `χ₄#F * #F`. -/
theorem FiniteField.isSquare_odd_prime_iff (hF : ringChar F ≠ 2) {p : ℕ} [Fact p.Prime]
    (hp : p ≠ 2) :
    IsSquare (p : F) ↔ quadraticChar (ZMod p) (χ₄ (Fintype.card F) * Fintype.card F) ≠ -1

{F : Type u_1}
[Field F]
[Fintype F]
(hF : ringChar F ≠ 2)
{p : ℕ}
[Fact (Nat.Prime p)]
(hp : p ≠ 2)

IsSquare ↑p ↔ (quadraticChar (ZMod p)) (↑(ZMod.χ₄ ↑(Fintype.card F)) * ↑(Fintype.card F)) ≠ -1


/-- A measure `μ` is weakly regular if
  - it is outer regular: `μ(A) = inf {μ(U) | A ⊆ U open}` for `A` measurable;
  - it is inner regular for open sets, using closed sets:
    `μ(U) = sup {μ(F) | F ⊆ U closed}` for `U` open. -/
class WeaklyRegular (μ : Measure α) extends OuterRegular μ : Prop where
  protected innerRegular : InnerRegularWRT μ IsClosed IsOpen

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[self : μ.WeaklyRegular]


@[simp]
theorem coe_normUnit {p : R[X]} : (normUnit p : R[X]) = C ↑(normUnit p.leadingCoeff)

{R : Type u}
[CommRing R]
[IsDomain R]
[NormalizationMonoid R]
{p : R[X]}

↑(normUnit p) = Polynomial.C ↑(normUnit p.leadingCoeff)


@[to_additive (attr := simp)]
theorem mk_mul (a b : G) : ((a * b : G) : Q) = a * b

{G : Type u}
[AddGroup G]
(N : AddSubgroup G)
[nN : N.Normal]
(a b : G)


/-- A ring `R` is Jacobson if and only if for every prime ideal `I`,
 `I` can be written as the infimum of some collection of maximal ideals.
 Allowing ⊤ in the set `M` of maximal ideals is equivalent, but makes some proofs cleaner. -/
theorem isJacobson_iff_sInf_maximal : IsJacobson R ↔ ∀ {I : Ideal R}, I.IsPrime →
    ∃ M : Set (Ideal R), (∀ J ∈ M, IsMaximal J ∨ J = ⊤) ∧ I = sInf M

Ideal.IsJacobson R ↔ ∀ {I : Ideal R}, I.IsPrime → ∃ M, (∀ J ∈ M, J.IsMaximal ∨ J = ⊤) ∧ I = sInf M


lemma term_delta (s : ℂ) (n : ℕ) : term δ s n = if n = 1 then 1 else 0

LSeries.term LSeries.delta s n = if n = 1 then 1 else 0


theorem hom_ext (g₁ g₂ : S →+* 𝕎 R) (h : ∀ k, (truncate k).comp g₁ = (truncate k).comp g₂) :
    g₁ = g₂

(h : ∀ (k : ℕ), (WittVector.truncate k).comp g₁ = (WittVector.truncate k).comp g₂)


protected theorem subset (hf : LocallyFinite f) (hg : ∀ i, g i ⊆ f i) : LocallyFinite g

{ι : Type u_1}
{X : Type u_4}
[TopologicalSpace X]
{f g : ι → Set X}
(hf : LocallyFinite f)
(hg : ∀ (i : ι), g i ⊆ f i)


lemma isSolid_solidClosure (s : Set α) : IsSolid (solidClosure s)

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


@[reassoc]
lemma liftK_π_eq_zero_of_boundary (k : A ⟶ S.X₂) (x : A ⟶ S.X₁) (hx : k = x ≫ S.f) :
    h.liftK k (by rw [hx, assoc, S.zero, comp_zero]) ≫ h.π = 0

(hx : k = CategoryTheory.CategoryStruct.comp x S.f)

CategoryTheory.CategoryStruct.comp (h.liftK k ⋯) h.π = 0


/-- To show that an invariant σ-finite measure is regular it is sufficient to show that it is finite
  on some compact set with non-empty interior. -/
@[to_additive
"To show that an invariant σ-finite measure is regular it is sufficient to show that it is finite on
some compact set with non-empty interior."]
theorem regular_of_isMulLeftInvariant {μ : Measure G} [SigmaFinite μ] [IsMulLeftInvariant μ]
    {K : Set G} (hK : IsCompact K) (h2K : (interior K).Nonempty) (hμK : μ K ≠ ∞) : Regular μ

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
[TopologicalAddGroup G]
[MeasurableSpace G]
[BorelSpace G]
[SecondCountableTopology G]
{μ : MeasureTheory.Measure G}
[MeasureTheory.SigmaFinite μ]
[μ.IsAddLeftInvariant]
{K : Set G}
(hK : IsCompact K)
(h2K : (interior K).Nonempty)
(hμK : μ K ≠ ⊤)


theorem biUnion_iUnion (s : ι → Set α) (t : α → Set β) :
    ⋃ x ∈ ⋃ i, s i, t x = ⋃ (i) (x ∈ s i), t x

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
(s : ι → Set α)
(t : α → Set β)

⋃ x ∈ ⋃ i, s i, t x = ⋃ i, ⋃ x ∈ s i, t x


@[simp]
theorem mk_sigma {ι} (f : ι → Type*) : #(Σ i, f i) = sum fun i => #(f i)

Cardinal.mk ((i : ι) × f i) = Cardinal.sum fun i => Cardinal.mk (f i)


theorem le_div_iff_of_neg (hc : c < 0) : a ≤ b / c ↔ b ≤ a * c

{α : Type u_2}
[LinearOrderedField α]
{a b c : α}
(hc : c < 0)


@[simp]
theorem diagramIso_hom_app_right (i : D.J) :
    (D.diagramIso F).hom.app (WalkingMultispan.right i) = 𝟙 _

[H : (i j k : D.J) → CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan (D.f i j) (D.f i k)) F]

(D.diagramIso F).hom.app (CategoryTheory.Limits.WalkingMultispan.right i) =
  CategoryTheory.CategoryStruct.id ((D.diagram.multispan.comp F).obj (CategoryTheory.Limits.WalkingMultispan.right i))


@[to_additive]
theorem MonoidHom.map_finprod_of_preimage_one (f : M →* N) (hf : ∀ x, f x = 1 → x = 1) (g : α → M) :
    f (∏ᶠ i, g i) = ∏ᶠ i, f (g i)

{M : Type u_2}
{N : Type u_3}
{α : Sort u_4}
[AddCommMonoid M]
[AddCommMonoid N]
(f : M →+ N)
(hf : ∀ (x : M), f x = 0 → x = 0)
(g : α → M)

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


/-- **Ruzsa's triangle inequality**. Mul-div-mul version. -/
@[to_additive "**Ruzsa's triangle inequality**. Add-sub-add version."]
theorem ruzsa_triangle_inequality_mul_div_mul (A B C : Finset α) :
    (A * C).card * B.card ≤ (A / B).card * (B * C).card

{α : Type u_1}
[CommGroup α]
[DecidableEq α]
(A B C : Finset α)


@[simp]
theorem inf_sdiff_sup_left : a \ c ⊓ (a ⊔ b) = a \ c

{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
{a b c : α}


lemma isWeaklyRegular_append_iff (rs₁ rs₂ : List R) :
    IsWeaklyRegular M (rs₁ ++ rs₂) ↔
      IsWeaklyRegular M rs₁ ∧
        IsWeaklyRegular (M ⧸ (Ideal.ofList rs₁ • ⊤ : Submodule R M)) rs₂

{R : Type u_1}
(M : Type u_3)
[CommRing R]
[AddCommGroup M]
[Module R M]
(rs₁ rs₂ : List R)

RingTheory.Sequence.IsWeaklyRegular M (rs₁ ++ rs₂) ↔
  RingTheory.Sequence.IsWeaklyRegular M rs₁ ∧ RingTheory.Sequence.IsWeaklyRegular (M ⧸ Ideal.ofList rs₁ • ⊤) rs₂


@[ext]
theorem ext ⦃f g : AbsoluteValue R S⦄ : (∀ x, f x = g x) → f = g

{R : Type u_5}
{S : Type u_6}
[Semiring R]
[OrderedSemiring S]
⦃f g : AbsoluteValue R S⦄


theorem subset_iff_ssubset_or_eq [IsRefl α (· ⊆ ·)] [IsAntisymm α (· ⊆ ·)] :
    a ⊆ b ↔ a ⊂ b ∨ a = b

[IsNonstrictStrictOrder α (fun x x_1 => x ⊆ x_1) fun x x_1 => x ⊂ x_1]


@[simp]
theorem closure_empty : closure (∅ : Set R) = ⊥

{R : Type u}
[NonUnitalNonAssocSemiring R]


theorem isEquiv_tfae [LinearOrderedCommGroupWithZero Γ₀] [LinearOrderedCommGroupWithZero Γ'₀]
    (v : Valuation K Γ₀) (v' : Valuation K Γ'₀) :
    [v.IsEquiv v', ∀ {x}, v x ≤ 1 ↔ v' x ≤ 1, ∀ {x}, v x = 1 ↔ v' x = 1, ∀ {x}, v x < 1 ↔ v' x < 1,
        ∀ {x}, v (x - 1) < 1 ↔ v' (x - 1) < 1].TFAE

{K : Type u_1}
[DivisionRing K]
{Γ₀ : Type u_4}
{Γ'₀ : Type u_5}
[LinearOrderedCommGroupWithZero Γ₀]
[LinearOrderedCommGroupWithZero Γ'₀]
(v : Valuation K Γ₀)
(v' : Valuation K Γ'₀)


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

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

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

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

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

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


@[reassoc (attr := simp)]
lemma restrictionApp_naturality {X Y : Cᵒᵖ} (f : X ⟶ Y)
    {M N : PresheafOfModules R} (φ : M ⟶ N) :
    restrictionApp f M ≫ (ModuleCat.restrictScalars (R.map f)).map (Hom.app φ Y) =
      ModuleCat.ofHom (Hom.app φ X) ≫ restrictionApp f N

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{R : Cᵒᵖ ⥤ RingCat}
{X Y : Cᵒᵖ}
(f : X ⟶ Y)
{M N : PresheafOfModules R}
(φ : M ⟶ N)

PresheafOfModules.restrictionApp f M ≫ (ModuleCat.restrictScalars (R.map f)).map (PresheafOfModules.Hom.app φ Y) =
  ModuleCat.ofHom (PresheafOfModules.Hom.app φ X) ≫ PresheafOfModules.restrictionApp f N


/-- The object in the category of quadratic R-modules associated to a quadratic R-module. -/
@[simps form]
def of {X : Type v} [AddCommGroup X] [Module R X] (Q : QuadraticForm R X) :
    QuadraticModuleCat R

{R : Type u}
[CommRing R]
{X : Type v}
[AddCommGroup X]
[Module R X]
(Q : QuadraticForm R X)


theorem mem_closedBall_self (h : 0 ≤ ε) : x ∈ closedBall x ε

{α : Type u}
[PseudoMetricSpace α]
{x : α}
{ε : ℝ}
(h : 0 ≤ ε)


/-- A more general version of `finprod_mem_mul_distrib` that only requires `s ∩ mulSupport f` and
`s ∩ mulSupport g` rather than `s` to be finite. -/
@[to_additive
      "A more general version of `finsum_mem_add_distrib` that only requires `s ∩ support f`
      and `s ∩ support g` rather than `s` to be finite."]
theorem finprod_mem_mul_distrib' (hf : (s ∩ mulSupport f).Finite) (hg : (s ∩ mulSupport g).Finite) :
    ∏ᶠ i ∈ s, f i * g i = (∏ᶠ i ∈ s, f i) * ∏ᶠ i ∈ s, g i

(hf : (s ∩ Function.mulSupport f).Finite)

(hg : (s ∩ Function.mulSupport g).Finite)

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


theorem NoetherianSpace.iUnion {ι : Type*} (f : ι → Set α) [Finite ι]
    [hf : ∀ i, NoetherianSpace (f i)] : NoetherianSpace (⋃ i, f i)

[hf : ∀ (i : ι), TopologicalSpace.NoetherianSpace ↑(f i)]

TopologicalSpace.NoetherianSpace ↑(⋃ i, f i)


protected theorem Symmetric.iff (H : Symmetric r) (x y : α) : r x y ↔ r y x

{α : Type u_1}
{r : α → α → Prop}
(H : Symmetric r)
(x y : α)


@[simp]
lemma ι_appIso (V) : U.ι.appIso V = Iso.refl _

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

AlgebraicGeometry.Scheme.Hom.appIso U.ι V =
  CategoryTheory.Iso.refl (X.presheaf.obj (Opposite.op ((AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj V)))


theorem preimage_eq_iff_eq_image {α β} (e : α ≃ β) (s t) : e ⁻¹' s = t ↔ s = e '' t

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


nonrec theorem comp {f : β → γ → σ} {g : α → β} {h : α → γ} (hf : Computable₂ f)
    (hg : Computable g) (hh : Computable h) : Computable fun a => f (g a) (h a)

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


/-- Given rings `R` and `S` of characteristic `p`, with `R` being perfect,
any homomorphism `R →+* S` can be lifted to a homomorphism `R →+* Perfection S p`. -/
@[simps]
noncomputable def lift (R : Type u₁) [CommSemiring R] [CharP R p] [PerfectRing R p]
    (S : Type u₂) [CommSemiring S] [CharP S p] : (R →+* S) ≃ (R →+* Ring.Perfection S p)

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(R : Type u₁)
[CommSemiring R]
[CharP R p]
[PerfectRing R p]
(S : Type u₂)
[CommSemiring S]
[CharP S p]
(f : R →+* Ring.Perfection S p)

(Perfection.lift p R S).symm f = (Perfection.coeff S p 0).comp f


@[to_additive]
theorem finprod_prod_comm (s : Finset β) (f : α → β → M)
    (h : ∀ b ∈ s, (mulSupport fun a => f a b).Finite) :
    (∏ᶠ a : α, ∏ b ∈ s, f a b) = ∏ b ∈ s, ∏ᶠ a : α, f a b

(h : ∀ b ∈ s, (Function.mulSupport fun a => f a b).Finite)

∏ᶠ (a : α), ∏ b ∈ s, f a b = ∏ b ∈ s, ∏ᶠ (a : α), f a b


@[to_additive (attr := simp)]
theorem map_id (z : N) : f.map (fun y ↦ show MonoidHom.id M y ∈ S from y.2) f z = z

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
(f : S.LocalizationMap N)
(z : N)


theorem tendsto_nhds {f : α → X} {l : Filter α} :
    Tendsto f l (𝓝 x) ↔ ∀ s, IsOpen s → x ∈ s → f ⁻¹' s ∈ l

{X : Type u}
{α : Type u_1}
{x : X}
[TopologicalSpace X]
{f : α → X}
{l : Filter α}

Filter.Tendsto f l (𝓝 x) ↔ ∀ (s : Set X), IsOpen s → x ∈ s → f ⁻¹' s ∈ l


@[simp]
theorem lift_tprod : lift (tprod R : MultilinearMap R s _) = LinearMap.id

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]

PiTensorProduct.lift (PiTensorProduct.tprod R) = LinearMap.id


@[simp] theorem neg_imK : (-a).imK = -a.imK


@[simp]
lemma cyclesMap_id [HasLeftHomology S] :
    cyclesMap (𝟙 S) = 𝟙 _

CategoryTheory.ShortComplex.cyclesMap (CategoryTheory.CategoryStruct.id S) = CategoryTheory.CategoryStruct.id S.cycles


@[simp]
theorem functorCategoryMonoidalAdjunction.counit_app_app (A : SingleObj G ⥤ V) :
    ((functorCategoryMonoidalAdjunction _ _).counit.app A).app PUnit.unit = 𝟙 _

(V : Type (u + 1))
[CategoryTheory.LargeCategory V]
(G : MonCat)
[CategoryTheory.MonoidalCategory V]
(A : CategoryTheory.SingleObj ↑G ⥤ V)

((Action.functorCategoryMonoidalAdjunction V G).counit.app A).app PUnit.unit =
  𝟙
    ((((Action.functorCategoryMonoidalEquivalenceInverse V G).toFunctor ⋙
              (Action.functorCategoryMonoidalEquivalence V G).toFunctor).obj
          A).obj
      PUnit.unit)


theorem insert_diff_of_not_mem (s) (h : a ∉ t) : insert a s \ t = insert a (s \ t)

{α : Type u}
{a : α}
{t : Set α}
(s : Set α)
(h : a ∉ t)


/-- The two-variable Jacobi theta function is periodic in `z` with period 1. -/
lemma jacobiTheta₂_add_left (z τ : ℂ) : jacobiTheta₂ (z + 1) τ = jacobiTheta₂ z τ


@[simp]
theorem tendsto_atBot_iff {l : Filter γ} {f : γ → α} (e : α ≃o β) :
    Tendsto (fun x => e (f x)) l atBot ↔ Tendsto f l atBot

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Preorder α]
[Preorder β]
{l : Filter γ}
{f : γ → α}
(e : α ≃o β)

Filter.Tendsto (fun x => e (f x)) l Filter.atBot ↔ Filter.Tendsto f l Filter.atBot


/-- A structure encapsulating the fact that a set of sets is closed under finite intersection. -/
structure FiniteInter : Prop where
  /-- `univ_mem` states that `Set.univ` is in `S`. -/
  univ_mem : Set.univ ∈ S
  /-- `inter_mem` states that any two intersections of sets in `S` is also in `S`. -/
  inter_mem : ∀ ⦃s⦄, s ∈ S → ∀ ⦃t⦄, t ∈ S → s ∩ t ∈ S

{α : Type u_1}
{S : Set (Set α)}
(self : FiniteInter S)


@[to_additive (attr := simp)]
theorem biUnion_smul_finset (s : Finset α) (t : Finset β) : s.biUnion (· • t) = s • t

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[VAdd α β]
(s : Finset α)
(t : Finset β)


@[simp]
theorem deriv_zpow' (m : ℤ) : (deriv fun x : 𝕜 => x ^ m) = fun x => (m : 𝕜) * x ^ (m - 1)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(m : ℤ)

(deriv fun x => x ^ m) = fun x => ↑m * x ^ (m - 1)


/-- If `f : 𝕜 → 𝕜` is convex, then for any three points `x < y < z` the slope of the secant line of
`f` on `[x, y]` is less than the slope of the secant line of `f` on `[y, z]`. -/
theorem ConvexOn.slope_mono_adjacent (hf : ConvexOn 𝕜 s f) {x y z : 𝕜} (hx : x ∈ s) (hz : z ∈ s)
    (hxy : x < y) (hyz : y < z) : (f y - f x) / (y - x) ≤ (f z - f y) / (z - y)

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
{s : Set 𝕜}
{f : 𝕜 → 𝕜}
(hf : ConvexOn 𝕜 s f)
{x y z : 𝕜}
(hx : x ∈ s)
(hz : z ∈ s)
(hxy : x < y)
(hyz : y < z)


/-- If `u` is a uniform structure on `β` and `f : γ → β`, then
`𝒱(α, γ, 𝔖, comap f u) = comap (fun g ↦ f ∘ g) 𝒱(α, γ, 𝔖, u₁)`. -/
protected theorem comap_eq {f : γ → β} :
    𝒱(α, γ, 𝔖, ‹UniformSpace β›.comap f) = 𝒱(α, β, 𝔖, _).comap (f ∘ ·)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[UniformSpace β]
{𝔖 : Set (Set α)}
{f : γ → β}

UniformOnFun.uniformSpace α γ 𝔖 = UniformSpace.comap (fun x => f ∘ x) (UniformOnFun.uniformSpace α β 𝔖)


/-- A sheaf `P` is isomorphic to its own sheafification. -/
@[simps]
noncomputable def sheafificationIso (P : Sheaf J D) : P ≅ (presheafToSheaf J D).obj P.val

{J : CategoryTheory.GrothendieckTopology C}

(CategoryTheory.sheafificationIso P).hom.val = (CategoryTheory.isoSheafify J ⋯).hom


lemma hasDerivAt_mul_log {x : ℝ} (hx : x ≠ 0) : HasDerivAt (fun x ↦ x * log x) (log x + 1) x

HasDerivAt (fun x => x * Real.log x) (Real.log x + 1) x


/-- Partial homeomorphisms, defined on open subsets of the space -/
-- Porting note(#5171): this linter isn't ported yet. @[nolint has_nonempty_instance]
structure PartialHomeomorph (X : Type*) (Y : Type*) [TopologicalSpace X]
  [TopologicalSpace Y] extends PartialEquiv X Y where
  open_source : IsOpen source
  open_target : IsOpen target
  continuousOn_toFun : ContinuousOn toFun source
  continuousOn_invFun : ContinuousOn invFun target

{X : Type u_7}
{Y : Type u_8}
[TopologicalSpace X]
[TopologicalSpace Y]
(self : PartialHomeomorph X Y)


theorem _root_.MeasurableEmbedding.eLpNormEssSup_map_measure {g : β → F}
    (hf : MeasurableEmbedding f) : eLpNormEssSup g (Measure.map f μ) = eLpNormEssSup (g ∘ f) μ

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
{β : Type u_5}
{mβ : MeasurableSpace β}
{f : α → β}
{g : β → F}
(hf : MeasurableEmbedding f)

MeasureTheory.eLpNormEssSup g (MeasureTheory.Measure.map f μ) = MeasureTheory.eLpNormEssSup (g ∘ f) μ


/--
If the pullback map is obtained via whiskering,
then the result `sheaf_hom (whisker_left G.op α)` is equal to `α`.
-/
theorem sheafHom_eq (α : ℱ ⟶ ℱ'.val) : sheafHom (whiskerLeft G.op α) = α

{K : CategoryTheory.GrothendieckTopology D}

CategoryTheory.Functor.IsCoverDense.sheafHom (CategoryTheory.whiskerLeft G.op α) = α


theorem mul_def (f g : α →ₙ+* α) : f * g = f.comp g

{α : Type u_2}
[NonUnitalNonAssocSemiring α]
(f g : α →ₙ+* α)


lemma list_sum_right (a : R) (l : List R) (h : ∀ b ∈ l, Commute a b) : Commute a l.sum

{R : Type u_5}
[NonUnitalNonAssocSemiring R]
(a : R)
(l : List R)
(h : ∀ b ∈ l, Commute a b)


theorem Bounded.to_sep {t₁ t₂ o₁ o₂} {x : α}
    (h₁ : Bounded t₁ o₁ (x : WithTop α)) (h₂ : Bounded t₂ (x : WithBot α) o₂) :
    t₁.All fun y => t₂.All fun z : α => y < z

{α : Type u_1}
[Preorder α]
{t₁ t₂ : Ordnode α}
{o₁ : WithBot α}
{o₂ : WithTop α}
{x : α}
(h₁ : t₁.Bounded o₁ ↑x)
(h₂ : t₂.Bounded (↑x) o₂)

Ordnode.All (fun y => Ordnode.All (fun z => y < z) t₂) t₁


@[simp]
theorem ofCoconeEquiv_symm_apply_desc {D : Type u₄} [Category.{v₄} D] {G : K ⥤ D}
    (h : Cocone G ≌ Cocone F) {c : Cocone G} (P : IsColimit c) (s) :
    ((ofCoconeEquiv h).symm P).desc s =
      (h.functor.map (P.descCoconeMorphism (h.inverse.obj s))).hom ≫ (h.counit.app s).hom

(h : CategoryTheory.Limits.Cocone G ≌ CategoryTheory.Limits.Cocone F)

((CategoryTheory.Limits.IsColimit.ofCoconeEquiv h).symm P).desc s =
  (h.functor.map (P.descCoconeMorphism (h.inverse.obj s))).hom ≫ (h.counit.app s).hom


/-- Measures `ν` on `α` and `μ` on the `Quotient` of `α` mod `G` satisfy
  `QuotientMeasureEqMeasurePreimage` if: for any fundamental domain `t`, and any measurable subset
  `U` of the quotient, `μ U = ν ((π ⁻¹' U) ∩ t)`. -/
class QuotientMeasureEqMeasurePreimage (ν : Measure α := by volume_tac)
    (μ : Measure (Quotient α_mod_G)) : Prop where
  projection_respects_measure' (t : Set α) : IsFundamentalDomain G t ν → μ = (ν.restrict t).map π

{ν : autoParam (MeasureTheory.Measure α) _auto✝}

{μ : MeasureTheory.Measure (Quotient (MulAction.orbitRel G α))}

[self : MeasureTheory.QuotientMeasureEqMeasurePreimage ν μ]

MeasureTheory.IsFundamentalDomain G t ν →
  μ = MeasureTheory.Measure.map (Quotient.mk (MulAction.orbitRel G α)) (MeasureTheory.Measure.restrict ν t)


@[to_additive norm_le_pi_norm]
lemma norm_le_pi_norm' (i : ι) : ‖f i‖ ≤ ‖f‖

{ι : Type u_1}
{π : ι → Type u_4}
[Fintype ι]
[(i : ι) → SeminormedAddGroup (π i)]
(f : (i : ι) → π i)
(i : ι)


theorem two_lt_pointCount [Finite P] [Finite L] (l : L) : 2 < pointCount P l

(P : Type u_1)
{L : Type u_2}
[Membership P L]
[Configuration.ProjectivePlane P L]
[Finite P]
[Finite L]
(l : L)


lemma hasRightHomology_iff_op (S : ShortComplex C) :
    S.HasRightHomology ↔ S.op.HasLeftHomology


private theorem a_is_soln (ha : F.eval a = 0) :
    F.eval a = 0 ∧
      ‖a - a‖ < ‖F.derivative.eval a‖ ∧
        ‖F.derivative.eval a‖ = ‖F.derivative.eval a‖ ∧
          ∀ z', F.eval z' = 0 → ‖z' - a‖ < ‖F.derivative.eval a‖ → z' = a

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

Polynomial.eval a F = 0 ∧
  ‖a - a‖ < ‖Polynomial.eval a (Polynomial.derivative F)‖ ∧
    ‖Polynomial.eval a (Polynomial.derivative F)‖ = ‖Polynomial.eval a (Polynomial.derivative F)‖ ∧
      ∀ (z' : ℤ_[p]), Polynomial.eval z' F = 0 → ‖z' - a‖ < ‖Polynomial.eval a (Polynomial.derivative F)‖ → z' = a


/-- A monoid object in a functor category induces a functor to the category of monoid objects. -/
@[simps]
def functorObj (A : Mon_ (C ⥤ D)) : C ⥤ Mon_ D

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

((CategoryTheory.Monoidal.MonFunctorCategoryEquivalence.functorObj A).obj X).X = A.X.obj X


theorem _root_.Disjoint.image {s t u : Set α} {f : α → β} (h : Disjoint s t) (hf : u.InjOn f)
    (hs : s ⊆ u) (ht : t ⊆ u) : Disjoint (f '' s) (f '' t)

{α : Type u_1}
{β : Type u_2}
{s t u : Set α}
{f : α → β}
(h : Disjoint s t)
(hf : Set.InjOn f u)
(hs : s ⊆ u)
(ht : t ⊆ u)


/-- The first isomorphism theorem for monoids in the case of a homomorphism with right inverse. -/
@[to_additive (attr := simps)
  "The first isomorphism theorem for `AddMonoid`s in the case of a homomorphism
  with right inverse."]
def quotientKerEquivOfRightInverse (f : M →* P) (g : P → M) (hf : Function.RightInverse g f) :
    (ker f).Quotient ≃* P

{M : Type u_1}
{P : Type u_3}
[AddZeroClass M]
[AddZeroClass P]
(f : M →+ P)
(g : P → M)
(hf : Function.RightInverse g ⇑f)
(a : (AddCon.ker f).Quotient)

(AddCon.quotientKerEquivOfRightInverse f g hf) a = (AddCon.kerLift f) a


@[simp, norm_cast] lemma coe_ofLE (h : G₁ ≤ G₂) : ⇑(ofLE h) = id

{V : Type u_1}
{G₁ G₂ : SimpleGraph V}
(h : G₁ ≤ G₂)