/-- Induction principle to build a sequence, by adding one point at a time satisfying a given
symmetric relation with respect to all the previously chosen points.

More precisely, Assume that, for any finite set `s`, one can find another point satisfying
some relation `r` with respect to all the points in `s`. Then one may construct a
function `f : ℕ → α` such that `r (f m) (f n)` holds whenever `m ≠ n`.
We also ensure that all constructed points satisfy a given predicate `P`. -/
theorem exists_seq_of_forall_finset_exists' {α : Type*} (P : α → Prop) (r : α → α → Prop)
    [IsSymm α r] (h : ∀ s : Finset α, (∀ x ∈ s, P x) → ∃ y, P y ∧ ∀ x ∈ s, r x y) :
    ∃ f : ℕ → α, (∀ n, P (f n)) ∧ Pairwise fun m n => r (f m) (f n)

(h : ∀ (s : Finset α), (∀ x ∈ s, P x) → ∃ y, P y ∧ ∀ x ∈ s, r x y)

∃ f, (∀ (n : ℕ), P (f n)) ∧ Pairwise fun m n => r (f m) (f n)


theorem leibniz_div_const (a b : K) (h : D b = 0) : D (a / b) = b⁻¹ • D a

{R : Type u_1}
[CommRing R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{K : Type u_4}
[Field K]
[Module K M]
[Algebra R K]
(D : Derivation R K M)
(a b : K)
(h : D b = 0)


@[simp, norm_cast]
theorem rpow_intCast (x : ℝ) (n : ℤ) : x ^ (n : ℝ) = x ^ n


@[reassoc]
theorem rightUnitor_inv_braiding (X : C) : (ρ_ X).inv ≫ (β_ X (𝟙_ C)).hom = (λ_ X).inv

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


theorem isExtrFilter_const {b : β} : IsExtrFilter (fun _ => b) l a

{α : Type u}
{β : Type v}
[Preorder β]
{l : Filter α}
{a : α}
{b : β}


@[refl]
protected theorem refl (H : Subgroup G) : Commensurable H H

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


theorem get : ∀ {s}, Valid s → s.toString.1 = m₁ ++ c :: m₂ → s.get ⟨utf8Len m₁⟩ = c

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

s.Valid → s.toString.data = m₁ ++ c :: m₂ → s.get { byteIdx := String.utf8Len m₁ } = c


@[to_additive (attr := aesop safe apply (rule_sets := [SetLike]))]
theorem pow_mem {M A} [Monoid M] [SetLike A M] [SubmonoidClass A M] {S : A} {x : M}
    (hx : x ∈ S) : ∀ n : ℕ, x ^ n ∈ S

{M : Type u_4}
{A : Type u_5}
[AddMonoid M]
[SetLike A M]
[AddSubmonoidClass A M]
{S : A}
{x : M}
(hx : x ∈ S)
(n : ℕ)


theorem extend_eq_at' [T2Space γ] {f : α → γ} {a : α} (c : γ) (hf : Tendsto f (𝓝 a) (𝓝 c)) :
    di.extend f (i a) = f a

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
{i : α → β}
(di : DenseInducing i)
[TopologicalSpace γ]
[T2Space γ]
{f : α → γ}
{a : α}
(c : γ)
(hf : Filter.Tendsto f (𝓝 a) (𝓝 c))


/-- If `f₀, f₁, f₂, ...` and `g₀, g₁, g₂, ...` are both multipliable then so is the
`ℤ`-indexed sequence: `..., g₂, g₁, g₀, f₀, f₁, f₂, ...` (with `f₀` at the `0`-th position). -/
@[to_additive "If `f₀, f₁, f₂, ...` and `g₀, g₁, g₂, ...` are both summable then so is the
`ℤ`-indexed sequence: `..., g₂, g₁, g₀, f₀, f₁, f₂, ...` (with `f₀` at the `0`-th position)."]
lemma Multipliable.int_rec {f g : ℕ → M} (hf : Multipliable f) (hg : Multipliable g) :
    Multipliable (Int.rec f g)

{M : Type u_1}
[AddCommMonoid M]
[TopologicalSpace M]
[ContinuousAdd M]
{f g : ℕ → M}
(hf : Summable f)
(hg : Summable g)


@[to_additive]
theorem smooth_one [One M'] : Smooth I I' (1 : M → M')

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


@[simp] lemma div_natCast_im (z : ℂ) (n : ℕ) : (z / n).im = z.im / n


@[simp]
theorem mem_attach (s : Finset α) : ∀ x, x ∈ s.attach

{α : Type u_1}
(s : Finset α)
(x : { x // x ∈ s })


@[simp]
theorem neLocus_self_add_right : neLocus f (f + g) = g.support

{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → AddGroup (N a)]
(f g : Π₀ (a : α), N a)


theorem MDifferentiableAt.prod_mk_space {f : M → E'} {g : M → E''}
    (hf : MDifferentiableAt I 𝓘(𝕜, E') f x) (hg : MDifferentiableAt I 𝓘(𝕜, E'') g x) :
    MDifferentiableAt I 𝓘(𝕜, E' × E'') (fun x => (f x, g x)) x


@[simp]
theorem le_min_iff : c ≤ min a b ↔ c ≤ a ∧ c ≤ b

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


theorem support_update [DecidableEq α] [DecidableEq M] :
    support (f.update a b) = if b = 0 then f.support.erase a else insert a f.support

{α : Type u_1}
{M : Type u_5}
[Zero M]
(f : α →₀ M)
(a : α)
(b : M)
[DecidableEq α]
[DecidableEq M]

(f.update a b).support = if b = 0 then f.support.erase a else insert a f.support


theorem leftpad_suffix (n : Nat) (a : α) (l : List α) : l <:+ (leftpad n a l)

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


theorem coeff_zero_mul_X (φ : R⟦X⟧) : coeff R 0 (φ * X) = 0

{R : Type u_1}
[Semiring R]
(φ : PowerSeries R)

(PowerSeries.coeff R 0) (φ * PowerSeries.X) = 0


theorem isDetector_def (G : C) :
    IsDetector G ↔ ∀ ⦃X Y : C⦄ (f : X ⟶ Y), (∀ h : G ⟶ Y, ∃! h', h' ≫ f = h) → IsIso f

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

CategoryTheory.IsDetector G ↔
  ∀ ⦃X Y : C⦄ (f : X ⟶ Y), (∀ (h : G ⟶ Y), ∃! h', CategoryTheory.CategoryStruct.comp h' f = h) → CategoryTheory.IsIso f


/-- Equivalence closure is idempotent. -/
@[simp]
theorem eqvGen_idem (r : α → α → Prop) : EqvGen.Setoid (EqvGen.Setoid r).Rel = EqvGen.Setoid r


theorem isPiSystem_Ioi_rat : IsPiSystem (⋃ a : ℚ, {Ioi (a : ℝ)})


/-- Composition of affine maps acts as applying the two functions. -/
theorem comp_apply (f : P2 →ᵃ[k] P3) (g : P1 →ᵃ[k] P2) (p : P1) : f.comp g p = f (g p)

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
{V2 : Type u_4}
{P2 : Type u_5}
{V3 : Type u_6}
{P3 : Type u_7}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]
[AffineSpace V2 P2]
[AddCommGroup V3]
[Module k V3]
[AffineSpace V3 P3]
(f : P2 →ᵃ[k] P3)
(g : P1 →ᵃ[k] P2)
(p : P1)


protected theorem continuousAt (hf : IsCoveringMapOn f s) {x : E} (hx : f x ∈ s) :
    ContinuousAt f x

{E : Type u_1}
{X : Type u_2}
[TopologicalSpace E]
[TopologicalSpace X]
{f : E → X}
{s : Set X}
(hf : IsCoveringMapOn f s)
{x : E}
(hx : f x ∈ s)


@[simp]
theorem pointwise_smul_le_pointwise_smul_iff₀ {a : α} (ha : a ≠ 0) {S T : Subgroup G} :
    a • S ≤ a • T ↔ S ≤ T

{α : Type u_1}
{G : Type u_2}
[Group G]
[GroupWithZero α]
[MulDistribMulAction α G]
{a : α}
(ha : a ≠ 0)
{S T : Subgroup G}


@[norm_cast]
theorem prod_natCast (s : Finset ι) (f : ι → ℕ) : ↑(∏ i ∈ s, f i : ℕ) = ∏ i ∈ s, (f i : α)

{ι : Type u_1}
{α : Type u_2}
[CommSemiring α]
(s : Finset ι)
(f : ι → ℕ)


/-- The cardinality of the interval (a, b). -/
theorem mk_Ioo_real {a b : ℝ} (h : a < b) : #(Ioo a b) = 𝔠


@[simp] theorem append_eq (as bs : List α) : List.append as bs = as ++ bs


/-- Scalar multiplication of one analytic function by another. -/
lemma AnalyticOn.smul [NormedSpace 𝕝 F] [IsScalarTower 𝕜 𝕝 F] {f : E → 𝕝} {g : E → F} {s : Set E}
    (hf : AnalyticOn 𝕜 f s) (hg : AnalyticOn 𝕜 g s) :
    AnalyticOn 𝕜 (fun x ↦ f x • g x) s

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{𝕝 : Type u_7}
[NontriviallyNormedField 𝕝]
[NormedAlgebra 𝕜 𝕝]
[NormedSpace 𝕝 F]
[IsScalarTower 𝕜 𝕝 F]
{f : E → 𝕝}
{g : E → F}
{s : Set E}
(hf : AnalyticOn 𝕜 f s)
(hg : AnalyticOn 𝕜 g s)


/-- We now define `EMetricSpace`, extending `PseudoEMetricSpace`. -/
class EMetricSpace (α : Type u) extends PseudoEMetricSpace α : Type u where
  eq_of_edist_eq_zero : ∀ {x y : α}, edist x y = 0 → x = y

{α : Type u}
[self : EMetricSpace α]
{x y : α}


@[to_additive existing (attr := simp)]
lemma equivShrink_symm_div [Div α] [Small α] (x y : Shrink α) :
    (equivShrink α).symm (x / y) = (equivShrink α).symm x / (equivShrink α).symm y

{α : Type u_1}
[Div α]
[Small.{u_2, u_1} α]
(x y : Shrink.{u_2, u_1} α)


@[to_additive (attr := simp)]
theorem isComplement'_top_right : IsComplement' H ⊤ ↔ H = ⊥

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


/-- Localization of modules is an exact functor. -/
theorem map_exact (g : M₀ →ₗ[R] M₁) (h : M₁ →ₗ[R] M₂) (ex : Function.Exact g h) :
    Function.Exact (map S f₀ f₁ g) (map S f₁ f₂ h)

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
{M₀ : Type u_6}
{M₀' : Type u_9}
[AddCommGroup M₀]
[AddCommGroup M₀']
[Module R M₀]
[Module R M₀']
(f₀ : M₀ →ₗ[R] M₀')
[IsLocalizedModule S f₀]
{M₁ : Type u_7}
{M₁' : Type u_10}
[AddCommGroup M₁]
[AddCommGroup M₁']
[Module R M₁]
[Module R M₁']
(f₁ : M₁ →ₗ[R] M₁')
[IsLocalizedModule S f₁]
{M₂ : Type u_8}
{M₂' : Type u_11}
[AddCommGroup M₂]
[AddCommGroup M₂']
[Module R M₂]
[Module R M₂']
(f₂ : M₂ →ₗ[R] M₂')
[IsLocalizedModule S f₂]
(g : M₀ →ₗ[R] M₁)
(h : M₁ →ₗ[R] M₂)
(ex : Function.Exact ⇑g ⇑h)

Function.Exact ⇑((IsLocalizedModule.map S f₀ f₁) g) ⇑((IsLocalizedModule.map S f₁ f₂) h)


/-- If `s` is a splitting of a simplicial object `X` in a preadditive category,
`s.nondegComplex` is a chain complex which is given in degree `n` by
the nondegenerate `n`-simplices of `X`. -/
@[simps]
noncomputable def nondegComplex : ChainComplex C ℕ

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


/-- A semigroup is a type with an associative `(*)`. -/
@[ext]
class Semigroup (G : Type u) extends Mul G where
  /-- Multiplication is associative -/
  protected mul_assoc : ∀ a b c : G, a * b * c = a * (b * c)

{G : Type u}
[self : Semigroup G]
(a b c : G)


theorem units_eq_one (u : (Associates α)ˣ) : u = 1

{α : Type u_1}
[CommMonoid α]
(u : (Associates α)ˣ)


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

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


@[to_additive (attr := simp)]
theorem relindex_sup_right [K.Normal] : K.relindex (H ⊔ K) = K.relindex H

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


@[to_additive zero_nsmul, simp]
theorem pow_zero (a : M) : a ^ 0 = 1


theorem le_div_iff_mul_le {a b r : ℝ≥0} (hr : r ≠ 0) : a ≤ b / r ↔ a * r ≤ b


theorem divOf_add (x : k[G]) (a b : G) : x /ᵒᶠ (a + b) = x /ᵒᶠ a /ᵒᶠ b

{k : Type u_1}
{G : Type u_2}
[Semiring k]
[AddCancelCommMonoid G]
(x : AddMonoidAlgebra k G)
(a b : G)


@[fun_prop]
theorem differentiableWithinAt_snd {s : Set (E × F)} : DifferentiableWithinAt 𝕜 Prod.snd s p

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : E × F}
{s : Set (E × F)}


lemma egauge_smul_right (h : c = 0 → s.Nonempty) (x : E) :
    egauge 𝕜 s (c • x) = ‖c‖₊ * egauge 𝕜 s x

{𝕜 : Type u_1}
[NormedDivisionRing 𝕜]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{c : 𝕜}
{s : Set E}
(h : c = 0 → s.Nonempty)
(x : E)

egauge 𝕜 s (c • x) = ↑‖c‖₊ * egauge 𝕜 s x


@[simp]
theorem div_zero {I : FractionalIdeal R₁⁰ K} : I / 0 = 0

{R₁ : Type u_3}
[CommRing R₁]
{K : Type u_4}
[Field K]
[Algebra R₁ K]
[frac : IsFractionRing R₁ K]
[IsDomain R₁]
{I : FractionalIdeal R₁⁰ K}


/-- Predicate on the triangle indices for there to be no accidental triangle.

Note that we cheat a bit, since the exact translation of this informal description would have
`(a', b', c') ∈ t` as a conclusion rather than `a = a' ∨ b = b' ∨ c = c'`. Those conditions are
equivalent when the explicit triangles are edge-disjoint (which is the case we care about). -/
class NoAccidental (t : Finset (α × β × γ)) : Prop where
  eq_or_eq_or_eq : ∀ ⦃a a' b b' c c'⦄, (a', b, c) ∈ t → (a, b', c) ∈ t → (a, b, c') ∈ t →
    a = a' ∨ b = b' ∨ c = c'

[self : SimpleGraph.TripartiteFromTriangles.NoAccidental t]


@[simp]
lemma ofNat_log {n : ℕ} [n.AtLeastTwo] :
    Real.log (no_index (OfNat.ofNat n)) = log (OfNat.ofNat n)

↑(Real.log (OfNat.ofNat n)) = Complex.log (OfNat.ofNat n)


/-- If a group with zero has continuous multiplication and `fun x ↦ x⁻¹` is continuous at one,
then it is continuous at any unit. -/
theorem HasContinuousInv₀.of_nhds_one (h : Tendsto Inv.inv (𝓝 (1 : G₀)) (𝓝 1)) :
    HasContinuousInv₀ G₀

(h : Filter.Tendsto Inv.inv (𝓝 1) (𝓝 1))


@[simp] theorem getElem_range {n : Nat} (m) (h : m < (range n).length) : (range n)[m] = m

{n : Nat}
(m : Nat)
(h : m < (List.range n).length)


theorem integral_div {L : Type*} [RCLike L] (r : L) (f : α → L) :
    ∫ a, f a / r ∂μ = (∫ a, f a ∂μ) / r

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{L : Type u_6}
[RCLike L]
(r : L)
(f : α → L)

∫ (a : α), f a / r ∂μ = (∫ (a : α), f a ∂μ) / r


/-- The Bochner integral is measurable. This shows that the integrand of (the right-hand-side of)
  Fubini's theorem is measurable. -/
theorem MeasureTheory.StronglyMeasurable.integral_prod_right' [SFinite ν] ⦃f : α × β → E⦄
    (hf : StronglyMeasurable f) : StronglyMeasurable fun x => ∫ y, f (x, y) ∂ν

⦃f : α × β → E⦄

(hf : MeasureTheory.StronglyMeasurable f)

MeasureTheory.StronglyMeasurable fun x => ∫ (y : β), f (x, y) ∂ν


@[simp]
theorem bot_fst : (⊥ : Concept α β r).fst = extentClosure r univ

{α : Type u_2}
{β : Type u_3}
{r : α → β → Prop}


theorem strictAntiOn_rpow_Ioi_of_exponent_neg {r : ℝ} (hr : r < 0) :
    StrictAntiOn (fun (x : ℝ) => x ^ r) (Set.Ioi 0)

StrictAntiOn (fun x => x ^ r) (Set.Ioi 0)


@[simp]
theorem directSum_symm_lof_tmul (i₁ : ι₁) (m₁ : M₁ i₁) (i₂ : ι₂) (m₂ : M₂ i₂) :
    (TensorProduct.directSum R S M₁ M₂).symm
      (DirectSum.lof S (ι₁ × ι₂) (fun i => M₁ i.1 ⊗[R] M₂ i.2) (i₁, i₂) (m₁ ⊗ₜ m₂)) =
      (DirectSum.lof S ι₁ M₁ i₁ m₁ ⊗ₜ DirectSum.lof R ι₂ M₂ i₂ m₂)

[∀ (i₁ : ι₁), IsScalarTower R S (M₁ i₁)]

(TensorProduct.directSum R S M₁ M₂).symm
    ((DirectSum.lof S (ι₁ × ι₂) (fun i => TensorProduct R (M₁ i.1) (M₂ i.2)) (i₁, i₂)) (m₁ ⊗ₜ[R] m₂)) =
  (DirectSum.lof S ι₁ M₁ i₁) m₁ ⊗ₜ[R] (DirectSum.lof R ι₂ M₂ i₂) m₂


lemma strictMono_smul_left_of_pos [PosSMulStrictMono α β] (ha : 0 < a) :
    StrictMono ((a • ·) : β → β)

{α : Type u_1}
{β : Type u_2}
{a : α}
[SMul α β]
[Preorder α]
[Preorder β]
[Zero α]
[PosSMulStrictMono α β]
(ha : 0 < a)


/-- The class of additive monoids with an antidiagonal -/
class HasAntidiagonal (A : Type*) [AddMonoid A] where
  /-- The antidiagonal of an element `n` is the finset of pairs `(i, j)` such that `i + j = n`. -/
  antidiagonal : A → Finset (A × A)
  /-- A pair belongs to `antidiagonal n` iff the sum of its components is equal to `n`. -/
  mem_antidiagonal {n} {a} : a ∈ antidiagonal n ↔ a.fst + a.snd = n

{A : Type u_1}
[AddMonoid A]
[self : Finset.HasAntidiagonal A]
{n : A}
{a : A × A}

a ∈ Finset.antidiagonal n ↔ a.1 + a.2 = n


theorem right_triangle_of_left_triangle (h : leftZigzag η.hom ε.hom = (λ_ f).hom ≫ (ρ_ f).inv) :
    rightZigzag η.hom ε.hom = (ρ_ g).hom ≫ (λ_ g).inv

(η : CategoryTheory.CategoryStruct.id a ≅ CategoryTheory.CategoryStruct.comp f g)

(ε : CategoryTheory.CategoryStruct.comp g f ≅ CategoryTheory.CategoryStruct.id b)

(h :
  CategoryTheory.Bicategory.leftZigzag η.hom ε.hom =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.leftUnitor f).hom
      (CategoryTheory.Bicategory.rightUnitor f).inv)

CategoryTheory.Bicategory.rightZigzag η.hom ε.hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.rightUnitor g).hom
    (CategoryTheory.Bicategory.leftUnitor g).inv


@[reassoc]
lemma app_shift (a : A) (X : C) :
    τ.app (X⟦a⟧) = (F₁.commShiftIso a).hom.app X ≫ (τ.app X)⟦a⟧' ≫
      (F₂.commShiftIso a).inv.app X

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_7, u_1} C]
[CategoryTheory.Category.{u_6, u_2} D]
{F₁ F₂ : CategoryTheory.Functor C D}
(τ : F₁ ⟶ F₂)
{A : Type u_5}
[AddMonoid A]
[CategoryTheory.HasShift C A]
[CategoryTheory.HasShift D A]
[F₁.CommShift A]
[F₂.CommShift A]
[CategoryTheory.NatTrans.CommShift τ A]
(a : A)
(X : C)

τ.app ((CategoryTheory.shiftFunctor C a).obj X) =
  CategoryTheory.CategoryStruct.comp ((F₁.commShiftIso a).hom.app X)
    (CategoryTheory.CategoryStruct.comp ((CategoryTheory.shiftFunctor D a).map (τ.app X))
      ((F₂.commShiftIso a).inv.app X))


@[simp]
theorem self_act_invAct_eq {x y : R} : (x ◃ x) ◃⁻¹ y = x ◃⁻¹ y


/-- An element admitting a right inverse is right-regular. -/
@[to_additive "An element admitting a right additive opposite is add-right-regular."]
theorem isRightRegular_of_mul_eq_one (h : a * b = 1) : IsRightRegular a

{R : Type u_1}
[AddMonoid R]
{a b : R}
(h : a + b = 0)


/-- The induced map of a ring homomorphism on the ring spectra, as a morphism of sheafed spaces.
-/
@[simps]
def Spec.sheafedSpaceMap {R S : CommRingCat.{u}} (f : R ⟶ S) :
    Spec.sheafedSpaceObj S ⟶ Spec.sheafedSpaceObj R

(U : (TopologicalSpace.Opens ↑↑(AlgebraicGeometry.Spec.sheafedSpaceObj R).toPresheafedSpace)ᵒᵖ)

(AlgebraicGeometry.Spec.sheafedSpaceMap f).c.app U =
  AlgebraicGeometry.StructureSheaf.comap f (Opposite.unop U)
    ((TopologicalSpace.Opens.map (AlgebraicGeometry.Spec.topMap f)).obj (Opposite.unop U)) ⋯


theorem mem_rtakeWhile_imp {x : α} (hx : x ∈ rtakeWhile p l) : p x

{α : Type u_1}
{p : α → Bool}
{l : List α}
{x : α}
(hx : x ∈ List.rtakeWhile p l)


lemma quasiIso_iff_isIso_rightHomologyMap' (φ : S₁ ⟶ S₂)
    (h₁ : S₁.RightHomologyData) (h₂ : S₂.RightHomologyData) :
    QuasiIso φ ↔ IsIso (rightHomologyMap' φ h₁ h₂)

CategoryTheory.ShortComplex.QuasiIso φ ↔ CategoryTheory.IsIso (CategoryTheory.ShortComplex.rightHomologyMap' φ h₁ h₂)


/-- Given a colimit cocone over `G : D ⥤ E` we can construct a colimit cocone over `F ⋙ G`. -/
@[simps]
def colimitCoconeComp (t : ColimitCocone G) : ColimitCocone (F ⋙ G)

(t : CategoryTheory.Limits.ColimitCocone G)

(CategoryTheory.Functor.Final.colimitCoconeComp F t).isColimit =
  (CategoryTheory.Functor.Final.isColimitWhiskerEquiv F t.cocone).symm t.isColimit


@[to_additive]
theorem mul_rotate (a b c : G) : a * b * c = b * c * a

{G : Type u_3}
[AddCommSemigroup G]
(a b c : G)


theorem Finite.card_toFinset {s : Set α} [Fintype s] (h : s.Finite) :
    h.toFinset.card = Fintype.card s

{α : Type u}
{s : Set α}
[Fintype ↑s]
(h : s.Finite)


/-- Construct an equivalence from functions that are inverse to each other. -/
@[simps]
def ofLeftInverseOfCardLE (hβα : card β ≤ card α) (f : α → β) (g : β → α) (h : LeftInverse g f) :
    α ≃ β

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(hβα : Fintype.card β ≤ Fintype.card α)
(f : α → β)
(g : β → α)
(h : Function.LeftInverse g f)

∀ (a : α), (Equiv.ofLeftInverseOfCardLE hβα f g h) a = f a


theorem mulVec_one [Fintype n] (A : Matrix m n α) : A *ᵥ 1 = fun i => ∑ j, A i j

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonAssocSemiring α]
[Fintype n]
(A : Matrix m n α)


@[to_additive (attr := simp)]
theorem relindex_top_left : (⊤ : Subgroup G).relindex H = 1

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


theorem kroneckerTMul_zero (A : Matrix l m α) : A ⊗ₖₜ[R] (0 : Matrix n p β) = 0

(R : Type u_1)
{α : Type u_2}
{β : Type u_4}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
{p : Type u_11}
[CommSemiring R]
[AddCommMonoid α]
[AddCommMonoid β]
[Module R α]
[Module R β]
(A : Matrix l m α)

Matrix.kroneckerMap (TensorProduct.tmul R) A 0 = 0


/-- rotateRight is invariant under `mod` by the bitwidth. -/
@[simp]
theorem rotateRight_mod_eq_rotateRight {x : BitVec w} {r : Nat} :
    x.rotateRight (r % w) = x.rotateRight r


theorem inf_liminf [NeBot f] (a : α) : a ⊓ liminf u f = liminf (fun x => a ⊓ u x) f

{α : Type u_1}
{β : Type u_2}
[CompleteDistribLattice α]
{f : Filter β}
{u : β → α}
[f.NeBot]
(a : α)

a ⊓ Filter.liminf u f = Filter.liminf (fun x => a ⊓ u x) f


/-- If a functor `F` has a limit, so does any naturally isomorphic functor.
-/
theorem hasLimitOfIso {F G : J ⥤ C} [HasLimit F] (α : F ≅ G) : HasLimit G

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


theorem bit1_of_bit1 : ∀ n : Num, (n + n) + 1 = n.bit1


/-- The **Heine–Borel theorem**:
In a proper Hausdorff space, a set is compact if and only if it is closed and bounded. -/
theorem isCompact_iff_isClosed_bounded [T2Space α] [ProperSpace α] :
    IsCompact s ↔ IsClosed s ∧ IsBounded s

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
[T2Space α]
[ProperSpace α]

IsCompact s ↔ IsClosed s ∧ Bornology.IsBounded s


theorem mul_sSup {s : Set ℝ≥0∞} {a : ℝ≥0∞} : a * sSup s = ⨆ i ∈ s, a * i


@[to_additive (attr := simp)]
theorem noncommProd_cons (s : Finset α) (a : α) (f : α → β)
    (ha : a ∉ s) (comm) :
    noncommProd (cons a s ha) f comm =
      f a * noncommProd s f (comm.mono fun _ => Finset.mem_cons.2 ∘ .inr)

(comm : (↑(Finset.cons a s ha)).Pairwise fun a b => AddCommute (f a) (f b))

(Finset.cons a s ha).noncommSum f comm = f a + s.noncommSum f ⋯


theorem aemeasurable_restrict_iff_comap_subtype {s : Set α} (hs : MeasurableSet s) {μ : Measure α}
    {f : α → β} : AEMeasurable f (μ.restrict s) ↔ AEMeasurable (f ∘ (↑) : s → β) (comap (↑) μ)

{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{s : Set α}
(hs : MeasurableSet s)
{μ : MeasureTheory.Measure α}
{f : α → β}

AEMeasurable f (μ.restrict s) ↔ AEMeasurable (f ∘ Subtype.val) (MeasureTheory.Measure.comap Subtype.val μ)


@[simp]
theorem coe_restrict_scalarsL' : ⇑(restrictScalarsL 𝕜 E Fₗ 𝕜' 𝕜'') = restrictScalars 𝕜'

{𝕜 : Type u_1}
{E : Type u_4}
{Fₗ : Type u_7}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup Fₗ]
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 Fₗ]
{𝕜' : Type u_11}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜' 𝕜]
[NormedSpace 𝕜' E]
[IsScalarTower 𝕜' 𝕜 E]
[NormedSpace 𝕜' Fₗ]
[IsScalarTower 𝕜' 𝕜 Fₗ]
{𝕜'' : Type u_12}
[Ring 𝕜'']
[Module 𝕜'' Fₗ]
[ContinuousConstSMul 𝕜'' Fₗ]
[SMulCommClass 𝕜 𝕜'' Fₗ]
[SMulCommClass 𝕜' 𝕜'' Fₗ]

⇑(ContinuousLinearMap.restrictScalarsL 𝕜 E Fₗ 𝕜' 𝕜'') = ContinuousLinearMap.restrictScalars 𝕜'


theorem LinearMap.toMatrixAlgEquiv_reindexRange [DecidableEq M₁] (f : M₁ →ₗ[R] M₁) (k i : n) :
    LinearMap.toMatrixAlgEquiv v₁.reindexRange f
        ⟨v₁ k, Set.mem_range_self k⟩ ⟨v₁ i, Set.mem_range_self i⟩ =
      LinearMap.toMatrixAlgEquiv v₁ f k i

{R : Type u_1}
[CommSemiring R]
{n : Type u_4}
[Fintype n]
[DecidableEq n]
{M₁ : Type u_5}
[AddCommMonoid M₁]
[Module R M₁]
(v₁ : Basis n R M₁)
[DecidableEq M₁]
(f : M₁ →ₗ[R] M₁)
(k i : n)

(LinearMap.toMatrixAlgEquiv v₁.reindexRange) f ⟨v₁ k, ⋯⟩ ⟨v₁ i, ⋯⟩ = (LinearMap.toMatrixAlgEquiv v₁) f k i


theorem Pairwise.of_map {S : β → β → Prop} (f : α → β) (H : ∀ a b : α, S (f a) (f b) → R a b)
    (p : Pairwise S (map f l)) : Pairwise R l

(H : ∀ (a b : α), S (f a) (f b) → R a b)


@[csimp] theorem dropSlice_eq_dropSliceTR : @dropSlice = @dropSliceTR

(α : Type u_1)
(l : List α)
(m : Nat)
(acc : Array α)
(xs : List α)
(n : Nat)

l = acc.data ++ xs → List.dropSliceTR.go l m xs n acc = acc.data ++ List.dropSlice n (m + 1) xs


/-- A product of topological spaces can be split as the binary product of one of the spaces and
  the product of all the remaining spaces. -/
@[simps!]
def piSplitAt (Y : ι → Type*) [∀ j, TopologicalSpace (Y j)] :
    (∀ j, Y j) ≃ₜ Y i × ∀ j : { j // j ≠ i }, Y j

{ι : Type u_6}
[DecidableEq ι]
(i : ι)
(Y : ι → Type u_7)
[(j : ι) → TopologicalSpace (Y j)]
(f : (j : ι) → Y j)

(Homeomorph.piSplitAt i Y) f = (f i, fun j => f ↑j)


theorem blsub_const {o : Ordinal} (ho : o ≠ 0) (a : Ordinal) :
    (blsub.{u, v} o fun _ _ => a) = succ a

{o : Ordinal.{u}}
(ho : o ≠ 0)
(a : Ordinal.{max u v})


@[simp]
theorem lt_iff_lt {a b} : f a < f b ↔ a < b

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
(f : α ↪o β)
{a b : α}


/-- Note that the `SMulCommClass α β β` typeclass argument is usually satisfied by `Algebra α β`. -/
@[to_additive] -- Porting note: nolint to_additive_doc
lemma mul_smul_comm [Mul β] [SMul α β] [SMulCommClass α β β] (s : α) (x y : β) :
    x * s • y = s • (x * y)

{α : Type u_7}
{β : Type u_8}
[Mul β]
[SMul α β]
[SMulCommClass α β β]
(s : α)
(x y : β)


theorem isLUB_mem [LinearOrder α] {i : α} (s : Finset α) (his : IsLUB (s : Set α) i)
    (hs : s.Nonempty) : i ∈ s

{α : Type u_2}
[LinearOrder α]
{i : α}
(s : Finset α)
(his : IsLUB (↑s) i)
(hs : s.Nonempty)


theorem exists_mem_ne_zero_of_ne_bot {p : Submodule R M} (h : p ≠ ⊥) : ∃ b : M, b ∈ p ∧ b ≠ 0

{R : Type u_1}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{p : Submodule R M}
(h : p ≠ ⊥)


theorem iUnion_image_sup_left : ⋃ a ∈ s, (· ⊔ ·) a '' t = s ⊻ t

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

⋃ a ∈ s, (fun x x_1 => x ⊔ x_1) a '' t = s ⊻ t


lemma sqrt_le_sqrt_iff' (hx : 0 < x) : √x ≤ √y ↔ x ≤ y

√x ≤ √y ↔ x ≤ y


@[simp]
lemma image_subtype_val_Icc_Iic {a b : α} (c : Icc a b) : Subtype.val '' Iic c = Icc a c

{α : Type u_1}
[Preorder α]
{a b : α}
(c : ↑(Set.Icc a b))


lemma forall_sUnion {S : Set (Set α)} {p : α → Prop} :
    (∀ x ∈ ⋃₀ S, p x) ↔ ∀ s ∈ S, ∀ x ∈ s, p x

{α : Type u_1}
{S : Set (Set α)}
{p : α → Prop}


/--
A function `f : Π R, 𝕎 R → 𝕎 R` that maps Witt vectors to Witt vectors over arbitrary base rings
is said to be *polynomial* if there is a family of polynomials `φₙ` over `ℤ` such that the `n`th
coefficient of `f x` is given by evaluating `φₙ` at the coefficients of `x`.

See also `WittVector.IsPoly₂` for the binary variant.

The `ghost_calc` tactic makes use of the `IsPoly` and `IsPoly₂` typeclass and its instances.
(In Lean 3, there was an `@[is_poly]` attribute to manage these instances,
because typeclass resolution did not play well with function composition.
This no longer seems to be an issue, so that such instances can be defined directly.)
-/
class IsPoly (f : ∀ ⦃R⦄ [CommRing R], WittVector p R → 𝕎 R) : Prop where mk' ::
  poly :
    ∃ φ : ℕ → MvPolynomial ℕ ℤ,
      ∀ ⦃R⦄ [CommRing R] (x : 𝕎 R), (f x).coeff = fun n => aeval x.coeff (φ n)

{f : ⦃R : Type u_3⦄ → [inst : CommRing R] → WittVector p R → WittVector p R}

∃ φ,
  ∀ ⦃R : Type u_3⦄ [inst : CommRing R] (x : WittVector p R), (f x).coeff = fun n => (MvPolynomial.aeval x.coeff) (φ n)


theorem algebraMap_monotone : Monotone (algebraMap R A)

{R : Type u_1}
{A : Type u_2}
[OrderedCommRing R]
[OrderedRing A]
[Algebra R A]
[OrderedSMul R A]


theorem image_uIcc {k : Type*} [LinearOrderedField k] (f : k →ᵃ[k] k) (a b : k) :
    f '' Set.uIcc a b = Set.uIcc (f a) (f b)

{k : Type u_10}
[LinearOrderedField k]
(f : k →ᵃ[k] k)
(a b : k)

⇑f '' Set.uIcc a b = Set.uIcc (f a) (f b)


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

(C : Type u_1)
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Preadditive C]
(α : Type u_3)
[AddRightCancelSemigroup α]
[One α]

(CategoryTheory.Idempotents.karoubiChainComplexEquivalence C α).counitIso.inv = CategoryTheory.eqToHom ⋯


theorem one_sub_self_mul_hsum_powers : (1 - x) * (powers x hx).hsum = 1

{Γ : Type u_1}
{R : Type u_2}
[LinearOrderedCancelAddCommMonoid Γ]
[CommRing R]
[IsDomain R]
{x : HahnSeries Γ R}
(hx : 0 < x.orderTop)

(1 - x) * (HahnSeries.SummableFamily.powers x hx).hsum = 1


theorem pos_of_mul_neg_left [ExistsAddOfLE α] [MulPosMono α]
    [CovariantClass α α (swap (· + ·)) (· ≤ ·)] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    {a b : α} (h : a * b < 0) (hb : b ≤ 0) : 0 < a

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

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


@[to_additive]
lemma piFinset_div [∀ i, Div (α i)] (s t : ∀ i, Finset (α i)) :
    piFinset (fun i ↦ s i / t i) = piFinset s / piFinset t

{ι : Type u_5}
{α : ι → Type u_6}
[Fintype ι]
[DecidableEq ι]
[(i : ι) → DecidableEq (α i)]
[(i : ι) → Sub (α i)]
(s t : (i : ι) → Finset (α i))

(Fintype.piFinset fun i => s i - t i) = Fintype.piFinset s - Fintype.piFinset t


theorem modEq_iff_eq_add_zsmul : a ≡ b [PMOD p] ↔ ∃ z : ℤ, b = a + z • p

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


theorem algebraMap_norm_algebraMap [Algebra.IsSeparable K L] (x : 𝓞 K) :
    algebraMap _ K (norm K (algebraMap (𝓞 K) (𝓞 L) x)) =
      Algebra.norm K (algebraMap K L (algebraMap _ _ x))

{L : Type u_1}
(K : Type u_2)
[Field K]
[Field L]
[Algebra K L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
(x : 𝓞 K)

(algebraMap (𝓞 K) K) ((RingOfIntegers.norm K) ((algebraMap (𝓞 K) (𝓞 L)) x)) =
  (Algebra.norm K) ((algebraMap K L) ((algebraMap (𝓞 K) K) x))


theorem terminatedAt_iff_s_none : g.TerminatedAt n ↔ g.s.get? n = none

{α : Type u_1}
{g : GenContFract α}
{n : ℕ}


theorem algebraMap_apply {R A : Type*} [CommSemiring R] [Semiring A] [Algebra R A] (r : R) :
    algebraMap R (LaurentPolynomial A) r = C (algebraMap R A r)

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(r : R)

(algebraMap R A[T;T⁻¹]) r = LaurentPolynomial.C ((algebraMap R A) r)


/-- Localization at an element is unramified. -/
theorem of_isLocalization_Away (r : R) [IsLocalization.Away r A] : Unramified R A

{R : Type u}
[CommRing R]
{A : Type u}
[CommRing A]
[Algebra R A]
(r : R)
[IsLocalization.Away r A]


@[simp]
theorem Subsingleton.aestronglyMeasurable' {_ : MeasurableSpace α} [TopologicalSpace β]
    [Subsingleton α] {μ : Measure α} (f : α → β) : AEStronglyMeasurable f μ

∀ {x : MeasurableSpace α} [inst : TopologicalSpace β] [inst_1 : Subsingleton α] {μ : MeasureTheory.Measure α}
  (f : α → β), MeasureTheory.AEStronglyMeasurable f μ


/-- The extension of `Γ₀ : ChainComplex C ℕ ⥤ SimplicialObject C`
on the idempotent completions. It shall be an equivalence of categories
for any additive category `C`. -/
@[simps!]
def Γ₂ : Karoubi (ChainComplex C ℕ) ⥤ Karoubi (SimplicialObject C)

(P : CategoryTheory.Idempotents.Karoubi (ChainComplex C ℕ))

(AlgebraicTopology.DoldKan.Γ₂.obj P).p.app Δ =
  (AlgebraicTopology.DoldKan.Γ₀.splitting P.X).desc Δ fun A =>
    P.p.f (Opposite.unop A.fst).len ≫ ((AlgebraicTopology.DoldKan.Γ₀.splitting P.X).cofan Δ).inj A


@[ext]
theorem ext' {r s : Setoid α} (H : ∀ a b, r.Rel a b ↔ s.Rel a b) : r = s

(H : ∀ (a b : α), r.Rel a b ↔ s.Rel a b)


@[simp]
theorem lintegral_zero [MeasurableSpace α] (f : α →ₛ ℝ≥0∞) : f.lintegral 0 = 0

{α : Type u_1}
[MeasurableSpace α]
(f : MeasureTheory.SimpleFunc α ℝ≥0∞)


/-- A `k`-algebra homomorphism from `k[G]` is uniquely defined by its
values on the functions `single a 1`. -/
theorem algHom_ext ⦃φ₁ φ₂ : k[G] →ₐ[k] A⦄
    (h : ∀ x, φ₁ (single x 1) = φ₂ (single x 1)) : φ₁ = φ₂

(h : ∀ (x : G), φ₁ (AddMonoidAlgebra.single x 1) = φ₂ (AddMonoidAlgebra.single x 1))


theorem stdBasisMatrix_add (i : m) (j : n) (a b : α) :
    stdBasisMatrix i j (a + b) = stdBasisMatrix i j a + stdBasisMatrix i j b

{m : Type u_2}
{n : Type u_3}
{α : Type u_5}
[DecidableEq m]
[DecidableEq n]
[Semiring α]
(i : m)
(j : n)
(a b : α)

Matrix.stdBasisMatrix i j (a + b) = Matrix.stdBasisMatrix i j a + Matrix.stdBasisMatrix i j b


lemma mem_snoc {p : RelSeries r} {newLast : α} {rel : r p.last newLast} {x : α} :
    x ∈ p.snoc newLast rel ↔ x ∈ p ∨ x = newLast

{α : Type u_1}
{r : Rel α α}
{p : RelSeries r}
{newLast : α}
{rel : r p.last newLast}
{x : α}


@[to_additive (attr := simp)]
theorem hrec_on₂_coe {cM : Con M} {cN : Con N} {φ : cM.Quotient → cN.Quotient → Sort*} (a : M)
    (b : N) (f : ∀ (x : M) (y : N), φ x y)
    (h : ∀ x y x' y', cM x x' → cN y y' → HEq (f x y) (f x' y')) :
    Con.hrecOn₂ (↑a) (↑b) f h = f a b

{φ : cM.Quotient → cN.Quotient → Sort u_4}

(h : ∀ (x : M) (y : N) (x' : M) (y' : N), cM x x' → cN y y' → HEq (f x y) (f x' y'))


/-- A version of `comm` with `r` explicit.

This lemma matches the lemmas from lean core in `Init.Algebra.Classes`, but is missing there.  -/
theorem comm_of (r : α → α → Prop) [IsSymm α r] {a b : α} : r a b ↔ r b a

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


/-- The indexed minimum of a function is bounded below by a uniform lower bound-/
theorem le_ciInf [Nonempty ι] {f : ι → α} {c : α} (H : ∀ x, c ≤ f x) : c ≤ iInf f

{α : Type u_1}
{ι : Sort u_4}
[ConditionallyCompleteLattice α]
[Nonempty ι]
{f : ι → α}
{c : α}
(H : ∀ (x : ι), c ≤ f x)


theorem IndepFun.integral_mul' (hXY : IndepFun X Y μ) (hX : AEStronglyMeasurable X μ)
    (hY : AEStronglyMeasurable Y μ) :
    (integral μ fun ω => X ω * Y ω) = integral μ X * integral μ Y

(hXY : ProbabilityTheory.IndepFun X Y μ)

(hX : MeasureTheory.AEStronglyMeasurable X μ)

(hY : MeasureTheory.AEStronglyMeasurable Y μ)

∫ (ω : Ω), X ω * Y ω ∂μ = MeasureTheory.integral μ X * MeasureTheory.integral μ Y


/-- `⋃₀` and `𝒫` form a Galois connection. -/
theorem sUnion_powerset_gc :
    GaloisConnection (⋃₀ · : Set (Set α) → Set α) (𝒫 · : Set α → Set (Set α))

GaloisConnection (fun x => ⋃₀ x) fun x => 𝒫 x


theorem sInfClosed {s : Set α} (h : s ⊆ L) : sInf s ∈ L

{α : Type u_1}
[CompleteLattice α]
{L : CompleteSublattice α}
{s : Set α}
(h : s ⊆ ↑L)


lemma MutuallySingular.rnDeriv_ae_eq_zero (hμν : μ ⟂ₘ ν) :
    μ.rnDeriv ν =ᵐ[ν] 0

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
(hμν : μ ⟂ₘ ν)


theorem beq_false_of_ne [BEq α] [LawfulBEq α] {a b : α} (h : a ≠ b) : (a == b) = false

{α : Type u_1}
[BEq α]
[LawfulBEq α]
{a b : α}
(h : a ≠ b)


/-- Adjacency in `G.replaceVertex s t` which does not involve `t` is the same as that of `G`. -/
lemma adj_replaceVertex_iff_of_ne {v w : V} (hv : v ≠ t) (hw : w ≠ t) :
    (G.replaceVertex s t).Adj v w ↔ G.Adj v w

{V : Type u_1}
[DecidableEq V]
(G : SimpleGraph V)
(s : V)
{t v w : V}
(hv : v ≠ t)
(hw : w ≠ t)


lemma summable_partition {α β : Type*} {f : β → ℝ} (hf : 0 ≤ f) {s : α  → Set β}
    (hs : ∀ i, ∃! j, i ∈ s j) : Summable f ↔
      (∀ j, Summable fun i : s j ↦ f i) ∧ Summable fun j ↦ ∑' i : s j, f i

{α : Type u_3}
{β : Type u_4}
{f : β → ℝ}
(hf : 0 ≤ f)
{s : α → Set β}
(hs : ∀ (i : β), ∃! j, i ∈ s j)

Summable f ↔ (∀ (j : α), Summable fun i => f ↑i) ∧ Summable fun j => ∑' (i : ↑(s j)), f ↑i


@[to_additive]
theorem image_of_equiv {ν : Measure β} (h : IsFundamentalDomain G s μ) (f : α ≃ β)
    (hf : QuasiMeasurePreserving f.symm ν μ) (e : H ≃ G)
    (hef : ∀ g, Semiconj f (e g • ·) (g • ·)) : IsFundamentalDomain H (f '' s) ν

(h : MeasureTheory.IsAddFundamentalDomain G s μ)

(hf : MeasureTheory.Measure.QuasiMeasurePreserving (⇑f.symm) ν μ)

(hef : ∀ (g : H), Function.Semiconj (⇑f) (fun x => e g +ᵥ x) fun x => g +ᵥ x)

MeasureTheory.IsAddFundamentalDomain H (⇑f '' s) ν


@[to_additive]
theorem prod_Ico_div_bot (hmn : m < n) : (∏ i ∈ Ico m n, f i) / f m = ∏ i ∈ Ico (m + 1) n, f i

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

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


lemma rootSpace_one_div_two_smul : rootSpace H ((2⁻¹ : K) • α) = ⊥

{K : Type u_1}
{L : Type u_2}
[Field K]
[CharZero K]
[LieRing L]
[LieAlgebra K L]
[LieAlgebra.IsKilling K L]
[FiniteDimensional K L]
{H : LieSubalgebra K L}
[H.IsCartanSubalgebra]
[LieModule.IsTriangularizable K (↥H) L]
(α : LieModule.Weight K (↥H) L)
(hα : α.IsNonZero)


@[simp]
theorem id_apply (x : R) : MulSemiringActionHom.id M x = x

(M : Type u_1)
[Monoid M]
{R : Type u_10}
[Semiring R]
[MulSemiringAction M R]
(x : R)


theorem formPerm_apply_mem_eq_self_iff (hl : Nodup l) (x : α) (hx : x ∈ l) :
    formPerm l x = x ↔ length l ≤ 1

{α : Type u_1}
[DecidableEq α]
(l : List α)
(hl : l.Nodup)
(x : α)
(hx : x ∈ l)


theorem ord_proj_pos (n p : ℕ) : 0 < ord_proj[p] n


lemma frattini_le_coatom {K : Subgroup G} (h : IsCoatom K) : frattini G ≤ K

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


theorem map_map (g : G) (f : F) :
    (s.map (f : R →ₙ+* S)).map (g : S →ₙ+* T) = s.map ((g : S →ₙ+* T).comp (f : R →ₙ+* S))

{R : Type u}
{S : Type v}
{T : Type w}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
[NonUnitalNonAssocSemiring T]
{F : Type u_1}
{G : Type u_2}
[FunLike F R S]
[NonUnitalRingHomClass F R S]
[FunLike G S T]
[NonUnitalRingHomClass G S T]
(s : NonUnitalSubsemiring R)
(g : G)
(f : F)

NonUnitalSubsemiring.map (↑g) (NonUnitalSubsemiring.map (↑f) s) = NonUnitalSubsemiring.map ((↑g).comp ↑f) s


@[simp]
theorem quot_zero : Quot.mk Setoid.r zero = (0 : ColimitType.{w} F)

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

Quot.mk Setoid.r AddCommGrp.Colimits.Prequotient.zero = 0


@[simps!]
instance : Category LightDiagram

(X : CategoryTheory.InducedCategory Profinite LightDiagram.toProfinite)

(a : ↑(LightDiagram.toProfinite X).toTop)


@[simp]
theorem coeSubtype : (subtype s : s → R) = ((↑) : s → R)

{R : Type u}
{S : Type v}
[NonUnitalNonAssocSemiring R]
[SetLike S R]
[NonUnitalSubsemiringClass S R]
(s : S)

⇑(NonUnitalSubsemiringClass.subtype s) = Subtype.val


theorem num_mk (n d : ℤ) : (n /. d).num = d.sign * n / n.gcd d

(Rat.divInt n d).num = d.sign * n / ↑(n.gcd d)


/-- Copy a unit, adjusting definition equalities. -/
@[to_additive (attr := simps) "Copy an `AddUnit`, adjusting definitional equalities."]
def copy (u : αˣ) (val : α) (hv : val = u) (inv : α) (hi : inv = ↑u⁻¹) : αˣ

{α : Type u}
[Monoid α]
(u : αˣ)
(val : α)
(hv : val = ↑u)
(inv : α)
(hi : inv = ↑u⁻¹)


theorem rpow_lt_one {x : ℝ≥0} {z : ℝ} (hx1 : x < 1) (hz : 0 < z) : x ^ z < 1


theorem Tendsto.frequently_map {l₁ : Filter α} {l₂ : Filter β} {p : α → Prop} {q : β → Prop}
    (f : α → β) (c : Filter.Tendsto f l₁ l₂) (w : ∀ x, p x → q (f x)) (h : ∃ᶠ x in l₁, p x) :
    ∃ᶠ y in l₂, q y

{α : Type u}
{β : Type v}
{l₁ : Filter α}
{l₂ : Filter β}
{p : α → Prop}
{q : β → Prop}
(f : α → β)
(c : Filter.Tendsto f l₁ l₂)
(w : ∀ (x : α), p x → q (f x))
(h : ∃ᶠ (x : α) in l₁, p x)


theorem weightedSMul_nonneg (s : Set α) (x : ℝ) (hx : 0 ≤ x) : 0 ≤ weightedSMul μ s x

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(s : Set α)
(x : ℝ)
(hx : 0 ≤ x)


protected theorem _root_.CompletePseudometrizable.iInf {ι : Type*} [Countable ι]
    {t : ι → TopologicalSpace α} (ht₀ : ∃ t₀, @T2Space α t₀ ∧ ∀ i, t i ≤ t₀)
    (ht : ∀ i, ∃ u : UniformSpace α, CompleteSpace α ∧ 𝓤[u].IsCountablyGenerated ∧
      u.toTopologicalSpace = t i) :
    ∃ u : UniformSpace α, CompleteSpace α ∧
      𝓤[u].IsCountablyGenerated ∧ u.toTopologicalSpace = ⨅ i, t i

(ht₀ : ∃ t₀, T2Space α ∧ ∀ (i : ι), t i ≤ t₀)

(ht : ∀ (i : ι), ∃ u, CompleteSpace α ∧ (𝓤 α).IsCountablyGenerated ∧ UniformSpace.toTopologicalSpace = t i)

∃ u, CompleteSpace α ∧ (𝓤 α).IsCountablyGenerated ∧ UniformSpace.toTopologicalSpace = ⨅ i, t i


theorem zero_of_comp_mono {X Y Z : C} {f : X ⟶ Y} (g : Y ⟶ Z) [Mono g] (h : f ≫ g = 0) : f = 0


@[simp, norm_cast]
theorem coe_coe : ⇑(v : R →*₀ Γ₀) = v

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


theorem convexBodySumFun_apply' (x : E K) :
    convexBodySumFun x = ∑ w, ‖x.1 w‖ + 2 * ∑ w, ‖x.2 w‖

(x : ({ w // w.IsReal } → ℝ) × ({ w // w.IsComplex } → ℂ))

NumberField.mixedEmbedding.convexBodySumFun x =
  ∑ w : { w // w.IsReal }, ‖x.1 w‖ + 2 * ∑ w : { w // w.IsComplex }, ‖x.2 w‖


@[reassoc (attr := simp)]
lemma liftHomotopyZeroSucc_comp {Y Z : C} {P : ProjectiveResolution Y} {Q : ProjectiveResolution Z}
    (f : P.complex ⟶ Q.complex) (n : ℕ) (g : P.complex.X n ⟶ Q.complex.X (n + 1))
    (g' : P.complex.X (n + 1) ⟶ Q.complex.X (n + 2))
    (w : f.f (n + 1) = P.complex.d (n + 1) n ≫ g + g' ≫ Q.complex.d (n + 2) (n + 1)) :
    liftHomotopyZeroSucc f n g g' w ≫ Q.complex.d (n + 3) (n + 2) =
      f.f (n + 2) - P.complex.d _ _ ≫ g'

{P : CategoryTheory.ProjectiveResolution Y}

{Q : CategoryTheory.ProjectiveResolution Z}

(w :
  f.f (n + 1) =
    CategoryTheory.CategoryStruct.comp (P.complex.d (n + 1) n) g +
      CategoryTheory.CategoryStruct.comp g' (Q.complex.d (n + 2) (n + 1)))

CategoryTheory.CategoryStruct.comp (CategoryTheory.ProjectiveResolution.liftHomotopyZeroSucc f n g g' w)
    (Q.complex.d (n + 3) (n + 2)) =
  f.f (n + 2) - CategoryTheory.CategoryStruct.comp (P.complex.d (n + 2) (n + 1)) g'


/-- If `R` and `S` are isomorphic, then so are their polynomial rings. -/
@[simps!]
def mapEquiv (e : R ≃+* S) : R[X] ≃+* S[X]

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(e : R ≃+* S)
(a : S[X])

(Polynomial.mapEquiv e).symm a = Polynomial.map (↑e.symm) a


@[simp]
theorem default_nim_one_leftMoves_eq :
    (default : (nim 1).LeftMoves) = @toLeftMovesNim 1 ⟨0, Set.mem_Iio.mpr zero_lt_one⟩

default = SetTheory.PGame.toLeftMovesNim ⟨0, ⋯⟩


@[simp]
theorem comp_apply (f : C(β, γ)) (g : C(α, β)) (a : α) : comp f g a = f (g a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
(f : C(β, γ))
(g : C(α, β))
(a : α)


lemma range_toUniformOnFun [DecidableEq ι] [TopologicalSpace F] :
    range toUniformOnFun =
      {f : (Π i, E i) →ᵤ[{s | IsVonNBounded 𝕜 s}] F |
        Continuous (toFun _ f) ∧
        (∀ (m : Π i, E i) i x y,
          toFun _ f (update m i (x + y)) = toFun _ f (update m i x) + toFun _ f (update m i y)) ∧
        (∀ (m : Π i, E i) i (c : 𝕜) x,
          toFun _ f (update m i (c • x)) = c • toFun _ f (update m i x))}

{𝕜 : Type u_1}
{ι : Type u_2}
{E : ι → Type u_3}
{F : Type u_4}
[NormedField 𝕜]
[(i : ι) → TopologicalSpace (E i)]
[(i : ι) → AddCommGroup (E i)]
[(i : ι) → Module 𝕜 (E i)]
[AddCommGroup F]
[Module 𝕜 F]
[DecidableEq ι]
[TopologicalSpace F]

Set.range ContinuousMultilinearMap.toUniformOnFun =
  {f |
    Continuous ((UniformOnFun.toFun {s | Bornology.IsVonNBounded 𝕜 s}) f) ∧
      (∀ (m : (i : ι) → E i) (i : ι) (x y : E i),
          (UniformOnFun.toFun {s | Bornology.IsVonNBounded 𝕜 s}) f (Function.update m i (x + y)) =
            (UniformOnFun.toFun {s | Bornology.IsVonNBounded 𝕜 s}) f (Function.update m i x) +
              (UniformOnFun.toFun {s | Bornology.IsVonNBounded 𝕜 s}) f (Function.update m i y)) ∧
        ∀ (m : (i : ι) → E i) (i : ι) (c : 𝕜) (x : E i),
          (UniformOnFun.toFun {s | Bornology.IsVonNBounded 𝕜 s}) f (Function.update m i (c • x)) =
            c • (UniformOnFun.toFun {s | Bornology.IsVonNBounded 𝕜 s}) f (Function.update m i x)}


@[reassoc (attr := simp)]
lemma inv_hom_id_eval (e : X ≅ Y) (j : J) :
    e.inv j ≫ e.hom j = 𝟙 _

{C : Type u_1}
{J : Type u_4}
[CategoryTheory.Category.{u_5, u_1} C]
{X Y : CategoryTheory.GradedObject J C}
(e : X ≅ Y)
(j : J)

CategoryTheory.CategoryStruct.comp (e.inv j) (e.hom j) = CategoryTheory.CategoryStruct.id (Y j)


lemma Icc_inl_inl :
    Icc (inlₗ a₁ : α ⊕ₗ β) (inlₗ a₂) = (Icc a₁ a₂).map (Embedding.inl.trans toLex.toEmbedding)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
[OrderTop α]
[OrderBot β]
[LocallyFiniteOrder α]
[LocallyFiniteOrder β]
(a₁ a₂ : α)

Finset.Icc (Sum.inlₗ a₁) (Sum.inlₗ a₂) = Finset.map (Function.Embedding.inl.trans toLex.toEmbedding) (Finset.Icc a₁ a₂)


@[simp]
theorem length_neg : (-s).length = s.length

{α : Type u_2}
[OrderedAddCommGroup α]
(s : NonemptyInterval α)


@[to_additive (attr := simp)]
theorem prod_inv [∀ i, AddCommMonoid (β i)] [∀ (i) (x : β i), Decidable (x ≠ 0)] [CommGroup γ]
    {f : Π₀ i, β i} {h : ∀ i, β i → γ} : (f.prod fun i b => (h i b)⁻¹) = (f.prod h)⁻¹

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


@[simp] theorem run_lift  [Monad.{u, v} m] (x : m α) : run (ExceptT.lift x : ExceptT ε m α) = (Except.ok <$> x : m (Except ε α))

{m : Type u → Type v}
{α ε : Type u}
[Monad m]
(x : m α)


theorem image_cast_int_Ico (a b : ℕ) : (↑) '' Ico a b = Ico (a : ℤ) b


theorem inf_principal_eq_bot {f : Filter α} {s : Set α} : f ⊓ 𝓟 s = ⊥ ↔ sᶜ ∈ f

f ⊓ 𝓟 s = ⊥ ↔ sᶜ ∈ f


theorem isProbabilityMeasure_map {f : α → β} (hf : AEMeasurable f μ) :
    IsProbabilityMeasure (map f μ)

{α : Type u_1}
{β : Type u_2}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
[MeasureTheory.IsProbabilityMeasure μ]
{f : α → β}
(hf : AEMeasurable f μ)

MeasureTheory.IsProbabilityMeasure (MeasureTheory.Measure.map f μ)


theorem eraseP_cons (a : α) (l : List α) :
    (a :: l).eraseP p = bif p a then l else a :: l.eraseP p

{α : Type u_1}
{p : α → Bool}
(a : α)
(l : List α)

List.eraseP p (a :: l) = bif p a then l else a :: List.eraseP p l


theorem exists_coprime_of_gcd_pos {a : ℤ√d} (hgcd : 0 < Int.gcd a.re a.im) :
    ∃ b : ℤ√d, a = ((Int.gcd a.re a.im : ℤ) : ℤ√d) * b ∧ IsCoprime b.re b.im

{d : ℤ}
{a : ℤ√d}
(hgcd : 0 < a.re.gcd a.im)

∃ b, a = ↑↑(a.re.gcd a.im) * b ∧ IsCoprime b.re b.im


@[to_additive]
theorem measure_pos_iff_nonempty_of_smulInvariant (hμ : μ ≠ 0) (hU : IsOpen U) :
    0 < μ U ↔ U.Nonempty

[MeasureTheory.VAddInvariantMeasure G α μ]


theorem map_comap_eq_self_of_surjective
    {f : A →ₐ[R] B} (hf : Function.Surjective f) (S : Subalgebra R B) : (S.comap f).map f = S

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
{f : A →ₐ[R] B}
(hf : Function.Surjective ⇑f)
(S : Subalgebra R B)

Subalgebra.map f (Subalgebra.comap f S) = S


lemma smulPosStrictMono_iff_SMulPosReflectLE : SMulPosStrictMono α β ↔ SMulPosReflectLE α β

{α : Type u_1}
{β : Type u_2}
[SMul α β]
[LinearOrder α]
[LinearOrder β]
[Zero β]


/-- `x` is an accumulation point of a set `C` iff every neighborhood
of `x` contains a point of `C` other than `x`. -/
theorem accPt_iff_nhds (x : X) (C : Set X) : AccPt x (𝓟 C) ↔ ∀ U ∈ 𝓝 x, ∃ y ∈ U ∩ C, y ≠ x

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


theorem minimum_le_of_mem' (ha : a ∈ l) : minimum l ≤ (a : WithTop α)

{α : Type u_1}
[LinearOrder α]
{l : List α}
{a : α}
(ha : a ∈ l)


@[simp]
theorem comp_apply
    (g : B →ₑ+[ψ] C) (f : A →ₑ+[φ] B) [MonoidHom.CompTriple φ ψ χ] (x : A) : g.comp f x = g (f x)

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{P : Type u_3}
[Monoid P]
{φ : M →* N}
{ψ : N →* P}
{χ : M →* P}
{A : Type u_4}
[AddMonoid A]
[DistribMulAction M A]
{B : Type u_5}
[AddMonoid B]
[DistribMulAction N B]
{C : Type u_7}
[AddMonoid C]
[DistribMulAction P C]
(g : B →ₑ+[ψ] C)
(f : A →ₑ+[φ] B)
[φ.CompTriple ψ χ]
(x : A)


theorem zero_bot (n : ℕ) : Ico 0 n = range n


@[reassoc, simp]
theorem Spec.map_comp {R S T : CommRingCat} (f : R ⟶ S) (g : S ⟶ T) :
    Spec.map (f ≫ g) = Spec.map g ≫ Spec.map f

AlgebraicGeometry.Spec.map (f ≫ g) = AlgebraicGeometry.Spec.map g ≫ AlgebraicGeometry.Spec.map f


theorem symm_trans (e₁ : α ≃o β) (e₂ : β ≃o γ) : (e₁.trans e₂).symm = e₂.symm.trans e₁.symm

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[LE α]
[LE β]
[LE γ]
(e₁ : α ≃o β)
(e₂ : β ≃o γ)


/-- A field extension `E / F` of exponential characteristic `q` is purely inseparable
if and only if for every element `x` of `E`, there exists a natural number `n` such that
`x ^ (q ^ n)` is contained in `F`. -/
theorem isPurelyInseparable_iff_pow_mem (q : ℕ) [ExpChar F q] :
    IsPurelyInseparable F E ↔ ∀ x : E, ∃ n : ℕ, x ^ q ^ n ∈ (algebraMap F E).range

(F : Type u)
{E : Type v}
[Field F]
[Field E]
[Algebra F E]
(q : ℕ)
[ExpChar F q]

IsPurelyInseparable F E ↔ ∀ (x : E), ∃ n, x ^ q ^ n ∈ (algebraMap F E).range


theorem aleph'_limit {o : Ordinal} (ho : o.IsLimit) : aleph' o = ⨆ a : Iio o, aleph' a

Cardinal.aleph' o = ⨆ a, Cardinal.aleph' ↑a


/-- A family of non-unital ring homomorphisms `f a : γ →ₙ+* β a` defines a non-unital ring
homomorphism `Pi.nonUnitalRingHom f : γ →+* Π a, β a` given by
`Pi.nonUnitalRingHom f x b = f b x`. -/
@[simps]
protected def nonUnitalRingHom {γ : Type w} [∀ i, NonUnitalNonAssocSemiring (f i)]
    [NonUnitalNonAssocSemiring γ] (g : ∀ i, γ →ₙ+* f i) : γ →ₙ+* ∀ i, f i

[(i : I) → NonUnitalNonAssocSemiring (f i)]


theorem Heap.rankGT.of_le (h : Heap.rankGT s n) (h' : n' ≤ n) : s.rankGT n'

∀ {α : Type u_1} {s : Batteries.BinomialHeap.Imp.Heap α} {n n' : Nat}, s.rankGT n → n' ≤ n → s.rankGT n'


@[simp]
lemma comap_apply (f : V ≃ W) (G : SimpleGraph W) (v : V) :
    SimpleGraph.Iso.comap f G v = f v

{V : Type u_1}
{W : Type u_2}
(f : V ≃ W)
(G : SimpleGraph W)
(v : V)


theorem FiniteDimensional.finrank_linearMap_self : finrank S (M →ₗ[R] S) = finrank R M

(R : Type u)
(S : Type u')
(M : Type v)
[Ring R]
[Ring S]
[AddCommGroup M]
[Module R M]
[Module.Free R M]
[Module.Finite R M]
[StrongRankCondition R]
[StrongRankCondition S]
[Module R S]
[SMulCommClass R S S]

FiniteDimensional.finrank S (M →ₗ[R] S) = FiniteDimensional.finrank R M


/-- rank of a hermitian matrix is the rank of after diagonalization by the eigenvector unitary -/
lemma rank_eq_rank_diagonal : A.rank = (Matrix.diagonal hA.eigenvalues).rank

{𝕜 : Type u_1}
[RCLike 𝕜]
{n : Type u_2}
[Fintype n]
{A : Matrix n n 𝕜}
[DecidableEq n]
(hA : A.IsHermitian)


theorem mem_bot {x : R} : x ∈ (⊥ : NonUnitalSubsemiring R) ↔ x = 0

{R : Type u}
[NonUnitalNonAssocSemiring R]
{x : R}


@[reassoc (attr := simp)]
theorem biprod.map_fst {W X Y Z : C} [HasBinaryBiproduct W X] [HasBinaryBiproduct Y Z] (f : W ⟶ Y)
    (g : X ⟶ Z) : biprod.map f g ≫ biprod.fst = biprod.fst ≫ f

CategoryTheory.Limits.biprod.map f g ≫ CategoryTheory.Limits.biprod.fst = CategoryTheory.Limits.biprod.fst ≫ f


@[to_additive]
theorem div_le_comm : a / b ≤ c ↔ a / c ≤ b

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


/-- In a non-trivial integral domain, an element is regular iff it is non-zero. -/
theorem isRegular_iff_ne_zero [Nontrivial R] : IsRegular a ↔ a ≠ 0

{R : Type u_1}
[MulZeroClass R]
[IsCancelMulZero R]
{a : R}
[Nontrivial R]


/-- **Rearrangement Inequality**: Pointwise multiplication of `f` and `g` is minimized when `f` and
`g` antivary together. Stated by permuting the entries of `g`. -/
theorem AntivaryOn.sum_mul_le_sum_mul_comp_perm (hfg : AntivaryOn f g s)
    (hσ : {x | σ x ≠ x} ⊆ s) : ∑ i ∈ s, f i * g i ≤ ∑ i ∈ s, f i * g (σ i)

{ι : Type u_1}
{α : Type u_2}
[LinearOrderedRing α]
{s : Finset ι}
{σ : Equiv.Perm ι}
{f g : ι → α}
(hfg : AntivaryOn f g ↑s)
(hσ : {x | σ x ≠ x} ⊆ ↑s)


theorem IsCycle.support_pow_eq_iff (hf : IsCycle f) {n : ℕ} :
    support (f ^ n) = support f ↔ ¬orderOf f ∣ n

{α : Type u_2}
{f : Equiv.Perm α}
[DecidableEq α]
[Fintype α]
(hf : f.IsCycle)
{n : ℕ}

(f ^ n).support = f.support ↔ ¬orderOf f ∣ n


@[simp] theorem filter_append {p : α → Bool} :
    ∀ (l₁ l₂ : List α), filter p (l₁ ++ l₂) = filter p l₁ ++ filter p l₂

{α : Type u_1}
{p : α → Bool}
(l₁ l₂ : List α)

List.filter p (l₁ ++ l₂) = List.filter p l₁ ++ List.filter p l₂


theorem integrable_of_forall_fin_meas_le' {μ : Measure α} (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
    (C : ℝ≥0∞) (hC : C < ∞) {f : α → E} (hf_meas : AEStronglyMeasurable f μ)
    (hf : ∀ s, MeasurableSet[m] s → μ s ≠ ∞ → (∫⁻ x in s, ‖f x‖₊ ∂μ) ≤ C) : Integrable f μ

(hf_meas : MeasureTheory.AEStronglyMeasurable f μ)

(hf : ∀ (s : Set α), MeasurableSet s → μ s ≠ ⊤ → ∫⁻ (x : α) in s, ↑‖f x‖₊ ∂μ ≤ C)


@[gcongr]
theorem nhdsWithin_mono (x : X) {s t : Set X} (h : s ⊆ t) : 𝓝[s] x ≤ 𝓝[t] x

{X : Type u}
[TopologicalSpace X]
(x : X)
{s t : Set X}
(h : s ⊆ t)


@[to_additive]
nonrec lemma Subgroup.orderOf_dvd_natCard (s : Subgroup G) (hx : x ∈ s) :
  orderOf x ∣ Nat.card s

{G : Type u_1}
[AddGroup G]
{x : G}
(s : AddSubgroup G)
(hx : x ∈ s)


theorem germ_ext (F : X.Presheaf C) {U V : Opens X} {x : X} {hxU : x ∈ U} {hxV : x ∈ V}
    (W : Opens X) (hxW : x ∈ W) (iWU : W ⟶ U) (iWV : W ⟶ V) {sU : F.obj (op U)} {sV : F.obj (op V)}
    (ih : F.map iWU.op sU = F.map iWV.op sV) :
      F.germ ⟨x, hxU⟩ sU = F.germ ⟨x, hxV⟩ sV

{sU : (CategoryTheory.forget C).obj (F.obj (Opposite.op U))}

{sV : (CategoryTheory.forget C).obj (F.obj (Opposite.op V))}

(ih : (F.map iWU.op) sU = (F.map iWV.op) sV)

(F.germ ⟨x, hxU⟩) sU = (F.germ ⟨x, hxV⟩) sV


@[simp] theorem conj_refl : conj (Equiv.refl α) = Equiv.refl (α → α)

(Equiv.refl α).conj = Equiv.refl (α → α)


/-- An additive functor preserves homotopy equivalences. -/
@[simps]
def Functor.mapHomotopyEquiv (F : V ⥤ W) [F.Additive] (h : HomotopyEquiv C D) :
    HomotopyEquiv ((F.mapHomologicalComplex c).obj C) ((F.mapHomologicalComplex c).obj D)

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D : HomologicalComplex V c}
{W : Type u_2}
[CategoryTheory.Category.{u_3, u_2} W]
[CategoryTheory.Preadditive W]
(F : V ⥤ W)
[F.Additive]
(h : HomotopyEquiv C D)

(F.mapHomotopyEquiv h).homotopyHomInvId = ⋯.mpr (⋯.mpr (F.mapHomotopy h.homotopyHomInvId))


theorem node3L_size {l x m y r} : size (@node3L α l x m y r) = size l + size m + size r + 2

{α : Type u_1}
{l : Ordnode α}
{x : α}
{m : Ordnode α}
{y : α}
{r : Ordnode α}

(l.node3L x m y r).size = l.size + m.size + r.size + 2


@[simp]
theorem removeRightOp_id : NatTrans.removeRightOp (𝟙 F.rightOp) = 𝟙 F

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : CategoryTheory.Functor Cᵒᵖ D}

CategoryTheory.NatTrans.removeRightOp (CategoryTheory.CategoryStruct.id F.rightOp) = CategoryTheory.CategoryStruct.id F


@[simp]
theorem map_bind {γ} (f : α → Part β) (x : Part α) (g : β → γ) :
    map g (x.bind f) = x.bind fun y => map g (f y)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_4}
(f : α → Part β)
(x : Part α)
(g : β → γ)

Part.map g (x.bind f) = x.bind fun y => Part.map g (f y)


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

{M : Type u_1}
⦃m₁ m₂ : DivInvMonoid M⦄
(h_mul : HMul.hMul = HMul.hMul)
(h_inv : Inv.inv = Inv.inv)


/-- The equivalence between `C` and `AsSmall C`. -/
@[simps]
def AsSmall.equiv : C ≌ AsSmall C

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

CategoryTheory.AsSmall.equiv.unitIso = CategoryTheory.NatIso.ofComponents (fun X => CategoryTheory.eqToIso ⋯) ⋯


@[simp, reassoc]
theorem limitFlipCompLimIsoLimitCompLim_hom_π_π (j) (k) :
    (limitFlipCompLimIsoLimitCompLim F).hom ≫ limit.π _ j ≫ limit.π _ k =
      (limit.π _ k ≫ limit.π _ j : limit (_ ⋙ lim) ⟶ _)

[CategoryTheory.Limits.HasLimitsOfShape (J × K) C]

[CategoryTheory.Limits.HasLimitsOfShape (K × J) C]

(CategoryTheory.Limits.limitFlipCompLimIsoLimitCompLim F).hom ≫
    CategoryTheory.Limits.limit.π (F ⋙ CategoryTheory.Limits.lim) j ≫ CategoryTheory.Limits.limit.π (F.obj j) k =
  CategoryTheory.Limits.limit.π (F.flip ⋙ CategoryTheory.Limits.lim) k ≫ CategoryTheory.Limits.limit.π (F.flip.obj k) j


theorem ContMDiffOn.prod_mk {f : M → M'} {g : M → N'} (hf : ContMDiffOn I I' n f s)
    (hg : ContMDiffOn I J' n g s) : ContMDiffOn I (I'.prod J') n (fun x => (f x, g x)) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{F' : Type u_14}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{G' : Type u_15}
[TopologicalSpace G']
{J' : ModelWithCorners 𝕜 F' G'}
{N' : Type u_16}
[TopologicalSpace N']
[ChartedSpace G' N']
{s : Set M}
{n : ℕ∞}
{f : M → M'}
{g : M → N'}
(hf : ContMDiffOn I I' n f s)
(hg : ContMDiffOn I J' n g s)


@[deprecated DiscreteTopology.secondCountableTopology_of_countable (since := "2024-03-11")]
theorem DiscreteTopology.secondCountableTopology_of_encodable {α : Type*}
    [TopologicalSpace α] [DiscreteTopology α] [Countable α] : SecondCountableTopology α

{α : Type u_2}
[TopologicalSpace α]
[DiscreteTopology α]
[Countable α]


@[simp]
theorem diff_univ (s : Set α) : s \ univ = ∅


@[to_additive]
theorem tprod_eq_prod {s : Finset β} (hf : ∀ b ∉ s, f b = 1) :
    ∏' b, f b = ∏ b ∈ s, f b

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
{s : Finset β}
(hf : ∀ b ∉ s, f b = 0)


lemma Connected.adj_union {H K : G.Subgraph}
    (Hconn : H.Connected) (Kconn : K.Connected) {u v : V} (uH : u ∈ H.verts) (vK : v ∈ K.verts)
    (huv : G.Adj u v) :
    ((⊤ : G.Subgraph).induce {u, v} ⊔ H ⊔ K).Connected

{V : Type u}
{G : SimpleGraph V}
{H K : G.Subgraph}
(Hconn : H.Connected)
(Kconn : K.Connected)
{u v : V}
(uH : u ∈ H.verts)
(vK : v ∈ K.verts)
(huv : G.Adj u v)


theorem add_ediv_of_dvd_left {a b c : Int} (H : c ∣ a) : (a + b) / c = a / c + b / c


/-- `Equiv.piCongr` as a homeomorphism: this is the natural homeomorphism
`Π i₁, Y₁ i ≃ₜ Π i₂, Y₂ i₂` obtained from a bijection `ι₁ ≃ ι₂` and homeomorphisms
`Y₁ i₁ ≃ₜ Y₂ (e i₁)` for each `i₁ : ι₁`. -/
@[simps! apply toEquiv]
def piCongr {ι₁ ι₂ : Type*} {Y₁ : ι₁ → Type*} {Y₂ : ι₂ → Type*}
    [∀ i₁, TopologicalSpace (Y₁ i₁)] [∀ i₂, TopologicalSpace (Y₂ i₂)]
    (e : ι₁ ≃ ι₂) (F : ∀ i₁, Y₁ i₁ ≃ₜ Y₂ (e i₁)) : (∀ i₁, Y₁ i₁) ≃ₜ ∀ i₂, Y₂ i₂

{ι₁ : Type u_6}
{ι₂ : Type u_7}
{Y₁ : ι₁ → Type u_8}
{Y₂ : ι₂ → Type u_9}
[(i₁ : ι₁) → TopologicalSpace (Y₁ i₁)]
[(i₂ : ι₂) → TopologicalSpace (Y₂ i₂)]
(e : ι₁ ≃ ι₂)
(F : (i₁ : ι₁) → Y₁ i₁ ≃ₜ Y₂ (e i₁))

(Homeomorph.piCongr e F).toEquiv = (Equiv.piCongrRight fun i => (F i).toEquiv).trans (Equiv.piCongrLeft Y₂ e)


protected theorem ContDiffOn.inversion (hc : ContDiffOn ℝ n c s) (hR : ContDiffOn ℝ n R s)
    (hx : ContDiffOn ℝ n x s) (hne : ∀ a ∈ s, x a ≠ c a) :
    ContDiffOn ℝ n (fun a ↦ inversion (c a) (R a) (x a)) s

{E : Type u_1}
{F : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
{c x : E → F}
{R : E → ℝ}
{s : Set E}
{n : ℕ∞}
(hc : ContDiffOn ℝ n c s)
(hR : ContDiffOn ℝ n R s)
(hx : ContDiffOn ℝ n x s)
(hne : ∀ a ∈ s, x a ≠ c a)

ContDiffOn ℝ n (fun a => EuclideanGeometry.inversion (c a) (R a) (x a)) s


@[simp]
theorem image_intrinsicClosure (φ : P →ᵃⁱ[𝕜] Q) (s : Set P) :
    intrinsicClosure 𝕜 (φ '' s) = φ '' intrinsicClosure 𝕜 s

{𝕜 : Type u_1}
{V : Type u_2}
{W : Type u_3}
{Q : Type u_4}
{P : Type u_5}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[SeminormedAddCommGroup W]
[NormedSpace 𝕜 V]
[NormedSpace 𝕜 W]
[MetricSpace P]
[PseudoMetricSpace Q]
[NormedAddTorsor V P]
[NormedAddTorsor W Q]
(φ : P →ᵃⁱ[𝕜] Q)
(s : Set P)

intrinsicClosure 𝕜 (⇑φ '' s) = ⇑φ '' intrinsicClosure 𝕜 s


/-- Passing from `Monad C` to `Mon_ (C ⥤ C)` is functorial. -/
@[simps]
def monadToMon : Monad C ⥤ Mon_ (C ⥤ C)

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

(CategoryTheory.Monad.monadToMon C).obj M = M.toMon


@[simp]
theorem toIocDiv_zsmul_sub_self (a b : α) : toIocDiv hp a b • p - b = -toIocMod hp a b

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
(hp : 0 < p)
(a b : α)


@[to_additive]
theorem alternatingProd_eq_finset_prod {G : Type*} [CommGroup G] :
    ∀ (L : List G), alternatingProd L = ∏ i : Fin L.length, L.get i ^ (-1 : ℤ) ^ (i : ℕ)

{G : Type u_3}
[CommGroup G]
(L : List G)

L.alternatingProd = ∏ i : Fin L.length, L.get i ^ (-1) ^ ↑i


theorem polynomial_eval_eval₂ [CommSemiring R] [CommSemiring S]
    {x : S} (f : R →+* Polynomial S) (g : σ → Polynomial S) (p : MvPolynomial σ R) :
    Polynomial.eval x (eval₂ f g p) =
      eval₂ ((Polynomial.evalRingHom x).comp f) (fun s => Polynomial.eval x (g s)) p

{R : Type u_1}
{S : Type u_2}
{σ : Type u_3}
[CommSemiring R]
[CommSemiring S]
{x : S}
(f : R →+* Polynomial S)
(g : σ → Polynomial S)
(p : MvPolynomial σ R)

Polynomial.eval x (MvPolynomial.eval₂ f g p) =
  MvPolynomial.eval₂ ((Polynomial.evalRingHom x).comp f) (fun s => Polynomial.eval x (g s)) p


@[simp] lemma pos_nilpotencyClass_iff [Nontrivial R] :
    0 < nilpotencyClass x ↔ IsNilpotent x

{R : Type u_1}
{x : R}
[MonoidWithZero R]
[Nontrivial R]


theorem map_comap_eq_self {f : L →ₐ[K] L'} {S : IntermediateField K L'} (h : S ≤ f.fieldRange) :
    (S.comap f).map f = S

{K : Type u_1}
{L : Type u_2}
{L' : Type u_3}
[Field K]
[Field L]
[Field L']
[Algebra K L]
[Algebra K L']
{f : L →ₐ[K] L'}
{S : IntermediateField K L'}
(h : S ≤ f.fieldRange)

IntermediateField.map f (IntermediateField.comap f S) = S


theorem aecover_Ico_of_Icc (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B)) :
    AECover (μ.restrict <| Ico A B) l fun i => Icc (a i) (b i)

{α : Type u_1}
{ι : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
[OpensMeasurableSpace α]
{a b : ι → α}
{A B : α}
[MeasureTheory.NoAtoms μ]
(ha : Filter.Tendsto a l (𝓝 A))
(hb : Filter.Tendsto b l (𝓝 B))

MeasureTheory.AECover (μ.restrict (Set.Ico A B)) l fun i => Set.Icc (a i) (b i)


theorem dropWhile_nthLe_zero_not (l : List α) (hl : 0 < (l.dropWhile p).length) :
    ¬p ((l.dropWhile p).nthLe 0 hl)

{α : Type u}
(p : α → Bool)
(l : List α)
(hl : 0 < (List.dropWhile p l).length)

¬p ((List.dropWhile p l).nthLe 0 hl) = true


theorem testAgainstNN_lipschitz_estimate (μ : FiniteMeasure Ω) (f g : Ω →ᵇ ℝ≥0) :
    μ.testAgainstNN f ≤ μ.testAgainstNN g + nndist f g * μ.mass

{Ω : Type u_1}
[MeasurableSpace Ω]
[TopologicalSpace Ω]
[OpensMeasurableSpace Ω]
(μ : MeasureTheory.FiniteMeasure Ω)
(f g : Ω →ᵇ ℝ≥0)


theorem average_eq (f : α → E) : ⨍ x, f x ∂μ = (μ univ).toReal⁻¹ • ∫ x, f x ∂μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(μ : MeasureTheory.Measure α)
(f : α → E)

⨍ (x : α), f x ∂μ = (μ Set.univ).toReal⁻¹ • ∫ (x : α), f x ∂μ


lemma smash_succ_castAdd {p q : RelSeries r} (h : p.last = q.head)
    (i : Fin p.length) : p.smash q h (i.castAdd q.length).succ = p i.succ

{α : Type u_1}
{r : Rel α α}
{p q : RelSeries r}
(h : p.last = q.head)
(i : Fin p.length)

(p.smash q h).toFun (Fin.castAdd q.length i).succ = p.toFun i.succ


theorem isEquiv_of_val_le_one [LinearOrderedCommGroupWithZero Γ₀]
    [LinearOrderedCommGroupWithZero Γ'₀] (v : Valuation K Γ₀) (v' : Valuation K Γ'₀)
    (h : ∀ {x : K}, v x ≤ 1 ↔ v' x ≤ 1) : v.IsEquiv v'

{K : Type u_1}
[DivisionRing K]
{Γ₀ : Type u_4}
{Γ'₀ : Type u_5}
[LinearOrderedCommGroupWithZero Γ₀]
[LinearOrderedCommGroupWithZero Γ'₀]
(v : Valuation K Γ₀)
(v' : Valuation K Γ'₀)
(h : ∀ {x : K}, v x ≤ 1 ↔ v' x ≤ 1)


theorem eq_zero_of_isEmpty [IsEmpty α] {_m : MeasurableSpace α} (μ : Measure α) : μ = 0

{α : Type u_1}
[IsEmpty α]
{_m : MeasurableSpace α}
(μ : MeasureTheory.Measure α)


/-- Given a distinguished triangle `T` such that `T.mor₃ = 0` and the datum of morphisms
`inr : T.obj₃ ⟶ T.obj₂` and `fst : T.obj₂ ⟶ T.obj₁` satisfying suitable relations, this
is the binary biproduct data expressing that `T.obj₂` identifies to the binary
biproduct of `T.obj₁` and `T.obj₃`.
See also `exists_iso_binaryBiproduct_of_distTriang`. -/
@[simps]
def binaryBiproductData (T : Triangle C) (hT : T ∈ distTriang C) (hT₀ : T.mor₃ = 0)
    (inr : T.obj₃ ⟶ T.obj₂) (inr_snd : inr ≫ T.mor₂ = 𝟙 _) (fst : T.obj₂ ⟶ T.obj₁)
    (total : fst ≫ T.mor₁ + T.mor₂ ≫ inr = 𝟙 T.obj₂) :
    BinaryBiproductData T.obj₁ T.obj₃

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(CategoryTheory.Pretriangulated.binaryBiproductData T hT hT₀ inr inr_snd fst total).bicone.pt = T.obj₂


theorem log_pow {b : ℕ} (hb : 1 < b) (x : ℕ) : log b (b ^ x) = x


/-- An application of the layer cake formula / Cavalieri's principle / tail probability formula:

For a nonnegative function `f` on a measure space, the Lebesgue integral of `f` can
be written (roughly speaking) as: `∫⁻ f^p ∂μ = p * ∫⁻ t in 0..∞, t^(p-1) * μ {ω | f(ω) ≥ t}`.

See `MeasureTheory.lintegral_rpow_eq_lintegral_meas_lt_mul` for a version with sets of the form
`{ω | f(ω) > t}` instead. -/
theorem lintegral_rpow_eq_lintegral_meas_le_mul :
    ∫⁻ ω, ENNReal.ofReal (f ω ^ p) ∂μ =
      ENNReal.ofReal p * ∫⁻ t in Ioi 0, μ {a : α | t ≤ f a} * ENNReal.ofReal (t ^ (p - 1))

{α : Type u_1}
[MeasurableSpace α]
{f : α → ℝ}
(μ : MeasureTheory.Measure α)
(f_nn : 0 ≤ᵐ[μ] f)
(f_mble : AEMeasurable f μ)
{p : ℝ}
(p_pos : 0 < p)

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


/-- Tailored version for even Jacobi theta functions. -/
lemma hasSum_mellin_pi_mul_sq {a : ι → ℂ} {r : ι → ℝ} {F : ℝ → ℂ} {s : ℂ} (hs : 0 < s.re)
    (hF : ∀ t ∈ Ioi 0, HasSum (fun i ↦ if r i = 0 then 0 else a i * rexp (-π * r i ^ 2 * t)) (F t))
    (h_sum : Summable fun i ↦ ‖a i‖ / |r i| ^ s.re) :
    HasSum (fun i ↦ Gammaℝ s * a i / |r i| ^ s) (mellin F (s / 2))

(hF : ∀ t ∈ Set.Ioi 0, HasSum (fun i => if r i = 0 then 0 else a i * ↑(rexp (-π * r i ^ 2 * t))) (F t))

(h_sum : Summable fun i => ‖a i‖ / |r i| ^ s.re)

HasSum (fun i => s.Gammaℝ * a i / ↑|r i| ^ s) (mellin F (s / 2))


@[to_additive]
protected theorem NeBot.mul : NeBot f → NeBot g → NeBot (f * g)


protected theorem IsTopologicalBasis.continuous_iff {β : Type*} [TopologicalSpace β]
    {B : Set (Set β)} (hB : IsTopologicalBasis B) {f : α → β} :
    Continuous f ↔ ∀ s ∈ B, IsOpen (f ⁻¹' s)

(hB : TopologicalSpace.IsTopologicalBasis B)


/-- Any type with a distinguished element is equivalent to an `Option` type on the subtype excluding
that element. -/
@[simps!]
def optionSubtypeNe (a : α) : Option {b // b ≠ a} ≃ α

∀ (a_1 : Option { y // y ≠ a }), (Equiv.optionSubtypeNe a) a_1 = a_1.casesOn' a Subtype.val


theorem IsRelPrime.of_add_mul_left_left (h : IsRelPrime (x + y * z) y) : IsRelPrime x y

{R : Type u}
[CommSemiring R]
{x y z : R}
(h : IsRelPrime (x + y * z) y)


/-- Constructs an equivalence between Boolean algebras from an order isomorphism between them. -/
@[simps]
def Iso.mk {α β : BoolAlg.{u}} (e : α ≃o β) : α ≅ β


@[norm_cast]
theorem coe_zero : ((0 : M [⋀^ι]→ₗ[R] N) : MultilinearMap R (fun _ : ι => M) N) = 0

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}


/-- A multiplicative isomorphism preserves multiplication (deprecated). -/
@[to_additive "An additive isomorphism preserves addition (deprecated)."]
theorem isMulHom (h : M ≃* N) : IsMulHom h

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
(h : M ≃+ N)


theorem Nonempty.subset_singleton_iff (h : s.Nonempty) : s ⊆ {a} ↔ s = {a}

{α : Type u}
{a : α}
{s : Set α}
(h : s.Nonempty)


@[to_additive (attr := simp)]
theorem mulEquiv_apply (e : α ≃ β) [Mul β] (a : α) : (mulEquiv e) a = e a

{α : Type u}
{β : Type v}
(e : α ≃ β)
[Add β]
(a : α)


@[simp]
theorem ofIsoLimit_lift {r t : Cone F} (P : IsLimit r) (i : r ≅ t) (s) :
    (P.ofIsoLimit i).lift s = P.lift s ≫ i.hom.hom

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


theorem Pairwise.map {S : β → β → Prop} (f : α → β) (H : ∀ a b : α, R a b → S (f a) (f b))
    (p : Pairwise R l) : Pairwise S (map f l)

(H : ∀ (a b : α), R a b → S (f a) (f b))


@[simp] theorem natAdd_last {m n : Nat} : natAdd n (last m) = last (n + m)

Fin.natAdd n (Fin.last m) = Fin.last (n + m)


theorem of_comp_right (hgf : IsLocalHomeomorphOn (g ∘ f) s) (hf : IsLocalHomeomorphOn f s) :
    IsLocalHomeomorphOn g (f '' s)

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{g : Y → Z}
{f : X → Y}
{s : Set X}
(hgf : IsLocalHomeomorphOn (g ∘ f) s)
(hf : IsLocalHomeomorphOn f s)


theorem sInf_image2_eq_sInf_sInf (h₁ : ∀ b, GaloisConnection (l₁ b) (swap u b))
    (h₂ : ∀ a, GaloisConnection (l₂ a) (u a)) : sInf (image2 u s t) = u (sInf s) (sInf t)

{u : α → β → γ}

{l₁ : β → γ → α}

{l₂ : α → γ → β}

(h₁ : ∀ (b : β), GaloisConnection (l₁ b) (Function.swap u b))

(h₂ : ∀ (a : α), GaloisConnection (l₂ a) (u a))

sInf (Set.image2 u s t) = u (sInf s) (sInf t)


@[to_additive]
theorem subset_interior_div_left : interior s / t ⊆ interior (s / t)

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
{s t : Set G}


lemma mul_eq_right (hb : b ≠ 0) : a * b = b ↔ a = 1


/-- `MulEquivClass F A B` states that `F` is a type of multiplication-preserving morphisms.
You should extend this class when you extend `MulEquiv`. -/
-- TODO: make this a synonym for MulHomClass?
@[to_additive]
class MulEquivClass (F : Type*) (A B : outParam Type*) [Mul A] [Mul B] [EquivLike F A B] :
    Prop where
  /-- Preserves multiplication. -/
  map_mul : ∀ (f : F) (a b), f (a * b) = f a * f b

{F : Type u_12}
{A : outParam (Type u_13)}
{B : outParam (Type u_14)}
[Mul A]
[Mul B]
[EquivLike F A B]
[self : MulEquivClass F A B]
(f : F)
(a b : A)


theorem DifferentiableAt.of_dslope (h : DifferentiableAt 𝕜 (dslope f a) b) :
    DifferentiableAt 𝕜 f b

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → E}
{a b : 𝕜}
(h : DifferentiableAt 𝕜 (dslope f a) b)


@[simp]
theorem map_surjective_iff {f : α → β} : Surjective (map f) ↔ Surjective f

Function.Surjective (List.map f) ↔ Function.Surjective f


@[simp] lemma norm_up (x : E) : ‖ULift.up x‖ = ‖x‖


theorem injective_or_eq_zero [IsSimpleModule R M] (f : M →ₗ[R] N) :
    Function.Injective f ∨ f = 0

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


@[simp]
theorem modMonomial_X (i : σ) : (X i : MvPolynomial σ R) %ᵐᵒⁿᵒᵐⁱᵃˡ Finsupp.single i 1 = 0

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

(MvPolynomial.X i).modMonomial (Finsupp.single i 1) = 0


theorem gauge_le_one_iff_mem_closure (hc : Convex ℝ s) (hs₀ : s ∈ 𝓝 0) :
    gauge s x ≤ 1 ↔ x ∈ closure s

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
{x : E}
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul ℝ E]
(hc : Convex ℝ s)
(hs₀ : s ∈ 𝓝 0)


/-- Characterisation of `2`-Freiman homs. -/
@[to_additive "Characterisation of `2`-Freiman homs."]
lemma isMulFreimanHom_two :
    IsMulFreimanHom 2 A B f ↔ MapsTo f A B ∧ ∀ a ∈ A, ∀ b ∈ A, ∀ c ∈ A, ∀ d ∈ A,
      a * b = c * d → f a * f b = f c * f d

{α : Type u_2}
{β : Type u_3}
[AddCommMonoid α]
[AddCommMonoid β]
{A : Set α}
{B : Set β}
{f : α → β}

IsAddFreimanHom 2 A B f ↔ Set.MapsTo f A B ∧ ∀ a ∈ A, ∀ b ∈ A, ∀ c ∈ A, ∀ d ∈ A, a + b = c + d → f a + f b = f c + f d


/-- A functor that preserves the pullbacks of `f i j` and `f i k` can map a family of glue data. -/
@[simps]
def mapGlueData : GlueData C'

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


lemma LeftFraction.exists_rightFraction [W.HasRightCalculusOfFractions] {X Y : C}
    (φ : W.LeftFraction X Y) : ∃ (ψ : W.RightFraction X Y), ψ.s ≫ φ.f = ψ.f ≫ φ.s

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
[W.HasRightCalculusOfFractions]
{X Y : C}
(φ : W.LeftFraction X Y)

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


theorem eq_zero_of_subset_zero {s : Multiset α} (h : s ⊆ 0) : s = 0

{α : Type u_1}
{s : Multiset α}
(h : s ⊆ 0)


/-- Given a short exact complex `S` in `C` that is short exact (`hS`), this is the
canonical isomorphism between the triangle `hS.singleTriangle` in the derived category
and the triangle attached to the corresponding short exact sequence of cochain complexes
after the application of the single functor. -/
@[simps!]
noncomputable def singleTriangleIso :
    hS.singleTriangle ≅
      triangleOfSES (hS.map_of_exact (HomologicalComplex.single C (ComplexShape.up ℤ) 0))

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

hS.singleTriangleIso.hom.hom₃ = ((DerivedCategory.singleFunctorsPostcompQIso C).hom.hom 0).app S.X₃


theorem Chain.eq_nil_of_irrefl [IsTrans α r] [IsIrrefl α r] (h : Chain r s) : s = Cycle.nil

{α : Type u_1}
{r : α → α → Prop}
{s : Cycle α}
[IsTrans α r]
[IsIrrefl α r]
(h : Cycle.Chain r s)


/-- For primes `p`, `choose n k` is congruent to `choose (n % p) (k % p) * choose (n / p) (k / p)`
modulo `p`. Also see `choose_modEq_choose_mod_mul_choose_div` for the version with `ZMOD`. -/
theorem choose_modEq_choose_mod_mul_choose_div_nat :
    choose n k ≡ choose (n % p) (k % p) * choose (n / p) (k / p) [MOD p]

n.choose k ≡ (n % p).choose (k % p) * (n / p).choose (k / p) [MOD p]


@[simp]
theorem Ioc_pred_left (a b : α) : Ioc (pred a) b = Icc a b

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


@[to_additive]
theorem range_subset_insert_image_mulTSupport (f : X → α) :
    range f ⊆ insert 1 (f '' mulTSupport f)

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

Set.range f ⊆ insert 0 (f '' tsupport f)


lemma isIso_pi_iff {X Y : ∀ i, C i} (f : X ⟶ Y) :
    IsIso f ↔ ∀ i, IsIso (f i)

[(i : I) → CategoryTheory.Category.{v₁, u₁} (C i)]

CategoryTheory.IsIso f ↔ ∀ (i : I), CategoryTheory.IsIso (f i)


/-- If `α : G ⟶ H` then
`whisker_right α F : (G ⋙ F) ⟶ (G ⋙ F)` has components `F.map (α.app X)`.
-/
@[simps]
def whiskerRight {G H : C ⥤ D} (α : G ⟶ H) (F : D ⥤ E) :
    G ⋙ F ⟶ H ⋙ F

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

(CategoryTheory.whiskerRight α F).app X = F.map (α.app X)


theorem Fix.rec_eq {β : Type u} (g : F (append1 α β) → β) (x : F (append1 α (Fix F α))) :
    Fix.rec g (Fix.mk x) = g (appendFun id (Fix.rec g) <$$> x)

{n : ℕ}
{F : TypeVec.{u} (n + 1) → Type u}
[q : MvQPF F]
{α : TypeVec.{u} n}
{β : Type u}
(g : F (α ::: β) → β)
(x : F (α ::: MvQPF.Fix F α))

MvQPF.Fix.rec g (MvQPF.Fix.mk x) = g (MvFunctor.map (TypeVec.id ::: MvQPF.Fix.rec g) x)


theorem IsCompact.closure_of_subset {s K : Set X} (hK : IsCompact K) (h : s ⊆ K) :
    IsCompact (closure s)

{X : Type u_1}
[TopologicalSpace X]
[R1Space X]
{s K : Set X}
(hK : IsCompact K)
(h : s ⊆ K)


theorem isFixedPt_newtonMap_of_aeval_eq_zero (h : aeval x P = 0) :
    IsFixedPt P.newtonMap x

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Polynomial R}
{x : S}
(h : (Polynomial.aeval x) P = 0)


lemma cauchy_comap_uniformSpace {u : UniformSpace β} {f : α → β} {l : Filter α} :
    Cauchy (uniformSpace := comap f u) l ↔ Cauchy (map f l)

{α : Type u}
{β : Type v}
{u : UniformSpace β}
{f : α → β}
{l : Filter α}


@[to_additive]
theorem TendstoUniformly.div (hf : TendstoUniformly f g l) (hf' : TendstoUniformly f' g' l) :
    TendstoUniformly (f / f') (g / g') l

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]
{ι : Type u_3}
{l : Filter ι}
{f f' : ι → β → α}
{g g' : β → α}
(hf : TendstoUniformly f g l)
(hf' : TendstoUniformly f' g' l)


lemma eventually_one_add_smoothingFn_nonneg : ∀ᶠ (n : ℕ) in atTop, 0 ≤ 1 + ε n

∀ᶠ (n : ℕ) in Filter.atTop, 0 ≤ 1 + AkraBazziRecurrence.smoothingFn ↑n


/-- `WalkingParallelPair` as a category is equivalent to a special case of
`WalkingParallelFamily`.  -/
@[simps!]
def walkingParallelFamilyEquivWalkingParallelPair :
    WalkingParallelFamily.{w} (ULift Bool) ≌ WalkingParallelPair

CategoryTheory.Limits.walkingParallelFamilyEquivWalkingParallelPair.counitIso.inv.app X = CategoryTheory.eqToHom ⋯


@[to_additive (attr := simp)]
theorem comap_bot' (f : F) : (⊥ : Submonoid N).comap f = mker f

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_5}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
(f : F)

AddSubmonoid.comap f ⊥ = AddMonoidHom.mker f


lemma exact_and_mono_f_iff_of_iso (e : S₁ ≅ S₂) :
    S₁.Exact ∧ Mono S₁.f ↔ S₂.Exact ∧ Mono S₂.f

S₁.Exact ∧ CategoryTheory.Mono S₁.f ↔ S₂.Exact ∧ CategoryTheory.Mono S₂.f


/-- The type of homomorphisms between monoids with zero satisfying the characteristic predicate:
if `f : M →*₀ N` satisfies this predicate, then `N` is isomorphic to the localization of `M` at
`S`. -/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure LocalizationWithZeroMap extends LocalizationMap S N where
  map_zero' : toFun 0 = 0

{M : Type u_1}
[CommMonoidWithZero M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoidWithZero N]
(self : S.LocalizationWithZeroMap N)


theorem mem_range_iff_mem_finset_range_of_mod_eq [DecidableEq α] {f : ℤ → α} {a : α} {n : ℕ}
    (hn : 0 < n) (h : ∀ i, f (i % n) = f i) :
    a ∈ Set.range f ↔ a ∈ (Finset.range n).image (fun (i : ℕ) => f i)

{α : Type u_1}
[DecidableEq α]
{f : ℤ → α}
{a : α}
{n : ℕ}
(hn : 0 < n)
(h : ∀ (i : ℤ), f (i % ↑n) = f i)

a ∈ Set.range f ↔ a ∈ Finset.image (fun i => f ↑i) (Finset.range n)


@[simp]
theorem at_zero : legendreSym p 0 = 0


theorem exists_null_frontier_thickening (μ : Measure Ω) [SFinite μ] (s : Set Ω) {a b : ℝ}
    (hab : a < b) : ∃ r ∈ Ioo a b, μ (frontier (Metric.thickening r s)) = 0

{Ω : Type u_1}
[PseudoEMetricSpace Ω]
[MeasurableSpace Ω]
[OpensMeasurableSpace Ω]
(μ : MeasureTheory.Measure Ω)
[MeasureTheory.SFinite μ]
(s : Set Ω)
{a b : ℝ}
(hab : a < b)

∃ r ∈ Set.Ioo a b, μ (frontier (Metric.thickening r s)) = 0


@[simp]
theorem multichoose_zero_succ (k : ℕ) : multichoose (0 : R) (k + 1) = 0

{R : Type u_2}
[NonAssocSemiring R]
[Pow R ℕ]
[NatPowAssoc R]
[BinomialRing R]
(k : ℕ)


/-- The spectrum of a selfadjoint is real -/
theorem IsSelfAdjoint.val_re_map_spectrum [StarModule ℂ A] {a : A} (ha : IsSelfAdjoint a) :
    spectrum ℂ a = ((↑) ∘ re '' spectrum ℂ a : Set ℂ)

{A : Type u_1}
[NormedRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
[StarRing A]
[CstarRing A]
[StarModule ℂ A]
{a : A}
(ha : IsSelfAdjoint a)

spectrum ℂ a = Complex.ofReal' ∘ Complex.re '' spectrum ℂ a


theorem gc_count_nth (hp : (setOf p).Infinite) : GaloisConnection (count p) (nth p)

{p : ℕ → Prop}
[DecidablePred p]
(hp : (setOf p).Infinite)

GaloisConnection (Nat.count p) (Nat.nth p)


theorem tendsto_atTop_add_nonneg_left (hf : ∀ x, 0 ≤ f x) (hg : Tendsto g l atTop) :
    Tendsto (fun x => f x + g x) l atTop

{α : Type u_3}
{β : Type u_4}
[OrderedAddCommMonoid β]
{l : Filter α}
{f g : α → β}
(hf : ∀ (x : α), 0 ≤ f x)
(hg : Filter.Tendsto g l Filter.atTop)

Filter.Tendsto (fun x => f x + g x) l Filter.atTop


@[to_additive Set.AddAntidiagonal.finite_of_isWF]
theorem finite_of_isWF [LinearOrderedCancelCommMonoid α] {s t : Set α} (hs : s.IsWF) (ht : t.IsWF)
    (a) : (mulAntidiagonal s t a).Finite

{α : Type u_1}
[LinearOrderedCancelAddCommMonoid α]
{s t : Set α}
(hs : s.IsWF)
(ht : t.IsWF)
(a : α)


/-- If `y ∈ f.target` and `I y ∈ interior (range I)`,
  then `I y` is an interior point of `(I ∘ f).target`. -/
lemma mem_interior_extend_target {y : H} (hy : y ∈ f.target)
    (hy' : I y ∈ interior (range I)) : I y ∈ interior (f.extend I).target

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(f : PartialHomeomorph M H)
(I : ModelWithCorners 𝕜 E H)
{y : H}
(hy : y ∈ f.target)
(hy' : ↑I y ∈ interior (Set.range ↑I))


theorem mul_of_commute {p q : S} (h : Commute p q) (h₁ : IsIdempotentElem p)
    (h₂ : IsIdempotentElem q) : IsIdempotentElem (p * q)

{S : Type u_3}
[Semigroup S]
{p q : S}
(h : Commute p q)
(h₁ : IsIdempotentElem p)
(h₂ : IsIdempotentElem q)


/-- The canonical (semi)ring isomorphism from `Rᵐᵒᵖ` to `Module.End R R` induced by the right
multiplication. -/
@[simps]
def moduleEndSelf : Rᵐᵒᵖ ≃+* Module.End R R

(R : Type u_1)
[Semiring R]
(f : Module.End R R)

(Module.moduleEndSelf R).symm f = MulOpposite.op (f 1)


theorem defn (f : PadicSeq p) {ε : ℚ} (hε : 0 < ε) :
    ∃ N, ∀ i ≥ N, padicNormE (Padic.mk f - f i : ℚ_[p]) < ε

{p : ℕ}
[Fact (Nat.Prime p)]
(f : PadicSeq p)
{ε : ℚ}
(hε : 0 < ε)

∃ N, ∀ i ≥ N, padicNormE (Padic.mk f - ↑(↑f i)) < ε


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

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


theorem get_ofFn {n} (f : Fin n → α) (i) : get (ofFn f) i = f (Fin.cast (by simp) i)

{α : Type u}
{n : ℕ}
(f : Fin n → α)
(i : Fin (List.ofFn f).length)


theorem continuousOn_boolIndicator_iff_isClopen (s U : Set X) :
    ContinuousOn U.boolIndicator s ↔ IsClopen (((↑) : s → X) ⁻¹' U)

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

ContinuousOn U.boolIndicator s ↔ IsClopen (Subtype.val ⁻¹' U)


@[simp, mfld_simps]
theorem trans_refl : e.trans (PartialHomeomorph.refl Y) = e

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


theorem LeftInverse.comp {f : α → β} {g : β → α} {h : β → γ} {i : γ → β} (hf : LeftInverse f g)
    (hh : LeftInverse h i) : LeftInverse (h ∘ f) (g ∘ i)

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{f : α → β}
{g : β → α}
{h : β → γ}
{i : γ → β}
(hf : Function.LeftInverse f g)
(hh : Function.LeftInverse h i)


@[simp]
theorem coeff_zero (m : σ →₀ ℕ) : coeff m (0 : MvPolynomial σ R) = 0

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(m : σ →₀ ℕ)


/-- Eigenvalues of a diagonal linear operator are the diagonal entries. -/
lemma hasEigenvalue_toLin_diagonal_iff (d : n → R) {μ : R} [NoZeroSMulDivisors R M]
    (b : Basis n R M) : HasEigenvalue (toLin b b (diagonal d)) μ ↔ ∃ i, d i = μ

{R : Type u_1}
{n : Type u_2}
{M : Type u_3}
[DecidableEq n]
[Fintype n]
[CommRing R]
[Nontrivial R]
[AddCommGroup M]
[Module R M]
(d : n → R)
{μ : R}
[NoZeroSMulDivisors R M]
(b : Basis n R M)

Module.End.HasEigenvalue ((Matrix.toLin b b) (Matrix.diagonal d)) μ ↔ ∃ i, d i = μ


@[simp] theorem min_none_none [Min α] : min (none : Option α) none = none


theorem restrict_le_restrict_iUnion {f : ℕ → Set α} (hf₁ : ∀ n, MeasurableSet (f n))
    (hf₂ : ∀ n, v ≤[f n] w) : v ≤[⋃ n, f n] w

(hf₂ : ∀ (n : ℕ), v.restrict (f n) ≤ w.restrict (f n))

v.restrict (⋃ n, f n) ≤ w.restrict (⋃ n, f n)


@[simp]
theorem not_nonempty_iff : ¬Nonempty α ↔ IsEmpty α


lemma exact_and_epi_g_iff_g_is_cokernel [S.HasHomology] :
    S.Exact ∧ Epi S.g ↔ Nonempty (IsColimit (CokernelCofork.ofπ S.g S.zero))

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
(S : CategoryTheory.ShortComplex C)
[CategoryTheory.Balanced C]
[S.HasHomology]

S.Exact ∧ CategoryTheory.Epi S.g ↔
  Nonempty (CategoryTheory.Limits.IsColimit (CategoryTheory.Limits.CokernelCofork.ofπ S.g ⋯))


@[to_additive]
theorem tendsto_prod [Monoid α] [ContinuousMul α] {l : List α} :
    Tendsto List.prod (𝓝 l) (𝓝 l.prod)

{α : Type u_1}
[TopologicalSpace α]
[Monoid α]
[ContinuousMul α]
{l : List α}

Filter.Tendsto List.prod (𝓝 l) (𝓝 l.prod)


theorem monomial_add_erase (p : R[X]) (n : ℕ) : monomial n (coeff p n) + p.erase n = p

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

(Polynomial.monomial n) (p.coeff n) + Polynomial.erase n p = p


theorem smeval_natCast (n : ℕ) : (n : R[X]).smeval x = n • x ^ 0

(R : Type u_1)
[Semiring R]
{S : Type u_2}
[AddCommMonoid S]
[Pow S ℕ]
[Module R S]
(x : S)
(n : ℕ)


theorem InvImage.irreflexive (f : α → β) (h : Irreflexive r) : Irreflexive (InvImage r f)

{α : Sort u}
{β : Sort v}
(r : β → β → Prop)
(f : α → β)
(h : Irreflexive r)


@[simp, norm_cast] lemma coe_sub [SubNegZeroMonoid G] (g₁ g₂ : α →₀ G) : ⇑(g₁ - g₂) = g₁ - g₂

{α : Type u_1}
{G : Type u_9}
[SubNegZeroMonoid G]
(g₁ g₂ : α →₀ G)


theorem mem_sSup {s : Set (Submodule R M)} {m : M} :
    (m ∈ sSup s) ↔ ∀ N, (∀ p ∈ s, p ≤ N) → m ∈ N

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{s : Set (Submodule R M)}
{m : M}

m ∈ sSup s ↔ ∀ (N : Submodule R M), (∀ p ∈ s, p ≤ N) → m ∈ N


theorem xz_succ_succ (n) : xz a1 (n + 2) = (2 * a : ℕ) * xz a1 (n + 1) - xz a1 n

Pell.xz a1 (n + 2) = ↑(2 * a) * Pell.xz a1 (n + 1) - Pell.xz a1 n


theorem orderTop_le_of_coeff_ne_zero {Γ} [LinearOrder Γ] {x : HahnSeries Γ R}
    {g : Γ} (h : x.coeff g ≠ 0) : x.orderTop ≤ g

{R : Type u_2}
[Zero R]
{Γ : Type u_3}
[LinearOrder Γ]
{x : HahnSeries Γ R}
{g : Γ}
(h : x.coeff g ≠ 0)


@[to_additive]
theorem comap_inf (H K : Subgroup N) (f : G →* N) : (H ⊓ K).comap f = H.comap f ⊓ K.comap f

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(H K : Subgroup N)
(f : G →* N)

Subgroup.comap f (H ⊓ K) = Subgroup.comap f H ⊓ Subgroup.comap f K


@[simp]
theorem comp_smulₛₗ [SMulCommClass R₂ R₂ M₂] [SMulCommClass R₃ R₃ M₃] [ContinuousConstSMul R₂ M₂]
    [ContinuousConstSMul R₃ M₃] (h : M₂ →SL[σ₂₃] M₃) (c : R₂) (f : M →SL[σ₁₂] M₂) :
    h.comp (c • f) = σ₂₃ c • h.comp f

{R : Type u_1}
{R₂ : Type u_2}
{R₃ : Type u_3}
[Semiring R]
[Semiring R₂]
[Semiring R₃]
{M : Type u_6}
[TopologicalSpace M]
[AddCommMonoid M]
[Module R M]
{M₂ : Type u_7}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
{M₃ : Type u_8}
[TopologicalSpace M₃]
[AddCommMonoid M₃]
[Module R₃ M₃]
{σ₁₂ : R →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R →+* R₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
[SMulCommClass R₂ R₂ M₂]
[SMulCommClass R₃ R₃ M₃]
[ContinuousConstSMul R₂ M₂]
[ContinuousConstSMul R₃ M₃]
(h : M₂ →SL[σ₂₃] M₃)
(c : R₂)
(f : M →SL[σ₁₂] M₂)


theorem BijOn.image_eq (h : BijOn f s t) : f '' s = t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
(h : Set.BijOn f s t)


theorem coe_injective : Function.Injective ((↑) : (P₁ ≃ᵃL[k] P₂) → P₁ ≃ᵃ[k] P₂)

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AddTorsor V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AddTorsor V₂ P₂]
[TopologicalSpace P₁]
[TopologicalSpace P₂]


theorem Disjoint.ndunion_eq {s t : Multiset α} (h : Disjoint s t) :
    s.ndunion t = s.dedup + t

{α : Type u_1}
[DecidableEq α]
{s t : Multiset α}
(h : s.Disjoint t)


/-- Under the isomorphisms `stalkIso`, the map `stalkMap (Spec.sheafedSpaceMap f) p` corresponds
to the induced local ring homomorphism `Localization.localRingHom`.
-/
@[elementwise]
theorem localRingHom_comp_stalkIso {R S : CommRingCat.{u}} (f : R ⟶ S) (p : PrimeSpectrum S) :
    (stalkIso R (PrimeSpectrum.comap f p)).hom ≫
        @CategoryStruct.comp _ _
          (CommRingCat.of (Localization.AtPrime (PrimeSpectrum.comap f p).asIdeal))
          (CommRingCat.of (Localization.AtPrime p.asIdeal)) _
          (Localization.localRingHom (PrimeSpectrum.comap f p).asIdeal p.asIdeal f rfl)
          (stalkIso S p).inv =
      (Spec.sheafedSpaceMap f).stalkMap p

{R S : CommRingCat}
(f : R ⟶ S)
(p : PrimeSpectrum ↑S)

CategoryTheory.CategoryStruct.comp (AlgebraicGeometry.StructureSheaf.stalkIso (↑R) ((PrimeSpectrum.comap f) p)).hom
    (CategoryTheory.CategoryStruct.comp (Localization.localRingHom ((PrimeSpectrum.comap f) p).asIdeal p.asIdeal f ⋯)
      (AlgebraicGeometry.StructureSheaf.stalkIso (↑S) p).inv) =
  AlgebraicGeometry.PresheafedSpace.Hom.stalkMap (AlgebraicGeometry.Spec.sheafedSpaceMap f) p


theorem BijOn.mapsTo (h : BijOn f s t) : MapsTo f s t


theorem isRoot_cyclotomic_iff [NeZero (n : R)] {μ : R} :
    IsRoot (cyclotomic n R) μ ↔ IsPrimitiveRoot μ n

{R : Type u_1}
[CommRing R]
{n : ℕ}
[IsDomain R]
[NeZero ↑n]
{μ : R}

(Polynomial.cyclotomic n R).IsRoot μ ↔ IsPrimitiveRoot μ n


/-- If `m` and `n` are `Fintype`, the finrank of `m × n` matrices is
  `(Fintype.card m) * (Fintype.card n)`. -/
theorem finrank_matrix (m n : Type*) [Fintype m] [Fintype n] :
    finrank R (Matrix m n R) = card m * card n

(R : Type u)
[Ring R]
[StrongRankCondition R]
(m : Type u_2)
(n : Type u_3)
[Fintype m]
[Fintype n]

FiniteDimensional.finrank R (Matrix m n R) = Fintype.card m * Fintype.card n


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

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

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


theorem infs_assoc : s ⊼ t ⊼ u = s ⊼ (t ⊼ u)

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


theorem Applicative.pure_seq_eq_map' (f : α → β) : ((pure f : F (α → β)) <*> ·) = (f <$> ·)

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

(fun x => Seq.seq (pure f) fun x_1 => x) = fun x => f <$> x


theorem IsCycle.cycleFactorsFinset_eq_singleton {f : Perm α} (hf : IsCycle f) :
    f.cycleFactorsFinset = {f}

{α : Type u_2}
[DecidableEq α]
[Fintype α]
{f : Equiv.Perm α}
(hf : f.IsCycle)


/-- In a completely regular T0 topological space, the inverse of `diracProbaEquiv` is continuous. -/
lemma continuous_diracProbaEquivSymm [T0Space X] [CompletelyRegularSpace X] :
    Continuous (diracProbaEquiv (X := X)).symm

{X : Type u_1}
[MeasurableSpace X]
[TopologicalSpace X]
[OpensMeasurableSpace X]
[T0Space X]
[CompletelyRegularSpace X]


/-- Any three points in a cospherical set are affinely independent. -/
theorem Cospherical.affineIndependent {s : Set P} (hs : Cospherical s) {p : Fin 3 → P}
    (hps : Set.range p ⊆ s) (hpi : Function.Injective p) : AffineIndependent ℝ p

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{s : Set P}
(hs : EuclideanGeometry.Cospherical s)
{p : Fin 3 → P}
(hps : Set.range p ⊆ s)
(hpi : Function.Injective p)


/-- A set `s` is a *sublattice* if `a ⊔ b ∈ s` and `a ⊓ b ∈ s` for all `a ∈ s`, `b ∈ s`.
Note: This is not the preferred way to declare a sublattice. One should instead use `Sublattice`.
TODO: Define `Sublattice`. -/
structure IsSublattice (s : Set α) : Prop where
  supClosed : SupClosed s
  infClosed : InfClosed s

{α : Type u_2}
[Lattice α]
{s : Set α}
(self : IsSublattice s)


/-- If `K / E / F` is a field extension tower, such that `E / F` is algebraic, then their
separable degrees satisfy the tower law: $[E:F]_s [K:E]_s = [K:F]_s$. -/
theorem lift_sepDegree_mul_lift_sepDegree_of_isAlgebraic [Algebra.IsAlgebraic F E] :
    Cardinal.lift.{w} (sepDegree F E) * Cardinal.lift.{v} (sepDegree E K) =
    Cardinal.lift.{v} (sepDegree F K)

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

Cardinal.lift.{w, v} (Field.sepDegree F E) * Cardinal.lift.{v, w} (Field.sepDegree E K) =
  Cardinal.lift.{v, w} (Field.sepDegree F K)


theorem kstar_le_of_mul_le_left (hb : 1 ≤ b) : b * a ≤ b → a∗ ≤ b

{α : Type u_1}
[KleeneAlgebra α]
{a b : α}
(hb : 1 ≤ b)


theorem Spec.sheafedSpaceMap_comp {R S T : CommRingCat.{u}} (f : R ⟶ S) (g : S ⟶ T) :
    Spec.sheafedSpaceMap (f ≫ g) = Spec.sheafedSpaceMap g ≫ Spec.sheafedSpaceMap f

{R S T : CommRingCat}
(f : R ⟶ S)
(g : S ⟶ T)

AlgebraicGeometry.Spec.sheafedSpaceMap (CategoryTheory.CategoryStruct.comp f g) =
  CategoryTheory.CategoryStruct.comp (AlgebraicGeometry.Spec.sheafedSpaceMap g)
    (AlgebraicGeometry.Spec.sheafedSpaceMap f)


/-- Class of Id maps -/
class IsId (σ : M →* M) : Prop where
  eq_id : σ = MonoidHom.id M

{M : Type u_2}
[Monoid M]
{σ : M →* M}
[self : MonoidHom.CompTriple.IsId σ]


theorem isPreconnected_Ioo : IsPreconnected (Ioo a b)

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{a b : α}


@[simp]
theorem length_map : (p.map f).length = p.length

{V : Type u}
{V' : Type v}
{G : SimpleGraph V}
{G' : SimpleGraph V'}
(f : G →g G')
{u v : V}
(p : G.Walk u v)

(SimpleGraph.Walk.map f p).length = p.length


theorem length_add_eq_lengthTRAux (as : List α) (n : Nat) : as.length + n = as.lengthTRAux n


theorem finrank_span_le_card (s : Set M) [Fintype s] : finrank R (span R s) ≤ s.toFinset.card

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[StrongRankCondition R]
(s : Set M)
[Fintype ↑s]

FiniteDimensional.finrank R ↥(Submodule.span R s) ≤ s.toFinset.card


@[simp] lemma op_zero [Zero α] : op (0 : α) = 0


/-- If `f : ℂ → E` is complex differentiable on some open set `s`, then it is continuously
differentiable on `s`. -/
protected theorem _root_.DifferentiableOn.contDiffOn {s : Set ℂ} {f : ℂ → E} {n : ℕ}
    (hd : DifferentiableOn ℂ f s) (hs : IsOpen s) : ContDiffOn ℂ n f s

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
[CompleteSpace E]
{s : Set ℂ}
{f : ℂ → E}
{n : ℕ}
(hd : DifferentiableOn ℂ f s)
(hs : IsOpen s)


theorem smoothRightMul_one : (𝑹 I g') 1 = g'

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
(I : ModelWithCorners 𝕜 E H)
{G' : Type u_8}
[Monoid G']
[TopologicalSpace G']
[ChartedSpace H G']
[SmoothMul I G']
(g' : G')


@[simp]
theorem irrational_int_mul_iff : Irrational (m * x) ↔ m ≠ 0 ∧ Irrational x

Irrational (↑m * x) ↔ m ≠ 0 ∧ Irrational x


@[deprecated measure_union_le (since := "2024-05-14")]
protected theorem union (m : OuterMeasure α) (s₁ s₂ : Set α) : m (s₁ ∪ s₂) ≤ m s₁ + m s₂

{α : Type u_1}
(m : MeasureTheory.OuterMeasure α)
(s₁ s₂ : Set α)


theorem mem_support_onFinset {s : Finset α} {f : α → M} (hf : ∀ a : α, f a ≠ 0 → a ∈ s) {a : α} :
    a ∈ (Finsupp.onFinset s f hf).support ↔ f a ≠ 0

{α : Type u_1}
{M : Type u_5}
[Zero M]
{s : Finset α}
{f : α → M}
(hf : ∀ (a : α), f a ≠ 0 → a ∈ s)
{a : α}


theorem IsRat.neg_to_eq {α} [DivisionRing α] {n d} :
    {a n' d' : α} → IsRat a (.negOfNat n) d → n = n' → d = d' → a = -(n' / d')

{α : Type u_1}
[DivisionRing α]
{n d : ℕ}
{a n' d' : α}

Mathlib.Meta.NormNum.IsRat a (Int.negOfNat n) d → ↑n = n' → ↑d = d' → a = -(n' / d')


/-- Right unit cancellation `X ⊗ 1 ≅ X` in `Dial C`. -/
@[simps!] def rightUnitor (X : Dial C) : tensorObj X tensorUnit ≅ X


lemma isCrystallographic_iff :
    P.IsCrystallographic ↔ ∀ i j, ∃ z : ℤ, z = P.pairing i j

{ι : 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)

P.IsCrystallographic ↔ ∀ (i j : ι), ∃ z, ↑z = P.pairing i j


theorem IsOpen.subset_interior_closure {s : Set X} (s_open : IsOpen s) :
    s ⊆ interior (closure s)

{X : Type u}
[TopologicalSpace X]
{s : Set X}
(s_open : IsOpen s)


/-- A uniform group is a group in which multiplication and inversion are uniformly continuous. -/
class UniformGroup (α : Type*) [UniformSpace α] [Group α] : Prop where
  uniformContinuous_div : UniformContinuous fun p : α × α => p.1 / p.2

{α : Type u_3}
[UniformSpace α]
[Group α]
[self : UniformGroup α]


@[to_additive]
theorem BddBelow.inv (h : BddBelow s) : BddAbove s⁻¹

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

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


theorem mem_divisors_prime_pow {p : ℕ} (pp : p.Prime) (k : ℕ) {x : ℕ} :
    x ∈ divisors (p ^ k) ↔ ∃ j ≤ k, x = p ^ j

{p : ℕ}
(pp : Nat.Prime p)
(k : ℕ)
{x : ℕ}

x ∈ (p ^ k).divisors ↔ ∃ j ≤ k, x = p ^ j


@[simp]
theorem closure_setOf_im_lt (a : ℝ) : closure { z : ℂ | z.im < a } = { z | z.im ≤ a }


protected theorem continuousAt {x : E} {I : Type*} [TopologicalSpace I]
    (h : IsEvenlyCovered f (f x) I) : ContinuousAt f x

{E : Type u_1}
{X : Type u_2}
[TopologicalSpace E]
[TopologicalSpace X]
{f : E → X}
{x : E}
{I : Type u_3}
[TopologicalSpace I]
(h : IsEvenlyCovered f (f x) I)


theorem IsMin.fst (hx : IsMin x) : IsMin x.1

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{x : α × β}
(hx : IsMin x)


lemma iff_of_ladder_addEquiv (comm₁₂ : g₁₂.comp e₁ = AddMonoidHom.comp e₂ f₁₂)
    (comm₂₃ : g₂₃.comp e₂ = AddMonoidHom.comp e₃ f₂₃) : Exact g₁₂ g₂₃ ↔ Exact f₁₂ f₂₃

(comm₁₂ : g₁₂.comp ↑e₁ = (↑e₂).comp f₁₂)

(comm₂₃ : g₂₃.comp ↑e₂ = (↑e₃).comp f₂₃)

Function.Exact ⇑g₁₂ ⇑g₂₃ ↔ Function.Exact ⇑f₁₂ ⇑f₂₃


theorem biInter_eq_iInter (s : Set α) (t : ∀ x ∈ s, Set β) :
    ⋂ x ∈ s, t x ‹_› = ⋂ x : s, t x x.2

{α : Type u_1}
{β : Type u_2}
(s : Set α)
(t : (x : α) → x ∈ s → Set β)


@[to_additive]
theorem smul_mem_fixedBy_iff_mem_fixedBy {a : α} {g : G} :
    g • a ∈ fixedBy α g ↔ a ∈ fixedBy α g

{α : Type u_1}
{G : Type u_2}
[Group G]
[MulAction G α]
{a : α}
{g : G}

g • a ∈ MulAction.fixedBy α g ↔ a ∈ MulAction.fixedBy α g


theorem map_eval₂Hom [CommSemiring S₂] (f : R →+* S₁) (g : σ → S₁) (φ : S₁ →+* S₂)
    (p : MvPolynomial σ R) : φ (eval₂Hom f g p) = eval₂Hom (φ.comp f) (fun i => φ (g i)) p

{R : Type u}
{S₁ : Type v}
{S₂ : Type w}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
[CommSemiring S₂]
(f : R →+* S₁)
(g : σ → S₁)
(φ : S₁ →+* S₂)
(p : MvPolynomial σ R)

φ ((MvPolynomial.eval₂Hom f g) p) = (MvPolynomial.eval₂Hom (φ.comp f) fun i => φ (g i)) p


/-- Order isomorphism between `α` considered as a Boolean ring considered as a Boolean algebra and
`α`. -/
@[simps!]
def OrderIso.asBoolAlgAsBoolRing (α : Type*) [BooleanAlgebra α] : AsBoolAlg (AsBoolRing α) ≃o α

∀ (a : α), (RelIso.symm (OrderIso.asBoolAlgAsBoolRing α)) a = toBoolAlg (toBoolRing a)


@[simp]
theorem range_algebraMap {R A : Type*} [CommRing R] [CommRing A] [Algebra R A]
    (S : Subalgebra R A) : (algebraMap S A).range = S.toSubring

{R : Type u_3}
{A : Type u_4}
[CommRing R]
[CommRing A]
[Algebra R A]
(S : Subalgebra R A)


@[to_additive]
theorem coe_subgroupOf (H K : Subgroup G) : (H.subgroupOf K : Set K) = K.subtype ⁻¹' H

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


theorem closure_isCycle : closure { σ : Perm β | IsCycle σ } = ⊤


theorem diagonalSucc_inv_single_single (g : G) (f : Gⁿ) (a b : k) :
    (diagonalSucc k G n).inv.hom (Finsupp.single g a ⊗ₜ Finsupp.single f b) =
      single (g • partialProd f) (a * b)

{k G : Type u}
[CommRing k]
{n : ℕ}
[Group G]
(g : G)
(f : Fin n → G)
(a b : k)

(groupCohomology.resolution.diagonalSucc k G n).inv.hom (Finsupp.single g a ⊗ₜ[k] Finsupp.single f b) =
  Finsupp.single (g • Fin.partialProd f) (a * b)


/-- The functor which sends `[n]` to the simplicial set `Δ[n]` equipped by
the obvious augmentation towards the terminal object of the category of sets. -/
@[simps]
noncomputable def standardSimplex : SimplexCategory ⥤ SSet.Augmented.{u}

(SSet.Augmented.standardSimplex.obj Δ).left = SSet.standardSimplex.obj Δ


@[reassoc (attr := simp)]
theorem PInfty_comp_QInfty : (PInfty : K[X] ⟶ _) ≫ QInfty = 0

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{X : CategoryTheory.SimplicialObject C}

AlgebraicTopology.DoldKan.PInfty ≫ AlgebraicTopology.DoldKan.QInfty = 0


/-- If `α` is an infinite type, then `α ⊕ α` and `α` have the same cardinality. -/
theorem add_eq_self {c : Cardinal} (h : ℵ₀ ≤ c) : c + c = c


theorem toAlternatingMap_injective :
    Injective (toAlternatingMap : (M [⋀^ι]→L[R] N) → (M [⋀^ι]→ₗ[R] N))

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{ι : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]


theorem iCondIndepSet.iCondIndepFun_indicator [Zero β] [One β] {m : MeasurableSpace β}
    {s : ι → Set Ω} (hs : iCondIndepSet m' hm' s μ) :
    iCondIndepFun m' hm' (fun _n => m) (fun n => (s n).indicator fun _ω => 1) μ

(hs : ProbabilityTheory.iCondIndepSet m' hm' s μ)

ProbabilityTheory.iCondIndepFun m' hm' (fun _n => m) (fun n => (s n).indicator fun _ω => 1) μ


@[to_additive (attr := simp)] lemma prod_inv_index [InvolutiveInv ι] (s : Finset ι) (f : ι → α) :
    ∏ i ∈ s⁻¹, f i = ∏ i ∈ s, f i⁻¹

{α : Type u_2}
[AddCommMonoid α]
{ι : Type u_5}
[DecidableEq ι]
[InvolutiveNeg ι]
(s : Finset ι)
(f : ι → α)


theorem exists_floor (x : α) : ∃ fl : ℤ, ∀ z : ℤ, z ≤ fl ↔ (z : α) ≤ x

{α : Type u_1}
[StrictOrderedRing α]
[Archimedean α]
(x : α)


protected theorem sub {B₁ B₂ : BilinForm R₁ M₁} (hB₁ : B₁.IsSymm) (hB₂ : B₂.IsSymm) :
    (B₁ - B₂).IsSymm

{R₁ : Type u_3}
{M₁ : Type u_4}
[CommRing R₁]
[AddCommGroup M₁]
[Module R₁ M₁]
{B₁ B₂ : LinearMap.BilinForm R₁ M₁}
(hB₁ : B₁.IsSymm)
(hB₂ : B₂.IsSymm)


theorem inv_sub_inv {a b : K} (ha : a ≠ 0) (hb : b ≠ 0) : a⁻¹ - b⁻¹ = (b - a) / (a * b)

{K : Type u_3}
[Field K]
{a b : K}
(ha : a ≠ 0)
(hb : b ≠ 0)


@[simp] theorem eraseIdx_nil : ([] : List α).eraseIdx i = []


@[to_additive]
protected theorem div_le_div : f₁ ≤ f₂ → g₁ ≤ g₂ → f₁ / g₁ ≤ f₂ / g₂

{α : Type u_2}
[Div α]
{f₁ f₂ g₁ g₂ : Filter α}

f₁ ≤ f₂ → g₁ ≤ g₂ → f₁ / g₁ ≤ f₂ / g₂