/-- Lower bound for `γ`. (The true value is about 0.57.) -/
lemma one_half_lt_eulerMascheroniConstant : 1 / 2 < eulerMascheroniConstant


@[to_additive]
theorem image_mulSingle_Ioo_right (i : ι) (b : α i) :
    Pi.mulSingle i '' Ioo 1 b = Ioo 1 (Pi.mulSingle i b)

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → PartialOrder (α i)]
[(i : ι) → Zero (α i)]
(i : ι)
(b : α i)

Pi.single i '' Set.Ioo 0 b = Set.Ioo 0 (Pi.single i b)


/-- The Weierstrass curve mapped over a ring homomorphism `φ : R →+* A`. -/
@[simps]
def map : WeierstrassCurve A

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
{A : Type v}
[CommRing A]
(φ : R →+* A)


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


theorem not_differentiableAt_abs_zero : ¬ DifferentiableAt ℝ (abs : ℝ → ℝ) 0


theorem comap_comp {S₁ : Type*} {S₂ : Type*} [Ring S₁] [Ring S₂] (f : S₁ →+* S₂) (g : S₂ →+* R) :
    v.comap (g.comp f) = (v.comap g).comap f

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedCommMonoidWithZero Γ₀]
(v : Valuation R Γ₀)
{S₁ : Type u_7}
{S₂ : Type u_8}
[Ring S₁]
[Ring S₂]
(f : S₁ →+* S₂)
(g : S₂ →+* R)

Valuation.comap (g.comp f) v = Valuation.comap f (Valuation.comap g v)


@[reassoc (attr := simp)]
lemma associator_inv_fst (X Y Z : C) :
    (α_ X Y Z).inv ≫ fst _ _ ≫ fst _ _ = fst _ _

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator X Y Z).inv
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.ChosenFiniteProducts.fst (CategoryTheory.MonoidalCategory.tensorObj X Y) Z)
      (CategoryTheory.ChosenFiniteProducts.fst X Y)) =
  CategoryTheory.ChosenFiniteProducts.fst X (CategoryTheory.MonoidalCategory.tensorObj Y Z)


theorem not_mem_bitIndices_self (n : ℕ) : n ∉ n.bitIndices


theorem biInter_subset_biInter_left {s s' : Set α} {t : α → Set β} (h : s' ⊆ s) :
    ⋂ x ∈ s, t x ⊆ ⋂ x ∈ s', t x

{α : Type u_1}
{β : Type u_2}
{s s' : Set α}
{t : α → Set β}
(h : s' ⊆ s)


theorem indefiniteDiagonal_assoc :
    indefiniteDiagonal (Unit ⊕ l) l R =
      Matrix.reindexLieEquiv (Equiv.sumAssoc Unit l l).symm
        (Matrix.fromBlocks 1 0 0 (indefiniteDiagonal l l R))

(l : Type u_4)
(R : Type u₂)
[DecidableEq l]
[CommRing R]
[Fintype l]

LieAlgebra.Orthogonal.indefiniteDiagonal (Unit ⊕ l) l R =
  (Matrix.reindexLieEquiv (Equiv.sumAssoc Unit l l).symm)
    (Matrix.fromBlocks 1 0 0 (LieAlgebra.Orthogonal.indefiniteDiagonal l l R))


theorem abs_sub_le (a b c : α) : |a - c| ≤ |a - b| + |b - c|

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


theorem isInt_zpow_pos {α : Type*} [DivisionRing α] {a : α} {b : ℤ} {nb ne : ℕ}
    (pb : IsNat b nb) (pe' : IsInt (a ^ nb) (Int.negOfNat ne)) :
    IsInt (a ^ b) (Int.negOfNat ne)

(pe' : Mathlib.Meta.NormNum.IsInt (a ^ nb) (Int.negOfNat ne))

Mathlib.Meta.NormNum.IsInt (a ^ b) (Int.negOfNat ne)


@[simp] lemma length_tail_add_one {p : G.Walk x y} (hp : ¬ p.Nil) :
    (p.tail hp).length + 1 = p.length

{V : Type u}
{G : SimpleGraph V}
{x y : V}
{p : G.Walk x y}
(hp : ¬p.Nil)


theorem mul_add_one [LeftDistribClass α] (a b : α) : a * (b + 1) = a * b + a

{α : Type u}
[Add α]
[MulOneClass α]
[LeftDistribClass α]
(a b : α)


theorem coe_transferFunction (q : G ⧸ H) : ↑(transferFunction H g q) = q

{G : Type u}
[Group G]
(H : Subgroup G)
(g : G)
(q : G ⧸ H)


theorem mdifferentiableAt_atlas (h : e ∈ atlas H M) {x : M} (hx : x ∈ e.source) :
    MDifferentiableAt I I e x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{e : PartialHomeomorph M H}
(h : e ∈ atlas H M)
{x : M}
(hx : x ∈ e.source)


@[to_additive]
theorem exponent_dvd_iff_forall_pow_eq_one {n : ℕ} : exponent G ∣ n ↔ ∀ g : G, g ^ n = 1

Monoid.exponent G ∣ n ↔ ∀ (g : G), g ^ n = 1


run_cmd
  for typeName' in [`UInt8, `UInt16, `UInt32, `UInt64, `USize] do
  let typeName := Lean.mkIdent typeName'
  Lean.Elab.Command.elabCommand (← `(
    namespace $typeName
      instance neZero : NeZero size := ⟨by decide⟩

      instance : Neg $typeName where
        neg a := mk (-a.val)

      instance : Pow $typeName ℕ where
        pow a n := mk (a.val ^ n)

      instance : SMul ℕ $typeName where
        smul n a := mk (n • a.val)

      instance : SMul ℤ $typeName where
        smul z a := mk (z • a.val)

      lemma neg_def (a : $typeName) : -a = ⟨-a.val⟩ := rfl

      lemma pow_def (a : $typeName) (n : ℕ) : a ^ n = ⟨a.val ^ n⟩ := rfl

      lemma nsmul_def (n : ℕ) (a : $typeName) : n • a = ⟨n • a.val⟩ := rfl

      lemma zsmul_def (z : ℤ) (a : $typeName) : z • a = ⟨z • a.val⟩ := rfl

      open $typeName (eq_of_val_eq) in
      lemma val_injective : Function.Injective val := @eq_of_val_eq

      instance instCommMonoid : CommMonoid $typeName :=
        Function.Injective.commMonoid val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl)

      instance instNonUnitalCommRing : NonUnitalCommRing $typeName :=
        Function.Injective.nonUnitalCommRing val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl)

      local instance instNatCast : NatCast $typeName where
        natCast n := mk n

      local instance instIntCast : IntCast $typeName where
        intCast z := mk z

      lemma natCast_def (n : ℕ) : (n : $typeName) = ⟨n⟩ := rfl

      lemma intCast_def (z : ℤ) : (z : $typeName) = ⟨z⟩ := rfl

      local instance instCommRing : CommRing $typeName :=
        Function.Injective.commRing val val_injective
          rfl rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ => rfl)

      namespace CommRing
      attribute [scoped instance] instCommRing instNatCast instIntCast
      end CommRing

    end $typeName
  ))
  -- interpolating docstrings above is more trouble than it's worth
  let docString :=
    s!"To use this instance, use `open scoped {typeName'}.CommRing`.\n\n" ++
    "See the module docstring for an explanation"
  Lean.addDocString (typeName'.mkStr "instCommRing") docString
  Lean.addDocString (typeName'.mkStr "instNatCast") docString
  Lean.addDocString (typeName'.mkStr "instIntCast") docString


theorem piPremeasure_pi {s : ∀ i, Set (α i)} (hs : (pi univ s).Nonempty) :
    piPremeasure m (pi univ s) = ∏ i, m i (s i)

{m : (i : ι) → MeasureTheory.OuterMeasure (α i)}

MeasureTheory.piPremeasure m (Set.univ.pi s) = ∏ i : ι, (m i) (s i)


@[simp]
theorem comp_codRestrict (f : M ↪[L] N) (g : N ↪[L] P) (p : L.Substructure P) (h : ∀ b, g b ∈ p) :
    ((codRestrict p g h).comp f : M ↪[L] p) = codRestrict p (g.comp f) fun _ => h _

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
{P : Type u_2}
[L.Structure M]
[L.Structure N]
[L.Structure P]
(f : L.Embedding M N)
(g : L.Embedding N P)
(p : L.Substructure P)
(h : ∀ (b : N), g b ∈ p)

(FirstOrder.Language.Embedding.codRestrict p g h).comp f = FirstOrder.Language.Embedding.codRestrict p (g.comp f) ⋯


@[continuity]
theorem Continuous.prod_map {f : Z → X} {g : W → Y} (hf : Continuous f) (hg : Continuous g) :
    Continuous fun p : Z × W => (f p.1, g p.2)

{X : Type u}
{Y : Type v}
{Z : Type u_1}
{W : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
[TopologicalSpace W]
{f : Z → X}
{g : W → Y}
(hf : Continuous f)
(hg : Continuous g)


lemma antitone_iff_apply₂ : Antitone f ↔ ∀ i, Antitone (f · i)

{ι : Type u_4}
{α : Type u_5}
{β : ι → Type u_6}
[(i : ι) → Preorder (β i)]
[Preorder α]
{f : α → (i : ι) → β i}

Antitone f ↔ ∀ (i : ι), Antitone fun x => f x i


theorem get_extract_loop_ge (as bs : Array α) (size start : Nat) (hge : i ≥ bs.size)
    (h : i < (extract.loop as size start bs).size)
    (h' := get_extract_loop_ge_aux as bs size start hge h) :
    (extract.loop as size start bs)[i] = as[start + i - bs.size]

(h : i < (Array.extract.loop as size start bs).size)

(h' : start + i - bs.size < as.size := ⋯)

(Array.extract.loop as size start bs)[i] = as[start + i - bs.size]


lemma norm_term_le {f g : ℕ → ℂ} (s : ℂ) {n : ℕ} (h : ‖f n‖ ≤ ‖g n‖) :
    ‖term f s n‖ ≤ ‖term g s n‖

‖LSeries.term f s n‖ ≤ ‖LSeries.term g s n‖


@[measurability]
theorem Measurable.ccosh : Measurable fun x => Complex.cosh (f x)

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


/-- Alternative definition of set convexity, using division. -/
theorem convex_iff_div :
    Convex 𝕜 s ↔ ∀ ⦃x⦄, x ∈ s → ∀ ⦃y⦄, y ∈ s →
      ∀ ⦃a b : 𝕜⦄, 0 ≤ a → 0 ≤ b → 0 < a + b → (a / (a + b)) • x + (b / (a + b)) • y ∈ s

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}

Convex 𝕜 s ↔
  ∀ ⦃x : E⦄,
    x ∈ s → ∀ ⦃y : E⦄, y ∈ s → ∀ ⦃a b : 𝕜⦄, 0 ≤ a → 0 ≤ b → 0 < a + b → (a / (a + b)) • x + (b / (a + b)) • y ∈ s


@[simp high, mfld_simps]
theorem coordChange_model_space (b b' x : F) :
    (tangentBundleCore 𝓘(𝕜, F) F).coordChange (achart F b) (achart F b') x = 1

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_8}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(b b' x : F)


@[to_additive (attr := simp)]
lemma stabilizer_smul_eq_right [Group α] [MulAction α β] [SMulCommClass G α β] (a : α) (b : β) :
    stabilizer G (a • b) = stabilizer G b

{G : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Group G]
[MulAction G β]
[Group α]
[MulAction α β]
[SMulCommClass G α β]
(a : α)
(b : β)

MulAction.stabilizer G (a • b) = MulAction.stabilizer G b


theorem Aut_mul_def (f g : Aut X) : f * g = g.trans f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(X : C)
(f g : CategoryTheory.Aut X)


@[to_additive]
theorem prod_Ioi_succ {M : Type*} [CommMonoid M] {n : ℕ} (i : Fin n) (v : Fin n.succ → M) :
    ∏ j ∈ Ioi i.succ, v j = ∏ j ∈ Ioi i, v j.succ

{M : Type u_3}
[CommMonoid M]
{n : ℕ}
(i : Fin n)
(v : Fin n.succ → M)

∏ j ∈ Finset.Ioi i.succ, v j = ∏ j ∈ Finset.Ioi i, v j.succ


theorem IsPrimitiveRoot.arg_eq_pi_iff {n : ℕ} {ζ : ℂ} (hζ : IsPrimitiveRoot ζ n) (hn : n ≠ 0) :
    ζ.arg = Real.pi ↔ ζ = -1


/-- If words `w₁ w₂` are such that `w₁` reduces to `w₂`, then `w₂` reduces to the maximal reduction
  of `w₁`. -/
@[to_additive "If words `w₁ w₂` are such that `w₁` reduces to `w₂`, then `w₂` reduces to the maximal
  reduction of `w₁`."]
theorem reduce.rev (H : Red L₁ L₂) : Red L₂ (reduce L₁)

{α : Type u}
{L₁ L₂ : List (α × Bool)}
[DecidableEq α]
(H : FreeAddGroup.Red L₁ L₂)

FreeAddGroup.Red L₂ (FreeAddGroup.reduce L₁)


@[to_additive]
theorem leftCoset_cover_const_iff_surjOn :
    ⋃ i ∈ s, g i • (H : Set G) = Set.univ ↔ Set.SurjOn (g · : ι → G ⧸ H) s Set.univ

{G : Type u_1}
[Group G]
{ι : Type u_2}
{s : Finset ι}
{H : Subgroup G}
{g : ι → G}

⋃ i ∈ s, g i • ↑H = Set.univ ↔ Set.SurjOn (fun x => ↑(g x)) (↑s) Set.univ


@[simp]
theorem lift_top (g : Set α → Filter β) : (⊤ : Filter α).lift g = g univ

{α : Type u_1}
{β : Type u_2}
(g : Set α → Filter β)


/-- A proper ideal is one that is not the whole set.
    Note that the whole set might not be an ideal. -/
@[mk_iff]
class IsProper (I : Ideal P) : Prop where
  /-- This ideal is not the whole set. -/
  ne_univ : (I : Set P) ≠ univ

{P : Type u_1}
[LE P]
(I : Order.Ideal P)


/-- If the target is not the zero ring, then one is not in the kernel. -/
theorem not_one_mem_ker [Nontrivial S] (f : F) : (1 : R) ∉ ker f

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rcf : RingHomClass F R S]
[Nontrivial S]
(f : F)


@[to_additive]
theorem prod_antidiagonal_swap {n : ℕ} {f : ℕ × ℕ → M} :
    ∏ p ∈ antidiagonal n, f p.swap = ∏ p ∈ antidiagonal n, f p

{M : Type u_1}
[AddCommMonoid M]
{n : ℕ}
{f : ℕ × ℕ → M}

∑ p ∈ Finset.antidiagonal n, f p.swap = ∑ p ∈ Finset.antidiagonal n, f p


@[simp]
theorem Iio_inter_Iio : Iio a ∩ Iio b = Iio (a ⊓ b)

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


theorem minimals_union : minimals r (s ∪ t) ⊆ minimals r s ∪ minimals r t

{α : Type u_1}
{r : α → α → Prop}
{s t : Set α}


@[simp] theorem concat_xor_concat (x y : BitVec w) (a b : Bool) :
    (concat x a) ^^^ (concat y b) = concat (x ^^^ y) (xor a b)

x.concat a ^^^ y.concat b = (x ^^^ y).concat (xor a b)


lemma _root_.AEMeasurable.singularPart {β : Type*} {_ : MeasurableSpace β} {f : α → β}
    (hf : AEMeasurable f μ) (ν : Measure α) :
    AEMeasurable f (μ.singularPart ν)

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{β : Type u_3}

∀ {x : MeasurableSpace β} {f : α → β},
  AEMeasurable f μ → ∀ (ν : MeasureTheory.Measure α), AEMeasurable f (μ.singularPart ν)


/-- This lemma doesn't require `H` to be impartial. -/
theorem equiv_iff_add_equiv_zero (H : PGame) : (H ≈ G) ↔ (H + G ≈ 0)

(G : SetTheory.PGame)
[G.Impartial]
(H : SetTheory.PGame)


@[simp] theorem xor_false : Xor' False = id


/-- Construct an isomorphism `G.inverse ⋙ F ≅ H` from an isomorphism `F ≅ G.functor ⋙ H`. -/
@[simps!]
def inverseCompIso {G : C ≌ D} (i : F ≅ G.functor ⋙ H) : G.inverse ⋙ F ≅ H

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
{F : CategoryTheory.Functor C E}
{H : CategoryTheory.Functor D E}
{G : C ≌ D}
(i : F ≅ G.functor.comp H)
(X : D)

i.inverseCompIso.hom.app X =
  CategoryTheory.CategoryStruct.comp (i.hom.app (G.inverse.obj X)) (H.map (G.counitIso.hom.app X))


@[simp] lemma isCoatom_compl : IsCoatom aᶜ ↔ IsAtom a

{α : Type u_2}
[BooleanAlgebra α]
{a : α}


theorem mem_iInf_finite {ι : Type*} {f : ι → Filter α} (s) :
    s ∈ iInf f ↔ ∃ t : Finset ι, s ∈ ⨅ i ∈ t, f i

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


@[simp] theorem eq_iff_eq_cancel_right {a b : α} : (∀ {c}, a = c ↔ b = c) ↔ a = b


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

(I : CategoryTheory.Limits.MulticospanIndex C)


/-- All ideals in a division (semi)ring are trivial. -/
theorem eq_bot_or_top : I = ⊥ ∨ I = ⊤

{K : Type u}
[DivisionSemiring K]
(I : Ideal K)


@[simp]
theorem Fintype.card_units_int : Fintype.card ℤˣ = 2


@[simp]
theorem id_comp : (CoalgHom.id R B).comp φ = φ

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[AddCommMonoid B]
[Module R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
(φ : A →ₗc[R] B)


lemma eq_induced : haveI := F.reflects_precoherent
    coherentTopology C =
      F.inducedTopology (coherentTopology _)

CategoryTheory.coherentTopology C = F.inducedTopology (CategoryTheory.coherentTopology D)


@[to_additive]
theorem finprod_mem_eq_one_of_forall_eq_one {f : α → M} {s : Set α} (h : ∀ x ∈ s, f x = 1) :
    ∏ᶠ i ∈ s, f i = 1

{α : Type u_1}
{M : Type u_5}
[CommMonoid M]
{f : α → M}
{s : Set α}
(h : ∀ x ∈ s, f x = 1)


protected lemma add_le_iff_le_sub : a + b ≤ c ↔ a ≤ c - b


@[simp]
theorem tmul_smul [DistribMulAction R' N] [CompatibleSMul R R' M N] (r : R') (x : M) (y : N) :
    x ⊗ₜ (r • y) = r • x ⊗ₜ[R] y

{R : Type u_1}
[CommSemiring R]
{R' : Type u_2}
[Monoid R']
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
[DistribMulAction R' M]
[SMulCommClass R R' M]
[DistribMulAction R' N]
[TensorProduct.CompatibleSMul R R' M N]
(r : R')
(x : M)
(y : N)


/-- A function is `Function.const α a` for some `a` if and only if `∀ x y, f x = f y`. -/
theorem range_const_eq_diagonal {α β : Type*} [hβ : Nonempty β] :
    range (const α) = {f : α → β | ∀ x y, f x = f y}

{α : Type u_1}
{β : Type u_2}
[hβ : Nonempty β]

Set.range (Function.const α) = {f | ∀ (x y : α), f x = f y}


theorem sSup_simples_eq_top : sSup { m : Submodule R M | IsSimpleModule R m } = ⊤

(R : Type u_2)
[Ring R]
(M : Type u_4)
[AddCommGroup M]
[Module R M]
[IsSemisimpleModule R M]


theorem smul_right_inj [NoZeroSMulDivisors R M] {c : R} (hc : c ≠ 0) {x y : M} :
    c • x = c • y ↔ x = y

{R : Type u_2}
{M : Type u_5}
[Semiring R]
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
{c : R}
(hc : c ≠ 0)
{x y : M}


@[simp]
lemma neg_zero : (-0 : W.Point) = 0

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


@[continuity]
theorem continuous_coe : Continuous ((↑) : X → OnePoint X)


theorem CPolynomialOn.analyticOn {s : Set E} (hf : CPolynomialOn 𝕜 f s) : AnalyticOn 𝕜 f s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set E}
(hf : CPolynomialOn 𝕜 f s)


@[to_additive]
theorem smoothAt_one [One M'] : SmoothAt I I' (1 : M → M') x

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


theorem integral_sub_inv_smul_sub_smul (f : ℂ → E) (c w : ℂ) (R : ℝ) :
    (∮ z in C(c, R), (z - w)⁻¹ • (z - w) • f z) = ∮ z in C(c, R), f z

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(f : ℂ → E)
(c w : ℂ)
(R : ℝ)

(∮ (z : ℂ) in C(c, R), (z - w)⁻¹ • (z - w) • f z) = ∮ (z : ℂ) in C(c, R), f z


theorem comp_eq_of_antitoneOn (f : α → E) {t : Set β} (φ : β → α) (hφ : AntitoneOn φ t) :
    eVariationOn (f ∘ φ) t = eVariationOn f (φ '' t)

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
{β : Type u_3}
[LinearOrder β]
(f : α → E)
{t : Set β}
(φ : β → α)
(hφ : AntitoneOn φ t)


@[simp]
theorem ofDigits_nil {b : ℕ} : ofDigits b [] = 0


theorem map_apply (f : E →L[𝕜] F) (x : E) : WeakSpace.map f x = f x

{𝕜 : Type u_2}
{E : Type u_5}
{F : Type u_6}
[CommSemiring 𝕜]
[TopologicalSpace 𝕜]
[ContinuousAdd 𝕜]
[ContinuousConstSMul 𝕜 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
[TopologicalSpace E]
[AddCommMonoid F]
[Module 𝕜 F]
[TopologicalSpace F]
(f : E →L[𝕜] F)
(x : E)


/-- Predicate asserting that the word `w₁` can be reduced to `w₂` in one step, i.e. there are words
`w₃ w₄` and letter `x` such that `w₁ = w₃xx⁻¹w₄` and `w₂ = w₃w₄`  -/
@[to_additive "Predicate asserting that the word `w₁` can be reduced to `w₂` in one step, i.e. there
  are words `w₃ w₄` and letter `x` such that `w₁ = w₃ + x + (-x) + w₄` and `w₂ = w₃w₄`"]
theorem Step.length : ∀ {L₁ L₂ : List (α × Bool)}, Step L₁ L₂ → L₂.length + 2 = L₁.length

FreeAddGroup.Red.Step L₁ L₂ → L₂.length + 2 = L₁.length


theorem balancedCore_eq_iInter (hs : (0 : E) ∈ s) :
    balancedCore 𝕜 s = ⋂ (r : 𝕜) (_ : 1 ≤ ‖r‖), r • s

{𝕜 : Type u_1}
{E : Type u_2}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
(hs : 0 ∈ s)

balancedCore 𝕜 s = ⋂ r, ⋂ (_ : 1 ≤ ‖r‖), r • s


lemma ne_zero_of_irreducible_X_pow_sub_C' {n : ℕ} (hn : n ≠ 1) {a : K}
    (H : Irreducible (X ^ n - C a)) : a ≠ 0

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


@[simp]
theorem Gamma1_mem' (N : ℕ) (γ : Gamma0 N) : γ ∈ Gamma1' N ↔ (Gamma0Map N) γ = 1

(N : ℕ)
(γ : ↥(CongruenceSubgroup.Gamma0 N))

γ ∈ CongruenceSubgroup.Gamma1' N ↔ (CongruenceSubgroup.Gamma0Map N) γ = 1


/-- See `isUnit_iff_exists` for a similar lemma with one existential. -/
@[to_additive "See `isAddUnit_iff_exists` for a similar lemma with one existential."]
theorem isUnit_iff_exists_and_exists [Monoid M] {a : M} :
    IsUnit a ↔ (∃ b, a * b = 1) ∧ (∃ c, c * a = 1)

IsAddUnit a ↔ (∃ b, a + b = 0) ∧ ∃ c, c + a = 0


@[to_additive (attr := simp)]
theorem mulRothNumber_empty : mulRothNumber (∅ : Finset α) = 0

{α : Type u_2}
[DecidableEq α]
[Monoid α]


/-- Preconnected sets are either contained in or disjoint to any given clopen set. -/
theorem disjoint_or_subset_of_isClopen {s t : Set α} (hs : IsPreconnected s) (ht : IsClopen t) :
    Disjoint s t ∨ s ⊆ t

{α : Type u}
[TopologicalSpace α]
{s t : Set α}
(hs : IsPreconnected s)
(ht : IsClopen t)


lemma FractionalIdeal.le_inv_comm {I J : FractionalIdeal A⁰ K} (hI : I ≠ 0) (hJ : J ≠ 0) :
    I ≤ J⁻¹ ↔ J ≤ I⁻¹

{A : Type u_2}
{K : Type u_3}
[CommRing A]
[Field K]
[IsDedekindDomain A]
[Algebra A K]
[IsFractionRing A K]
{I J : FractionalIdeal A⁰ K}
(hI : I ≠ 0)
(hJ : J ≠ 0)

I ≤ J⁻¹ ↔ J ≤ I⁻¹


lemma OrthogonalIdempotents.map :
    OrthogonalIdempotents (f ∘ e)

{R : Type u_1}
{S : Type u_2}
[Ring R]
[Ring S]
(f : R →+* S)
{I : Type u_3}
{e : I → R}
(he : OrthogonalIdempotents e)


theorem truncation_nonneg {f : α → ℝ} (A : ℝ) {x : α} (h : 0 ≤ f x) : 0 ≤ truncation f A x

{α : Type u_1}
{f : α → ℝ}
(A : ℝ)
{x : α}
(h : 0 ≤ f x)


@[simp]
lemma monovaryOn_inv_left₀ (hf : ∀ i ∈ s, 0 < f i) : MonovaryOn f⁻¹ g s ↔ AntivaryOn f g s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedSemifield α]
[LinearOrderedSemifield β]
{s : Set ι}
{f : ι → α}
{g : ι → β}
(hf : ∀ i ∈ s, 0 < f i)


@[simp]
theorem nonempty_Icc : (Icc a b).Nonempty ↔ a ≤ b


@[to_additive]
theorem map_sup_comap_of_surjective (S T : Subsemigroup N) :
    (S.comap f ⊔ T.comap f).map f = S ⊔ T

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
{f : AddHom M N}
(hf : Function.Surjective ⇑f)
(S T : AddSubsemigroup N)

AddSubsemigroup.map f (AddSubsemigroup.comap f S ⊔ AddSubsemigroup.comap f T) = S ⊔ T


@[simp]
theorem iSup_bot : (⨆ _ : ι, ⊥ : α) = ⊥

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]


/-- The equivalence `(x, y) ↦ (x, y+1)`. -/
@[simps!]
def shiftUp : ℤ × ℤ ≃ ℤ × ℤ

∀ (a : ℤ × ℤ), SetTheory.PGame.Domineering.shiftUp a = Prod.map id (fun x => x + 1) a


@[to_additive]
theorem discreteTopology_of_isOpen_singleton_one (h : IsOpen ({1} : Set G)) :
    DiscreteTopology G

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[ContinuousAdd G]
(h : IsOpen {0})


/-- A seminormed commutative ring is a commutative ring endowed with a seminorm which satisfies
the inequality `‖x y‖ ≤ ‖x‖ ‖y‖`. -/
class SeminormedCommRing (α : Type*) extends SeminormedRing α where
  /-- Multiplication is commutative. -/
  mul_comm : ∀ x y : α, x * y = y * x

{α : Type u_5}
[self : SeminormedCommRing α]
(x y : α)


@[simp]
theorem optionSubtype_apply_apply
    [DecidableEq β] (x : β)
    (e : { e : Option α ≃ β // e none = x })
    (a : α)
    (h) : optionSubtype x e a = ⟨(e : Option α ≃ β) a, h⟩

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(x : β)
(e : { e // e none = x })
(a : α)
(h : ↑e (some a) ≠ x)

((Equiv.optionSubtype x) e) a = ⟨↑e (some a), h⟩


theorem scale_sat {c : Constraint} (k) (w : c.sat t) : (scale k c).sat (k * t)

{t : Int}
{c : Lean.Omega.Constraint}
(k : Int)
(w : c.sat t = true)

(Lean.Omega.Constraint.scale k c).sat (k * t) = true


theorem num_eq_conts_a : g.nums n = (g.conts n).a

{K : Type u_1}
{g : GenContFract K}
{n : ℕ}
[DivisionRing K]


@[simp]
theorem exists_isCompact_superset_iff {s : Set X} :
    (∃ K, IsCompact K ∧ s ⊆ K) ↔ IsCompact (closure s)

{X : Type u_1}
[TopologicalSpace X]
[R1Space X]
{s : Set X}


@[to_additive (attr := simp)] lemma smul_snd : (a • x).2 = a • x.2

{M : Type u_1}
{α : Type u_5}
{β : Type u_6}
[SMul M α]
[SMul M β]
(a : M)
(x : α × β)


theorem indep_iff_not_dep : M.Indep I ↔ ¬M.Dep I ∧ I ⊆ M.E

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


theorem ContDiffOn.mono (h : ContDiffOn 𝕜 n f s) {t : Set E} (hst : t ⊆ s) : ContDiffOn 𝕜 n f t

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{n : ℕ∞}
(h : ContDiffOn 𝕜 n f s)
{t : Set E}
(hst : t ⊆ s)


@[to_additive]
theorem mclosure_inv_subset {s : Set G} : Monoid.Closure (Inv.inv ⁻¹' s) ⊆ closure s

Monoid.Closure (Inv.inv ⁻¹' s) ⊆ Group.closure s


@[simp]
theorem biprod.isoProd_inv {X Y : C} [HasBinaryBiproduct X Y] :
    (biprod.isoProd X Y).inv = biprod.lift prod.fst prod.snd

(CategoryTheory.Limits.biprod.isoProd X Y).inv =
  CategoryTheory.Limits.biprod.lift CategoryTheory.Limits.prod.fst CategoryTheory.Limits.prod.snd


theorem subset_normalClosure : s ⊆ normalClosure s


protected theorem neg_add_lt_of_lt_add {a b c : Int} (h : a < b + c) : -b + a < c


theorem ext_iff {a b : Fin n} : a = b ↔ a.1 = b.1


/-- Swapping the first and third points in an oriented angle negates the sign of that angle. -/
theorem oangle_swap₁₃_sign (p₁ p₂ p₃ : P) : -(∡ p₁ p₂ p₃).sign = (∡ p₃ p₂ p₁).sign

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


@[simp]
theorem fract_ofNat_add (n : ℕ) [n.AtLeastTwo] (a : α) :
    fract ((no_index (OfNat.ofNat n)) + a) = fract a

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(n : ℕ)
[n.AtLeastTwo]
(a : α)

Int.fract (OfNat.ofNat n + a) = Int.fract a


theorem map_prime_of_factor_orderIso {m p : Associates M} {n : Associates N} (hn : n ≠ 0)
    (hp : p ∈ normalizedFactors m) (d : Set.Iic m ≃o Set.Iic n) :
    Prime (d ⟨p, dvd_of_mem_normalizedFactors hp⟩ : Associates N)

(hp : p ∈ UniqueFactorizationMonoid.normalizedFactors m)


@[to_additive const_add]
theorem Monotone.const_mul' [CovariantClass α α (· * ·) (· ≤ ·)] (hf : Monotone f) (a : α) :
    Monotone fun x => a * f x

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


@[simp]
theorem mem_toFinset : a ∈ l.toFinset ↔ a ∈ l

{α : Type u_1}
[DecidableEq α]
{l : List α}
{a : α}


/-- If `f` has derivative `f'` within `(x, +∞)` at `x`, then for any `r > ‖f'‖` the ratio
`(‖f z‖ - ‖f x‖) / (z - x)` is frequently less than `r` as `z → x+0`.
In other words, the limit inferior of this ratio as `z` tends to `x+0`
is less than or equal to `‖f'‖`.

See also

* `HasDerivWithinAt.limsup_norm_slope_le` for a stronger version using
  limit superior and any set `s`;
* `HasDerivWithinAt.liminf_right_norm_slope_le` for a stronger version using
  `‖f z - f xp‖` instead of `‖f z‖ - ‖f x‖`. -/
theorem HasDerivWithinAt.liminf_right_slope_norm_le (hf : HasDerivWithinAt f f' (Ici x) x)
    (hr : ‖f'‖ < r) : ∃ᶠ z in 𝓝[>] x, (z - x)⁻¹ * (‖f z‖ - ‖f x‖) < r

(hf : HasDerivWithinAt f f' (Set.Ici x) x)

∃ᶠ (z : ℝ) in 𝓝[>] x, (z - x)⁻¹ * (‖f z‖ - ‖f x‖) < r


theorem ofNat_fin_two (n : ℕ) [n.AtLeastTwo] :
    (no_index (OfNat.ofNat n) : Matrix (Fin 2) (Fin 2) α) =
      !![OfNat.ofNat n, 0; 0, OfNat.ofNat n]

{α : Type u}
[AddMonoidWithOne α]
(n : ℕ)
[n.AtLeastTwo]

OfNat.ofNat n = !![OfNat.ofNat n, 0; 0, OfNat.ofNat n]


@[simp]
theorem blsub_eq_lsub' {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r]
    (f : ι → Ordinal.{max u v}) : blsub.{_, v} _ (bfamilyOfFamily' r f) = lsub.{_, v} f

(Ordinal.type r).blsub (Ordinal.bfamilyOfFamily' r f) = Ordinal.lsub f


@[to_additive]
theorem inv_apply [Inv Y] (f : LocallyConstant X Y) (x : X) : f⁻¹ x = (f x)⁻¹

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[Neg Y]
(f : LocallyConstant X Y)
(x : X)


@[simp] lemma le_find_iff (h : ∃ n : ℕ, p n) (n : ℕ) : n ≤ Nat.find h ↔ ∀ m < n, ¬ p m

{p : ℕ → Prop}
[DecidablePred p]
(h : ∃ n, p n)
(n : ℕ)

n ≤ Nat.find h ↔ ∀ (m : ℕ), m < n → ¬p m


theorem boundedBy_eq (s : Set α) (m_empty : m ∅ = 0) (m_mono : ∀ ⦃t : Set α⦄, s ⊆ t → m s ≤ m t)
    (m_subadd : ∀ s : ℕ → Set α, m (⋃ i, s i) ≤ ∑' i, m (s i)) : boundedBy m s = m s

(m_subadd : ∀ (s : ℕ → Set α), m (⋃ i, s i) ≤ ∑' (i : ℕ), m (s i))

(MeasureTheory.OuterMeasure.boundedBy m) s = m s


theorem Eventually.prod_inr {lb : Filter β} {p : β → Prop} (h : ∀ᶠ x in lb, p x) (la : Filter α) :
    ∀ᶠ x in la ×ˢ lb, p (x : α × β).2

{α : Type u_1}
{β : Type u_2}
{lb : Filter β}
{p : β → Prop}
(h : ∀ᶠ (x : β) in lb, p x)
(la : Filter α)


/-- See `Int.inductionOn'` for an induction in both directions. -/
protected lemma le_induction {P : ℤ → Prop} {m : ℤ} (h0 : P m)
    (h1 : ∀ n : ℤ, m ≤ n → P n → P (n + 1)) (n : ℤ) : m ≤ n → P n

(h1 : ∀ (n : ℤ), m ≤ n → P n → P (n + 1))


lemma exp_nsmul (x : ℂ) (n : ℕ) : exp (n • x) = exp x ^ n


/-- The trivial multiplicative character. It takes the value `0` on non-units and
the value `1` on units. -/
@[simps]
noncomputable def trivial : MulChar R R'

(R : Type u_1)
[CommMonoid R]
(R' : Type u_2)
[CommMonoidWithZero R']
(x : R)

(MulChar.trivial R R') x = if IsUnit x then 1 else 0


theorem subset_coe_filter_of_subset_forall (s : Finset α) {t : Set α} (h₁ : t ⊆ s)
    (h₂ : ∀ x ∈ t, p x) : t ⊆ s.filter p

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]
(s : Finset α)
{t : Set α}
(h₁ : t ⊆ ↑s)
(h₂ : ∀ x ∈ t, p x)


@[to_additive]
theorem multiset_prod_apply {α : Type*} {β : α → Type*} [∀ a, CommMonoid (β a)] (a : α)
    (s : Multiset (∀ a, β a)) : s.prod a = (s.map fun f : ∀ a, β a ↦ f a).prod

{α : Type u_1}
{β : α → Type u_2}
[(a : α) → CommMonoid (β a)]
(a : α)
(s : Multiset ((a : α) → β a))

s.prod a = (Multiset.map (fun f => f a) s).prod


theorem map_mem_minimals (ha : a ∈ minimals r x) : f a ∈ minimals s (f '' x)

(hf : ∀ ⦃a a' : α⦄, a ∈ x → a' ∈ x → (r a a' ↔ s (f a) (f a')))


theorem adjoin_monomial_eq_reesAlgebra :
    Algebra.adjoin R (Submodule.map (monomial 1 : R →ₗ[R] R[X]) I : Set R[X]) = reesAlgebra I

Algebra.adjoin R ↑(Submodule.map (Polynomial.monomial 1) I) = reesAlgebra I


theorem IsEulerian.card_filter_odd_degree [Fintype V] [DecidableRel G.Adj] {u v : V}
    {p : G.Walk u v} (ht : p.IsEulerian) {s}
    (h : s = (Finset.univ : Finset V).filter fun v => Odd (G.degree v)) :
    s.card = 0 ∨ s.card = 2

(h : s = Finset.filter (fun v => Odd (G.degree v)) Finset.univ)


theorem X_pow_sub_C_irreducible_iff_of_odd {n : ℕ} (hn : Odd n) {a : K} :
    Irreducible (X ^ n - C a) ↔ (∀ d, d ∣ n → d ≠ 1 → ∀ b : K, b ^ d ≠ a)

{K : Type u}
[Field K]
{n : ℕ}
(hn : Odd n)
{a : K}

Irreducible (Polynomial.X ^ n - Polynomial.C a) ↔ ∀ (d : ℕ), d ∣ n → d ≠ 1 → ∀ (b : K), b ^ d ≠ a


@[simp]
theorem LinearEquiv.dualMap_symm {f : M₁ ≃ₗ[R] M₂} :
    (LinearEquiv.dualMap f).symm = LinearEquiv.dualMap f.symm

{R : Type u}
[CommSemiring R]
{M₁ : Type v}
{M₂ : Type v'}
[AddCommMonoid M₁]
[Module R M₁]
[AddCommMonoid M₂]
[Module R M₂]
{f : M₁ ≃ₗ[R] M₂}


theorem image_mul_right_Icc {a b c : α} (hab : a ≤ b) (hc : 0 ≤ c) :
    (fun x => x * c) '' Icc a b = Icc (a * c) (b * c)

{α : Type u_1}
[LinearOrderedField α]
{a b c : α}
(hab : a ≤ b)
(hc : 0 ≤ c)

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


@[simp]
theorem iUnion_Icc_right (a : α) : ⋃ b, Icc a b = Ici a


/-- A mixin for left cancellative addition. -/
class IsLeftCancelAdd (G : Type u) [Add G] : Prop where
  /-- Addition is left cancellative. -/
  protected add_left_cancel : ∀ a b c : G, a + b = a + c → b = c

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


@[simp]
theorem isVonNBounded_union {s t : Set E} :
    IsVonNBounded 𝕜 (s ∪ t) ↔ IsVonNBounded 𝕜 s ∧ IsVonNBounded 𝕜 t

{𝕜 : Type u_1}
{E : Type u_3}
[SeminormedRing 𝕜]
[SMul 𝕜 E]
[Zero E]
[TopologicalSpace E]
{s t : Set E}

Bornology.IsVonNBounded 𝕜 (s ∪ t) ↔ Bornology.IsVonNBounded 𝕜 s ∧ Bornology.IsVonNBounded 𝕜 t


lemma fourierIntegralInv_eq' (f : V → E) (w : V) :
    𝓕⁻ f w = ∫ v, Complex.exp ((↑(2 * π * ⟪v, w⟫) * Complex.I)) • f v

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{V : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MeasurableSpace V]
[BorelSpace V]
[FiniteDimensional ℝ V]
(f : V → E)
(w : V)

Real.fourierIntegralInv f w = ∫ (v : V), Complex.exp (↑(2 * π * ⟪v, w⟫_ℝ) * Complex.I) • f v


lemma mem_of_mem_measurableAtom {x y : β} (h : y ∈ measurableAtom x) {s : Set β}
    (hs : MeasurableSet s) (hxs : x ∈ s) : y ∈ s

{β : Type u_2}
[MeasurableSpace β]
{x y : β}
(h : y ∈ measurableAtom x)
{s : Set β}
(hs : MeasurableSet s)
(hxs : x ∈ s)


@[simp]
theorem mem_mk_iff (S : Set L) (h₁ h₂ h₃ h₄) {x : L} :
    x ∈ (⟨⟨⟨⟨S, h₁⟩, h₂⟩, h₃⟩, h₄⟩ : LieSubalgebra R L) ↔ x ∈ S

(h₁ : ∀ {a b : L}, a ∈ S → b ∈ S → a + b ∈ S)

(h₃ :
  ∀ (c : R) {x : L},
    x ∈ { carrier := S, add_mem' := h₁, zero_mem' := h₂ }.carrier →
      c • x ∈ { carrier := S, add_mem' := h₁, zero_mem' := h₂ }.carrier)

(h₄ :
  ∀ {x y : L},
    x ∈ { carrier := S, add_mem' := h₁, zero_mem' := h₂, smul_mem' := h₃ }.carrier →
      y ∈ { carrier := S, add_mem' := h₁, zero_mem' := h₂, smul_mem' := h₃ }.carrier →
        ⁅x, y⁆ ∈ { carrier := S, add_mem' := h₁, zero_mem' := h₂, smul_mem' := h₃ }.carrier)

x ∈ { carrier := S, add_mem' := h₁, zero_mem' := h₂, smul_mem' := h₃, lie_mem' := h₄ } ↔ x ∈ S


/-- The `atTop` filter for an open interval `Ici a` comes from the `atTop` filter in the ambient
order. -/
theorem atTop_Ici_eq [SemilatticeSup α] (a : α) : atTop = comap ((↑) : Ici a → α) atTop

{α : Type u_3}
[SemilatticeSup α]
(a : α)

Filter.atTop = Filter.comap Subtype.val Filter.atTop


/-- Two multiplicative isomorphisms agree if they are defined by the
same underlying function. -/
@[to_additive (attr := ext)
  "Two additive isomorphisms agree if they are defined by the same underlying function."]
theorem ext {f g : MulEquiv M N} (h : ∀ x, f x = g x) : f = g

{M : Type u_6}
{N : Type u_7}
[Mul M]
[Mul N]
{f g : M ≃* N}
(h : ∀ (x : M), f x = g x)


theorem Prime.pred_pos {p : ℕ} (pp : Prime p) : 0 < pred p


@[to_additive]
theorem prod_lt_one' (h : ∀ i ∈ s, f i ≤ 1) (hs : ∃ i ∈ s, f i < 1) : ∏ i ∈ s, f i < 1

{ι : Type u_1}
{M : Type u_4}
[OrderedCancelCommMonoid M]
{f : ι → M}
{s : Finset ι}
(h : ∀ i ∈ s, f i ≤ 1)
(hs : ∃ i ∈ s, f i < 1)


@[simp]
theorem natDegree_of_c_eq_zero (ha : P.a = 0) (hb : P.b = 0) (hc : P.c = 0) :
    P.toPoly.natDegree = 0

{R : Type u_1}
{P : Cubic R}
[Semiring R]
(ha : P.a = 0)
(hb : P.b = 0)
(hc : P.c = 0)


theorem _root_.isRelPrime_iff_isCoprime : IsRelPrime x y ↔ IsCoprime x y

[Submodule.IsPrincipal (Ideal.span {x, y})]


theorem splitFun_comp {α₀ α₁ α₂ : TypeVec (n + 1)} (f₀ : drop α₀ ⟹ drop α₁)
    (f₁ : drop α₁ ⟹ drop α₂) (g₀ : last α₀ → last α₁) (g₁ : last α₁ → last α₂) :
    splitFun (f₁ ⊚ f₀) (g₁ ∘ g₀) = splitFun f₁ g₁ ⊚ splitFun f₀ g₀

{n : ℕ}
{α₀ : TypeVec.{u_1} (n + 1)}
{α₁ : TypeVec.{u_2} (n + 1)}
{α₂ : TypeVec.{u_3} (n + 1)}
(f₀ : α₀.drop.Arrow α₁.drop)
(f₁ : α₁.drop.Arrow α₂.drop)
(g₀ : α₀.last → α₁.last)
(g₁ : α₁.last → α₂.last)

TypeVec.splitFun (TypeVec.comp f₁ f₀) (g₁ ∘ g₀) = TypeVec.comp (TypeVec.splitFun f₁ g₁) (TypeVec.splitFun f₀ g₀)


theorem _root_.mulRight_bijective₀ (a : G) (ha : a ≠ 0) : Function.Bijective ((· * a) : G → G)

{G : Type u_1}
[GroupWithZero G]
(a : G)
(ha : a ≠ 0)


@[simp]
theorem top_ne_zero : (⊤ : EReal) ≠ 0


@[simp]
theorem rdropWhile_nil : rdropWhile p ([] : List α) = []


/-- A type `G₀` is a “group with zero” if it is a monoid with zero element (distinct from `1`)
such that every nonzero element is invertible.
The type is required to come with an “inverse” function, and the inverse of `0` must be `0`.

Examples include division rings and the ordered monoids that are the
target of valuations in general valuation theory. -/
class GroupWithZero (G₀ : Type u) extends MonoidWithZero G₀, DivInvMonoid G₀, Nontrivial G₀ where
  /-- The inverse of `0` in a group with zero is `0`. -/
  inv_zero : (0 : G₀)⁻¹ = 0
  /-- Every nonzero element of a group with zero is invertible. -/
  protected mul_inv_cancel (a : G₀) : a ≠ 0 → a * a⁻¹ = 1


@[simp]
theorem update_lt_update_iff : update x i a < update x i b ↔ a < b

{ι : Type u_1}
{π : ι → Type u_4}
[DecidableEq ι]
[(i : ι) → Preorder (π i)]
{x : (i : ι) → π i}
{i : ι}
{a b : π i}

Function.update x i a < Function.update x i b ↔ a < b


/-- An algebra is isomorphic to the opposite of its opposite. -/
@[simps!]
def opOp : A ≃ₐ[R] Aᵐᵒᵖᵐᵒᵖ

(R : Type u_1)
(A : Type u_3)
[CommSemiring R]
[Semiring A]
[Algebra R A]

∀ (a : Aᵐᵒᵖᵐᵒᵖ), (AlgEquiv.opOp R A).symm a = MulOpposite.unop (MulOpposite.unop a)


/-- If `F` and `G` are naturally isomorphic functors, then they have equivalent categories of
cones.
-/
@[simps]
def postcomposeEquivalence {G : J ⥤ C} (α : F ≅ G) : Cone F ≌ Cone G

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

(CategoryTheory.Limits.Cones.postcomposeEquivalence α).counitIso =
  CategoryTheory.NatIso.ofComponents
    (fun s =>
      CategoryTheory.Limits.Cones.ext
        (CategoryTheory.Iso.refl
          ((CategoryTheory.Limits.Cones.postcompose α.inv ⋙ CategoryTheory.Limits.Cones.postcompose α.hom).obj s).pt)
        ⋯)
    ⋯


@[simp]
theorem compl_bot : (⊥ : α)ᶜ = ⊤


private theorem mul_assoc (a b c : ⨁ i, A i) : a * b * c = a * (b * c)

{ι : Type u_1}
[DecidableEq ι]
(A : ι → Type u_2)
[(i : ι) → AddCommMonoid (A i)]
[AddMonoid ι]
[DirectSum.GSemiring A]
(a b c : DirectSum ι fun i => A i)


@[to_additive]
theorem integral_eq_tsum' (h : IsFundamentalDomain G s μ) (f : α → E) (hf : Integrable f μ) :
    ∫ x, f x ∂μ = ∑' g : G, ∫ x in s, f (g⁻¹ • x) ∂μ

[MeasureTheory.SMulInvariantMeasure G α μ]

(h : MeasureTheory.IsFundamentalDomain G s μ)

∫ (x : α), f x ∂μ = ∑' (g : G), ∫ (x : α) in s, f (g⁻¹ • x) ∂μ


theorem eq_of_eqOn {f f' : α → E} {s : Set α} (h : EqOn f f' s) :
    eVariationOn f s = eVariationOn f' s

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
{f f' : α → E}
{s : Set α}
(h : Set.EqOn f f' s)


theorem LTCmp.eq_compareOfLessAndEq
    [LT α] [DecidableEq α] [BEq α] [LawfulBEq α] [BEqCmp cmp] [LTCmp cmp]
    (x y : α) [Decidable (x < y)] : cmp x y = compareOfLessAndEq x y

{α : Type u_1}
{cmp : α → α → Ordering}
[LT α]
[DecidableEq α]
[BEq α]
[LawfulBEq α]
[Batteries.BEqCmp cmp]
[Batteries.LTCmp cmp]
(x y : α)
[Decidable (x < y)]


/-- A nontrivial `ℚ`-algebra has characteristic zero.

This cannot be a (local) instance because it would immediately form a loop with the
instance `algebraRat`. It's probably easier to go the other way: prove `CharZero R` and
automatically receive an `Algebra ℚ R` instance.
-/
theorem algebraRat.charZero [Ring R] [Algebra ℚ R] : CharZero R

(R : Type u_1)
[Nontrivial R]
[Ring R]
[Algebra ℚ R]


theorem val_mul_le {n : ℕ} (a b : ZMod n) : (a * b).val ≤ a.val * b.val


/-- In the category `Module R`, if `x` and `y` are pseudoequal, then the range of the associated
morphisms is the same. -/
theorem ModuleCat.eq_range_of_pseudoequal {R : Type*} [CommRing R] {G : ModuleCat R} {x y : Over G}
    (h : PseudoEqual G x y) : LinearMap.range x.hom = LinearMap.range y.hom

(h : CategoryTheory.Abelian.PseudoEqual G x y)


theorem exponent : Monoid.exponent (DihedralGroup n) = lcm n 2


theorem DifferentiableWithinAt.congr_of_eventuallyEq (h : DifferentiableWithinAt 𝕜 f s x)
    (h₁ : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) : DifferentiableWithinAt 𝕜 f₁ s x

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


@[to_additive (attr := simp)]
theorem quotientMapOfLE_apply_mk (h : s ≤ t) (g : α) :
    quotientMapOfLE h (QuotientGroup.mk g) = QuotientGroup.mk g

{α : Type u_1}
[Group α]
{s t : Subgroup α}
(h : s ≤ t)
(g : α)


@[symm]
theorem Codisjoint.symm ⦃a b : α⦄ : Codisjoint a b → Codisjoint b a

{α : Type u_1}
[PartialOrder α]
[OrderTop α]
⦃a b : α⦄


theorem eLpNorm_lt_top (f : Lp E p μ) : eLpNorm f p μ < ∞

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
(f : ↥(MeasureTheory.Lp E p μ))


theorem mem_pointwise_smul_iff_inv_smul_mem {g : G} {S : ValuationSubring K} {x : K} :
    x ∈ g • S ↔ g⁻¹ • x ∈ S

{K : Type u}
[Field K]
{G : Type u_1}
[Group G]
[MulSemiringAction G K]
{g : G}
{S : ValuationSubring K}
{x : K}

x ∈ g • S ↔ g⁻¹ • x ∈ S


theorem one_le_iff_ne_zero : 1 ≤ n ↔ n ≠ 0


@[to_additive]
theorem comap_comap_center {H₁ : Subgroup G} [H₁.Normal] {H₂ : Subgroup (G ⧸ H₁)} [H₂.Normal] :
    ((Subgroup.center ((G ⧸ H₁) ⧸ H₂)).comap (mk' H₂)).comap (mk' H₁) =
      (Subgroup.center (G ⧸ H₂.comap (mk' H₁))).comap (mk' (H₂.comap (mk' H₁)))

{G : Type u}
[Group G]
{H₁ : Subgroup G}
[H₁.Normal]
{H₂ : Subgroup (G ⧸ H₁)}
[H₂.Normal]

Subgroup.comap (QuotientGroup.mk' H₁) (Subgroup.comap (QuotientGroup.mk' H₂) (Subgroup.center ((G ⧸ H₁) ⧸ H₂))) =
  Subgroup.comap (QuotientGroup.mk' (Subgroup.comap (QuotientGroup.mk' H₁) H₂))
    (Subgroup.center (G ⧸ Subgroup.comap (QuotientGroup.mk' H₁) H₂))


theorem map_add_swap [DecidableEq ι] {i j : ι} (hij : i ≠ j) :
    f v + f (v ∘ Equiv.swap i j) = 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}
(f : M [⋀^ι]→ₗ[R] N)
(v : ι → M)
[DecidableEq ι]
{i j : ι}
(hij : i ≠ j)


theorem isLocallyFiniteMeasure_of_le [TopologicalSpace α] {_m : MeasurableSpace α} {μ ν : Measure α}
    [H : IsLocallyFiniteMeasure μ] (h : ν ≤ μ) : IsLocallyFiniteMeasure ν

[H : MeasureTheory.IsLocallyFiniteMeasure μ]


/-- The hypotheses also imply that `F` is final, see `final_of_comp_full_faithful`. -/
theorem final_of_comp_full_faithful' [Full G] [Faithful G] [Final (F ⋙ G)] : Final G

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


@[deprecated Balanced.zero_insert_interior (since := "2024-02-03")]
theorem balanced_zero_union_interior (hA : Balanced 𝕜 A) : Balanced 𝕜 ((0 : Set E) ∪ interior A)

{𝕜 : Type u_1}
{E : Type u_3}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{A : Set E}
[TopologicalSpace E]
[ContinuousSMul 𝕜 E]
(hA : Balanced 𝕜 A)


theorem disjoint_inl_inr : Disjoint (range <| inl R M M₂) (range <| inr R M M₂)

{R : Type u}
{M : Type v}
{M₂ : Type w}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]

Disjoint (LinearMap.range (LinearMap.inl R M M₂)) (LinearMap.range (LinearMap.inr R M M₂))


theorem normSq_denom_pos (g : GL(2, ℝ)⁺) (z : ℍ) : 0 < Complex.normSq (denom g z)

0 < Complex.normSq (UpperHalfPlane.denom g z)


@[simp] lemma innerₗ_apply (v w : F) : innerₗ F v w = ⟪v, w⟫_ℝ

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
(v w : F)


/-- Lift two monoid equivalences `e : M ≃* N` and `e' : M' ≃* N'` to a monoid equivalence
`(M ∗ M') ≃* (N ∗ N')`. -/
@[to_additive (attr := simps! (config := .asFn)) "Lift two additive monoid
equivalences `e : M ≃+ N` and `e' : M' ≃+ N'` to an additive monoid equivalence
`(AddMonoid.Coprod M M') ≃+ (AddMonoid.Coprod N N')`."]
def coprodCongr (e : M ≃* N) (e' : M' ≃* N') : (M ∗ M') ≃* (N ∗ N')

{M : Type u_1}
{N : Type u_2}
{M' : Type u_3}
{N' : Type u_4}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass M']
[AddZeroClass N']
(e : M ≃+ N)
(e' : M' ≃+ N')

⇑(AddMonoid.MulEquiv.coprodCongr e e') = ⇑(AddMonoid.Coprod.map ↑e ↑e')


/-- The duality equivalence `WalkingSpanᵒᵖ ≌ WalkingCospan` -/
@[simps!]
def walkingSpanOpEquiv : WalkingSpanᵒᵖ ≌ WalkingCospan

(X : (CategoryTheory.Limits.WidePushoutShape CategoryTheory.Limits.WalkingPair)ᵒᵖ)

CategoryTheory.Limits.walkingSpanOpEquiv.functor.obj X = Opposite.unop X


@[simp]
theorem mod_get_eq [Mod α] (a b : Part α) (hab : Dom (a % b)) :
    (a % b).get hab = a.get (left_dom_of_mod_dom hab) % b.get (right_dom_of_mod_dom hab)

{α : Type u_1}
[Mod α]
(a b : Part α)
(hab : (a % b).Dom)


theorem erase_sdiff_distrib (s t : Finset α) (a : α) : (s \ t).erase a = s.erase a \ t.erase a

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


protected theorem le_max_right (a b : Int) : b ≤ max a b


/-- `AdicCompletion` over a Noetherian ring is exact on finitely generated modules. -/
theorem map_exact : Function.Exact (map I f) (map I g)

{R : Type u}
[CommRing R]
{I : Ideal R}
{M : Type u}
[AddCommGroup M]
[Module R M]
{N : Type u}
[AddCommGroup N]
[Module R N]
{P : Type u}
[AddCommGroup P]
[Module R P]
[IsNoetherianRing R]
[Module.Finite R N]
{f : M →ₗ[R] N}
{g : N →ₗ[R] P}
(hf : Function.Injective ⇑f)
(hfg : Function.Exact ⇑f ⇑g)
(hg : Function.Surjective ⇑g)

Function.Exact ⇑(AdicCompletion.map I f) ⇑(AdicCompletion.map I g)


lemma changeOriginSeriesTerm_changeOriginIndexEquiv_symm (n t) :
    let s := changeOriginIndexEquiv.symm ⟨n, t⟩
    p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ ↦ x) (fun _ ↦ y) =
    p n (t.piecewise (fun _ ↦ x) fun _ ↦ y)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
{x y : E}
(n : ℕ)
(t : Finset (Fin n))

let s := FormalMultilinearSeries.changeOriginIndexEquiv.symm ⟨n, t⟩;
(((p.changeOriginSeriesTerm s.fst s.snd.fst ↑s.snd.snd ⋯) fun x_1 => x) fun x => y) =
  (p n) (t.piecewise (fun x_1 => x) fun x => y)


@[to_additive] lemma div (ha : IsUnit a) (hb : IsUnit b) : IsUnit (a / b)

{α : Type u}
[SubtractionMonoid α]
{a b : α}
(ha : IsAddUnit a)
(hb : IsAddUnit b)


/-- The family `(k, l) : ℕ × ℕ ↦ f k * g l` is summable if and only if the family
`(n, k, l) : Σ (n : ℕ), antidiagonal n ↦ f k * g l` is summable. -/
theorem summable_mul_prod_iff_summable_mul_sigma_antidiagonal :
    (Summable fun x : A × A ↦ f x.1 * g x.2) ↔
      Summable fun x : Σn : A, antidiagonal n ↦ f (x.2 : A × A).1 * g (x.2 : A × A).2

{α : Type u_4}
{A : Type u_5}
[AddCommMonoid A]
[Finset.HasAntidiagonal A]
[TopologicalSpace α]
[NonUnitalNonAssocSemiring α]
{f g : A → α}

(Summable fun x => f x.1 * g x.2) ↔ Summable fun x => f (↑x.snd).1 * g (↑x.snd).2


/-- `Subtype.val` as a bundled monotone function.  -/
@[simps (config := .asFn)]
def Subtype.val (p : α → Prop) : Subtype p →o α

{α : Type u_2}
[Preorder α]
(p : α → Prop)


theorem isUnit_of_dvd_one {a : α} (h : a ∣ 1) : IsUnit (a : α)

{α : Type u_1}
[CommMonoid α]
{a : α}
(h : a ∣ 1)


/-- Subtracting the first vector passed to `oangle` from the second vector then swapping the
vectors does not change the sign of the angle. -/
@[simp]
theorem oangle_sign_sub_right_swap (x y : V) : (o.oangle y (y - x)).sign = (o.oangle x y).sign

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


/-- If `B : M → N → Pₗ` is `R`-`S` bilinear and `R'` and `S'` are compatible scalar multiplications,
then the restriction of scalars is a `R'`-`S'` bilinear map. -/
@[simps!]
def restrictScalars (Q : QuadraticMap R M N) : QuadraticMap S M N

{S : Type u_1}
{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[CommSemiring S]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
[Module S M]
[Module S N]
[Algebra S R]
[IsScalarTower S R M]
[IsScalarTower S R N]
(Q : QuadraticMap R M N)
(x : M)


/-- Two n-simplices among cospherical points in an n-dimensional
subspace have the same circumcenter. -/
theorem circumcenter_eq_of_cospherical_subset {s : AffineSubspace ℝ P} {ps : Set P} (h : ps ⊆ s)
    [Nonempty s] {n : ℕ} [FiniteDimensional ℝ s.direction] (hd : finrank ℝ s.direction = n)
    (hc : Cospherical ps) {sx₁ sx₂ : Simplex ℝ P n} (hsx₁ : Set.range sx₁.points ⊆ ps)
    (hsx₂ : Set.range sx₂.points ⊆ ps) : sx₁.circumcenter = sx₂.circumcenter

(hd : FiniteDimensional.finrank ℝ ↥s.direction = n)


@[reassoc, simp]
theorem fun_inv_map (e : C ≌ D) (X Y : D) (f : X ⟶ Y) :
    e.functor.map (e.inverse.map f) = e.counit.app X ≫ f ≫ e.counitInv.app Y

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

e.functor.map (e.inverse.map f) =
  CategoryTheory.CategoryStruct.comp (e.counit.app X) (CategoryTheory.CategoryStruct.comp f (e.counitInv.app Y))


theorem inducing_totalSpaceMk_of_inducing_comp (b : B)
    (h : Inducing (a.pretrivializationAt b ∘ TotalSpace.mk b)) :
    @Inducing _ _ _ a.totalSpaceTopology (TotalSpace.mk b)

(h : Inducing (↑(a.pretrivializationAt b) ∘ Bundle.TotalSpace.mk b))


lemma isLeftKanExtension_iff_precomp (α : F ⟶ L ⋙ F') :
    F'.IsLeftKanExtension α ↔ F'.IsLeftKanExtension
      (whiskerLeft G α ≫ (Functor.associator _ _ _).inv)

F'.IsLeftKanExtension α ↔
  F'.IsLeftKanExtension (CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerLeft G α) (G.associator L F').inv)


lemma bddAbove_prod {s : Set (α × β)} :
    BddAbove s ↔ BddAbove (Prod.fst '' s) ∧ BddAbove (Prod.snd '' s)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{s : Set (α × β)}


theorem nhdsWithin_inter' (a : α) (s t : Set α) : 𝓝[s ∩ t] a = 𝓝[s] a ⊓ 𝓟 t

{α : Type u_1}
[TopologicalSpace α]
(a : α)
(s t : Set α)


@[simp]
theorem frobeniusEquiv_symm_pow_p (x : R) : ((frobeniusEquiv R p).symm x) ^ p = x

(R : Type u_1)
(p : ℕ)
[CommSemiring R]
[ExpChar R p]
[PerfectRing R p]
(x : R)


theorem log_stirlingSeq_formula (n : ℕ) :
    log (stirlingSeq n) = Real.log n ! - 1 / 2 * Real.log (2 * n) - n * log (n / exp 1)

Real.log (Stirling.stirlingSeq n) = Real.log ↑n ! - 1 / 2 * Real.log (2 * ↑n) - ↑n * Real.log (↑n / rexp 1)


theorem restrict_eq_self_of_ae_mem {_m0 : MeasurableSpace α} ⦃s : Set α⦄ ⦃μ : Measure α⦄
    (hs : ∀ᵐ x ∂μ, x ∈ s) : μ.restrict s = μ

{α : Type u_2}
{_m0 : MeasurableSpace α}
⦃s : Set α⦄
⦃μ : MeasureTheory.Measure α⦄
(hs : ∀ᵐ (x : α) ∂μ, x ∈ s)


@[simp, norm_cast]
theorem coe_pos {x : ℝ} : 0 < (x : ℝ*) ↔ 0 < x


/-- See also `LieModule.iInf_lowerCentralSeries_eq_posFittingComp`. -/
lemma iSup_ucs_eq_weightSpace_zero [IsNoetherian R M] :
    ⨆ k, (⊥ : LieSubmodule R L M).ucs k = weightSpace M (0 : L → R)

(R : Type u_2)
(L : Type u_3)
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsNilpotent R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[IsNoetherian R M]

⨆ k, LieSubmodule.ucs k ⊥ = LieModule.weightSpace M 0


@[simp, norm_cast]
theorem coe_max (e₁ e₂ : ENorm 𝕜 V) : ⇑(e₁ ⊔ e₂) = fun x => max (e₁ x) (e₂ x)

{𝕜 : Type u_1}
{V : Type u_2}
[NormedField 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
(e₁ e₂ : ENorm 𝕜 V)

↑(e₁ ⊔ e₂) = fun x => max (↑e₁ x) (↑e₂ x)


theorem beth_limit {o : Ordinal} : o.IsLimit → beth o = ⨆ a : Iio o, beth a

o.IsLimit → Cardinal.beth o = ⨆ a, Cardinal.beth ↑a


/-- Radon-Nikodym derivative of the scalar multiple of a measure.
See also `rnDeriv_smul_left_of_ne_top`, which has no hypothesis on `μ` but requires finite `ν`. -/
theorem rnDeriv_smul_left_of_ne_top' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ]
    {r : ℝ≥0∞} (hr : r ≠ ∞) :
    (r • ν).rnDeriv μ =ᵐ[μ] r • ν.rnDeriv μ

{α : Type u_1}
{m : MeasurableSpace α}
(ν μ : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite ν]
[MeasureTheory.SigmaFinite μ]
{r : ℝ≥0∞}
(hr : r ≠ ⊤)


theorem continuousOn_prod_of_discrete_right [DiscreteTopology β] {f : α × β → γ} {s : Set (α × β)} :
    ContinuousOn f s ↔ ∀ b, ContinuousOn (f ⟨·, b⟩) {a | (a, b) ∈ s}

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
[DiscreteTopology β]
{f : α × β → γ}
{s : Set (α × β)}

ContinuousOn f s ↔ ∀ (b : β), ContinuousOn (fun x => f (x, b)) {a | (a, b) ∈ s}


theorem extend_coe : ⇑(f.extend I) = I ∘ f

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


/-- The forgetful functor from `PresheafedSpace` to `TopCat`. -/
@[simps]
def forget : PresheafedSpace C ⥤ TopCat

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

∀ {X Y : AlgebraicGeometry.PresheafedSpace C} (f : X ⟶ Y), (AlgebraicGeometry.PresheafedSpace.forget C).map f = f.base


theorem subsingleton_of_finrank_adjoin_eq_one (h : ∀ x : E, finrank F F⟮x⟯ = 1) :
    Subsingleton (IntermediateField F E)

(h : ∀ (x : E), FiniteDimensional.finrank F ↥F⟮x⟯ = 1)


theorem liftpPreservation_iff_uniform : q.LiftPPreservation ↔ q.IsUniform

{n : ℕ}
{F : TypeVec.{u} n → Type u_1}
[q : MvQPF F]


@[mono]
theorem toAddSubmonoid_mono : Monotone (toAddSubmonoid : Submodule R M → AddSubmonoid M)

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]


theorem isInt_le_false [OrderedRing α] [Nontrivial α] {a b : α} {a' b' : ℤ}
    (ha : IsInt a a') (hb : IsInt b b') (h : decide (b' < a')) : ¬a ≤ b

{α : Type u_1}
[OrderedRing α]
[Nontrivial α]
{a b : α}
{a' b' : ℤ}
(ha : Mathlib.Meta.NormNum.IsInt a a')
(hb : Mathlib.Meta.NormNum.IsInt b b')
(h : decide (b' < a') = true)


theorem of_equiv [FormallyEtale R A] (e : A ≃ₐ[R] B) : FormallyEtale R B

{R : Type u}
[CommSemiring R]
{A B : Type u}
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[Algebra.FormallyEtale R A]
(e : A ≃ₐ[R] B)


theorem not_forall_not : (¬∀ x, ¬p x) ↔ ∃ x, p x


@[simp]
theorem add_top (a : α) : a + ⊤ = ⊤

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


@[simp]
theorem KaehlerDifferential.map_D (x : A) :
    KaehlerDifferential.map R S A B (KaehlerDifferential.D R A x) =
      KaehlerDifferential.D S B (algebraMap A B x)

(R : Type u)
(S : Type v)
[CommRing R]
[CommRing S]
[Algebra R S]
(A : Type u_2)
(B : Type u_3)
[CommRing A]
[CommRing B]
[Algebra R A]
[Algebra R B]
[Algebra A B]
[Algebra S B]
[IsScalarTower R A B]
[IsScalarTower R S B]
[SMulCommClass S A B]
(x : A)

(KaehlerDifferential.map R S A B) ((KaehlerDifferential.D R A) x) = (KaehlerDifferential.D S B) ((algebraMap A B) x)


@[simp]
theorem basicOpen_zero : basicOpen 𝒜 (0 : A) = ⊥

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


@[simp]
theorem _root_.Module.End.ofNat_apply (n : ℕ) [n.AtLeastTwo] (m : M) :
    (no_index (OfNat.ofNat n) : Module.End R M) m = OfNat.ofNat n • m

{R : Type u_1}
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(n : ℕ)
[n.AtLeastTwo]
(m : M)


/-- See `lt_tsub_iff_left_of_le_of_le` for a weaker statement in a partial order. -/
theorem tsub_lt_tsub_iff_left_of_le (h : b ≤ a) : a - b < a - c ↔ c < b

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


theorem splits_of_degree_le_one {f : K[X]} (hf : degree f ≤ 1) : Splits i f

{K : Type v}
{L : Type w}
[CommRing K]
[Field L]
(i : K →+* L)
{f : K[X]}
(hf : f.degree ≤ 1)


/-- Given an open cover on `X`, we may pull them back along a morphism `W ⟶ X` to obtain
an open cover of `W`. -/
@[simps]
def OpenCover.pullbackCover {X W : Scheme.{u}} (𝒰 : X.OpenCover) (f : W ⟶ X) :
    W.OpenCover

{X W : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(f : W ⟶ X)
(x : ↑↑W.toPresheafedSpace)

(𝒰.pullbackCover f).f x = 𝒰.f (f.val.base x)


@[simp]
theorem top_add (a : WithTop α) : ⊤ + a = ⊤


/-- The data needed to induce a `MonoidalCategory` via the functor `F`; namely, pre-existing
definitions of `⊗`, `𝟙_`, `▷`, `◁` that are preserved by `F`.
-/
structure InducingFunctorData [MonoidalCategoryStruct D] (F : D ⥤ C) where
  /-- Analogous to `CategoryTheory.LaxMonoidalFunctor.μIso` -/
  μIso : ∀ X Y,
    F.obj X ⊗ F.obj Y ≅ F.obj (X ⊗ Y)
  whiskerLeft_eq : ∀ (X : D) {Y₁ Y₂ : D} (f : Y₁ ⟶ Y₂),
    F.map (X ◁ f) = (μIso _ _).inv ≫ (F.obj X ◁ F.map f) ≫ (μIso _ _).hom := by
    aesop_cat
  whiskerRight_eq : ∀ {X₁ X₂ : D} (f : X₁ ⟶ X₂) (Y : D),
    F.map (f ▷ Y) = (μIso _ _).inv ≫ (F.map f ▷ F.obj Y) ≫ (μIso _ _).hom := by
    aesop_cat
  tensorHom_eq : ∀ {X₁ Y₁ X₂ Y₂ : D} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂),
    F.map (f ⊗ g) = (μIso _ _).inv ≫ (F.map f ⊗ F.map g) ≫ (μIso _ _).hom := by
    aesop_cat
  /-- Analogous to `CategoryTheory.LaxMonoidalFunctor.εIso` -/
  εIso : 𝟙_ _ ≅ F.obj (𝟙_ _)
  associator_eq : ∀ X Y Z : D,
    F.map (α_ X Y Z).hom =
      (((μIso _ _).symm ≪≫ ((μIso _ _).symm ⊗ .refl _))
        ≪≫ α_ (F.obj X) (F.obj Y) (F.obj Z)
        ≪≫ ((.refl _ ⊗ μIso _ _) ≪≫ μIso _ _)).hom := by
    aesop_cat
  leftUnitor_eq : ∀ X : D,
    F.map (λ_ X).hom =
      (((μIso _ _).symm ≪≫ (εIso.symm ⊗ .refl _)) ≪≫ λ_ (F.obj X)).hom := by
    aesop_cat
  rightUnitor_eq : ∀ X : D,
    F.map (ρ_ X).hom =
      (((μIso _ _).symm ≪≫ (.refl _ ⊗ εIso.symm)) ≪≫ ρ_ (F.obj X)).hom := by
    aesop_cat

(self : CategoryTheory.Monoidal.InducingFunctorData F)

F.map (α_ X Y Z).hom =
  (((self.μIso (X ⊗ Y) Z).symm ≪≫ ((self.μIso X Y).symm ⊗ CategoryTheory.Iso.refl (F.obj Z))) ≪≫
      α_ (F.obj X) (F.obj Y) (F.obj Z) ≪≫
        (CategoryTheory.Iso.refl (F.obj X) ⊗ self.μIso Y Z) ≪≫ self.μIso X (Y ⊗ Z)).hom


theorem Lex.acc_of_single_erase [DecidableEq ι] {x : Π₀ i, α i} (i : ι)
    (hs : Acc (DFinsupp.Lex r s) <| single i (x i)) (hu : Acc (DFinsupp.Lex r s) <| x.erase i) :
    Acc (DFinsupp.Lex r s) x

(hs : Acc (DFinsupp.Lex r s) (DFinsupp.single i (x i)))

(hu : Acc (DFinsupp.Lex r s) (DFinsupp.erase i x))


@[to_additive (attr := simp)]
theorem symm_trans_self (e : M ≃* N) : e.symm.trans e = refl N

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


/-- The opcycles functor `ShortComplex C ⥤ C` which sends a short complex `S` to `S.opcycles`
which is a cokernel of `S.f : S.X₁ ⟶ S.X₂`. -/
@[simps]
noncomputable def opcyclesFunctor :
    ShortComplex C ⥤ C

∀ {X Y : CategoryTheory.ShortComplex C} (φ : X ⟶ Y),
  (CategoryTheory.ShortComplex.opcyclesFunctor C).map φ = CategoryTheory.ShortComplex.opcyclesMap φ


theorem compl (h : NullMeasurableSet s μ) : NullMeasurableSet sᶜ μ

(h : MeasureTheory.NullMeasurableSet s μ)


@[simp]
theorem nmul_zero (a) : a ⨳ 0 = 0


theorem mem_thickening_iff_infEdist_lt : x ∈ thickening δ s ↔ infEdist x s < ENNReal.ofReal δ

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

x ∈ Metric.thickening δ s ↔ EMetric.infEdist x s < ENNReal.ofReal δ


lemma uIcc_subset_uIcc_left (h : x ∈ [[a, b]]) : [[a, x]] ⊆ [[a, b]]

{α : Type u_1}
[Lattice α]
{a b x : α}
(h : x ∈ Set.uIcc a b)


theorem integral_univ : ∫ x in univ, f x ∂μ = ∫ x, f x ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → E}
{μ : MeasureTheory.Measure X}

∫ (x : X) in Set.univ, f x ∂μ = ∫ (x : X), f x ∂μ


/-- A linear map is concave. -/
theorem LinearMap.concaveOn (f : E →ₗ[𝕜] β) {s : Set E} (hs : Convex 𝕜 s) : ConcaveOn 𝕜 s f

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[Module 𝕜 β]
(f : E →ₗ[𝕜] β)
{s : Set E}
(hs : Convex 𝕜 s)


@[ext]
theorem ext {f g : RingTopology α} (h : f.IsOpen = g.IsOpen) : f = g

(h : TopologicalSpace.IsOpen = TopologicalSpace.IsOpen)


@[deprecated Subalgebra.finite_sup (since := "2024-04-11")]
theorem Subalgebra.finiteDimensional_sup {K L : Type*} [Field K] [CommRing L] [Algebra K L]
    (E1 E2 : Subalgebra K L) [FiniteDimensional K E1] [FiniteDimensional K E2] :
    FiniteDimensional K (E1 ⊔ E2 : Subalgebra K L)

{K : Type u_1}
{L : Type u_2}
[Field K]
[CommRing L]
[Algebra K L]
(E1 E2 : Subalgebra K L)
[FiniteDimensional K ↥E1]
[FiniteDimensional K ↥E2]


@[simp]
theorem liftAddHom_tmul (f : M →+ N →+ P)
    (hf : ∀ (r : R) (m : M) (n : N), f (r • m) n = f m (r • n)) (m : M) (n : N) :
    liftAddHom f hf (m ⊗ₜ n) = f m n

(TensorProduct.liftAddHom f hf) (m ⊗ₜ[R] n) = (f m) n


@[simp]
theorem iterate_derivative_comp_one_sub_X (p : R[X]) (k : ℕ) :
    derivative^[k] (p.comp (1 - X)) = (-1) ^ k * (derivative^[k] p).comp (1 - X)

{R : Type u}
[CommRing R]
(p : R[X])
(k : ℕ)

(⇑Polynomial.derivative)^[k] (p.comp (1 - Polynomial.X)) =
  (-1) ^ k * ((⇑Polynomial.derivative)^[k] p).comp (1 - Polynomial.X)


/-- The cardinality of a quaternion algebra, as a type. -/
theorem mk_quaternionAlgebra : #(ℍ[R,c₁,c₂]) = #R ^ 4

Cardinal.mk ℍ[R,c₁,c₂] = Cardinal.mk R ^ 4


lemma filter_biUnion (s : Finset α) (f : α → Finset β) (p : β → Prop) [DecidablePred p] :
    (s.biUnion f).filter p = s.biUnion fun a ↦ (f a).filter p

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(s : Finset α)
(f : α → Finset β)
(p : β → Prop)
[DecidablePred p]

Finset.filter p (s.biUnion f) = s.biUnion fun a => Finset.filter p (f a)


@[simp]
theorem trans_apply (f : α ≃+*o β) (g : β ≃+*o γ) (a : α) : f.trans g a = g (f a)

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


theorem map_le_sum {ι : Type*} {s : Finset ι} {f : ι → R} {g : Γ₀} (hf : ∀ i ∈ s, g ≤ v (f i)) :
    g ≤ v (∑ i ∈ s, f i)

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedAddCommMonoidWithTop Γ₀]
(v : AddValuation R Γ₀)
{ι : Type u_6}
{s : Finset ι}
{f : ι → R}
{g : Γ₀}
(hf : ∀ i ∈ s, g ≤ v (f i))


@[simp]
theorem sumCoords_self_apply : b.sumCoords (b i) = 1

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)
(i : ι)


lemma negOnePow_odd (n : ℤ) (hn : Odd n) : n.negOnePow = -1


theorem gcd_mul_gcd_eq_iff_dvd_mul_of_coprime (hcop : Coprime n m) :
    gcd x n * gcd x m = x ↔ x ∣ n * m


@[reassoc] -- Porting note: both versions proven by simp
theorem biproduct.ι_π_self (f : J → C) [HasBiproduct f] (j : J) :
    biproduct.ι f j ≫ biproduct.π f j = 𝟙 _

CategoryTheory.Limits.biproduct.ι f j ≫ CategoryTheory.Limits.biproduct.π f j = 𝟙 (f j)


theorem iUnion_Ioc_add_zsmul : ⋃ n : ℤ, Ioc (a + n • p) (a + (n + 1) • p) = univ

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

⋃ n, Set.Ioc (a + n • p) (a + (n + 1) • p) = Set.univ


@[simp]
theorem preimage_neg_Ici : -Ici a = Iic (-a)

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


@[to_additive]
theorem fst_surjective : Surjective (fst : M ∗ N →* M)

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


theorem Finite.surjOn_iff_bijOn_of_mapsTo (hs : s.Finite) (hm : MapsTo f s s) :
    SurjOn f s s ↔ BijOn f s s

{α : Type u}
{s : Set α}
{f : α → α}
(hs : s.Finite)
(hm : Set.MapsTo f s s)


lemma cfcHom_predicate (f : C(spectrum R a, R)) :
    p (cfcHom ha f)

{R : Type u_1}
{A : Type u_2}
{p : A → Prop}
[CommSemiring R]
[StarRing R]
[MetricSpace R]
[TopologicalSemiring R]
[ContinuousStar R]
[TopologicalSpace A]
[Ring A]
[StarRing A]
[Algebra R A]
[ContinuousFunctionalCalculus R p]
{a : A}
(ha : p a)
(f : C(↑(spectrum R a), R))


@[to_additive (attr := simp)]
lemma inf_one [SemilatticeInf β] [OrderTop β] (f : α → β) : inf 1 f = f 1

{α : Type u_2}
{β : Type u_3}
[One α]
[SemilatticeInf β]
[OrderTop β]
(f : α → β)


lemma adjunction_unit_map_basicOpen (X : Scheme.{u}) (r : Γ(X, ⊤)) :
    (ΓSpec.adjunction.unit.app X ⁻¹ᵁ (PrimeSpectrum.basicOpen r)) = X.basicOpen r

(X : AlgebraicGeometry.Scheme)
(r : ↑(X.presheaf.obj (Opposite.op ⊤)))

(TopologicalSpace.Opens.map (AlgebraicGeometry.ΓSpec.adjunction.unit.app X).val.base).obj (PrimeSpectrum.basicOpen r) =
  X.basicOpen r


theorem coeff_add_of_eq {n : ℕ} {a b : R} {f g : R[X]}
    (h_add_left : f.coeff n = a) (h_add_right : g.coeff n = b) :
    (f + g).coeff n = a + b

{R : Type u_1}
[Semiring R]
{n : ℕ}
{a b : R}
{f g : R[X]}
(h_add_left : f.coeff n = a)
(h_add_right : g.coeff n = b)


theorem eq_right_iff_getRight_eq {b : β} : x = inr b ↔ ∃ h, x.getRight h = b

{α : Type u}
{β : Type v}
{x : α ⊕ β}
{b : β}


@[to_additive (attr := simp)]
theorem prod_zero_index {h : α → M → N} : (0 : α →₀ M).prod h = 1

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[Zero M]
[CommMonoid N]
{h : α → M → N}


theorem ne_none_iff_exists : o ≠ none ↔ ∃ x, some x = o

∀ {α : Type u_1} {o : Option α}, o ≠ none ↔ ∃ x, some x = o


/-- **Jensen's inequality**: if a function `g : E → ℝ` is concave and continuous on a convex closed
set `s`, `μ` is a finite non-zero measure on `α`, and `f : α → E` is a function sending
`μ`-a.e. points of a set `t` to `s`, then the average value of `g ∘ f` over `t` is less than or
equal to the value of `g` at the average value of `f` over `t` provided that both `f` and `g ∘ f`
are integrable. -/
theorem ConcaveOn.set_average_mem_hypograph (hg : ConcaveOn ℝ s g) (hgc : ContinuousOn g s)
    (hsc : IsClosed s) (h0 : μ t ≠ 0) (ht : μ t ≠ ∞) (hfs : ∀ᵐ x ∂μ.restrict t, f x ∈ s)
    (hfi : IntegrableOn f t μ) (hgi : IntegrableOn (g ∘ f) t μ) :
    (⨍ x in t, f x ∂μ, ⨍ x in t, g (f x) ∂μ) ∈ {p : E × ℝ | p.1 ∈ s ∧ p.2 ≤ g p.1}

(hfs : ∀ᵐ (x : α) ∂μ.restrict t, f x ∈ s)

(hfi : MeasureTheory.IntegrableOn f t μ)

(hgi : MeasureTheory.IntegrableOn (g ∘ f) t μ)

(⨍ (x : α) in t, f x ∂μ, ⨍ (x : α) in t, g (f x) ∂μ) ∈ {p | p.1 ∈ s ∧ p.2 ≤ g p.1}


theorem FinitaryExtensive.isPullback_initial_to_binaryCofan [FinitaryExtensive C]
    {c : BinaryCofan X Y} (hc : IsColimit c) :
    IsPullback (initial.to _) (initial.to _) c.inl c.inr

{c : CategoryTheory.Limits.BinaryCofan X Y}

(hc : CategoryTheory.Limits.IsColimit c)

CategoryTheory.IsPullback
  (CategoryTheory.Limits.initial.to
    ((CategoryTheory.Limits.pair X Y).obj { as := CategoryTheory.Limits.WalkingPair.left }))
  (CategoryTheory.Limits.initial.to
    ((CategoryTheory.Limits.pair X Y).obj { as := CategoryTheory.Limits.WalkingPair.right }))
  c.inl c.inr


@[simp] lemma Fintype.card_additive (α : Type*) [Fintype α] : card (Additive α) = card α

Fintype.card (Additive α) = Fintype.card α


theorem aeval_eq_sum_range' [Algebra R S] {p : R[X]} {n : ℕ} (hn : p.natDegree < n) (x : S) :
    aeval x p = ∑ i ∈ Finset.range n, p.coeff i • x ^ i

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
{p : R[X]}
{n : ℕ}
(hn : p.natDegree < n)
(x : S)

(Polynomial.aeval x) p = ∑ i ∈ Finset.range n, p.coeff i • x ^ i


@[to_additive]
theorem univ_mul_of_one_mem (ht : (1 : α) ∈ t) : univ * t = univ

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


theorem eval₂_C_X_eq_coe : φ.eval₂ (PowerSeries.C R) PowerSeries.X = ↑φ

{R : Type u_2}
[CommSemiring R]
(φ : Polynomial R)

Polynomial.eval₂ (PowerSeries.C R) PowerSeries.X φ = ↑φ


/-- A `parallelepiped` is the convex hull of its vertices -/
theorem parallelepiped_eq_convexHull (v : ι → E) :
    parallelepiped v = convexHull ℝ (∑ i, {(0 : E), v i})

{ι : Type u_1}
{E : Type u_3}
[Fintype ι]
[AddCommGroup E]
[Module ℝ E]
(v : ι → E)

parallelepiped v = (convexHull ℝ) (∑ i : ι, {0, v i})


theorem not_le_of_lt [Preorder α] {a b : α} (h : a < b) : ¬b ≤ a

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


lemma CompleteOrthogonalIdempotents.prod_one_sub (he : CompleteOrthogonalIdempotents e) :
    ∏ i, (1 - e i) = 0

{R : Type u_1}
[CommRing R]
{I : Type u_3}
[Fintype I]
{e : I → R}
(he : CompleteOrthogonalIdempotents e)


theorem ContinuousOn.arsinh (h : ContinuousOn f s) : ContinuousOn (fun x => arsinh (f x)) s

{X : Type u_1}
[TopologicalSpace X]
{f : X → ℝ}
{s : Set X}
(h : ContinuousOn f s)

ContinuousOn (fun x => Real.arsinh (f x)) s


@[simp]
theorem FractionalIdeal.coe_mk0 [IsDedekindDomain R] (I : (Ideal R)⁰) :
    (FractionalIdeal.mk0 K I : FractionalIdeal R⁰ K) = I

{R : Type u_1}
(K : Type u_2)
[CommRing R]
[Field K]
[Algebra R K]
[IsFractionRing R K]
[IsDomain R]
[IsDedekindDomain R]
(I : ↥(Ideal R)⁰)


@[simp]
theorem nonempty_Iic : (Iic a).Nonempty


theorem Finite.preimage_embedding {s : Set β} (f : α ↪ β) (h : s.Finite) : (f ⁻¹' s).Finite

{α : Type u}
{β : Type v}
{s : Set β}
(f : α ↪ β)
(h : s.Finite)


@[simp]
theorem toMulHom_eq_coe (f : A →ₛₙₐ[φ] B) : f.toMulHom = ↑f

{R : Type u}
{S : Type u₁}
[Monoid R]
[Monoid S]
{φ : R →* S}
{A : Type v}
{B : Type w}
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction S B]
(f : A →ₛₙₐ[φ] B)


lemma mul_mem_smul_iff {S} [CommRing S] [Algebra R S] {x : S} {p : Submodule R S} {y : S}
    (hx : x ∈ nonZeroDivisors S) :
    x * y ∈ x • p ↔ y ∈ p

{R : Type u}
[CommSemiring R]
{S : Type u_1}
[CommRing S]
[Algebra R S]
{x : S}
{p : Submodule R S}
{y : S}
(hx : x ∈ nonZeroDivisors S)


theorem disjoint_of_disjoint_append_right_left (d : Disjoint l (l₁ ++ l₂)) : Disjoint l l₁

∀ {α : Type u_1} {l l₁ l₂ : List α}, l.Disjoint (l₁ ++ l₂) → l.Disjoint l₁


lemma locallyRingedSpaceAdjunction_homEquiv_apply'
    {X : LocallyRingedSpace} {R : Type u} [CommRing R]
    (f : CommRingCat.of R ⟶ Γ.obj <| op X) :
    locallyRingedSpaceAdjunction.homEquiv X (op <| CommRingCat.of R) (op f) =
      identityToΓSpec.app X ≫ Spec.locallyRingedSpaceMap f

(f : CommRingCat.of R ⟶ AlgebraicGeometry.LocallyRingedSpace.Γ.obj (Opposite.op X))

(AlgebraicGeometry.ΓSpec.locallyRingedSpaceAdjunction.homEquiv X (Opposite.op (CommRingCat.of R))) (Opposite.op f) =
  CategoryTheory.CategoryStruct.comp (AlgebraicGeometry.identityToΓSpec.app X)
    (AlgebraicGeometry.Spec.locallyRingedSpaceMap f)


theorem of_mem_filter {a : α} {s} (h : a ∈ filter p s) : p a

{α : Type u_1}
{p : α → Prop}
[DecidablePred p]
{a : α}
{s : Multiset α}
(h : a ∈ Multiset.filter p s)


@[simp]
lemma biprod_isZero_iff (A B : C) [HasBinaryBiproduct A B] :
    IsZero (biprod A B) ↔ IsZero A ∧ IsZero B

CategoryTheory.Limits.IsZero (A ⊞ B) ↔ CategoryTheory.Limits.IsZero A ∧ CategoryTheory.Limits.IsZero B


theorem Continuous.integrableOn_Icc [Preorder X] [CompactIccSpace X] [T2Space X]
    (hf : Continuous f) : IntegrableOn f (Icc a b) μ

MeasureTheory.IntegrableOn f (Set.Icc a b) μ


theorem isBigOWith_abs_abs :
    (IsBigOWith c l (fun x => |u x|) fun x => |v x|) ↔ IsBigOWith c l u v

{α : Type u_1}
{c : ℝ}
{l : Filter α}
{u v : α → ℝ}

(Asymptotics.IsBigOWith c l (fun x => |u x|) fun x => |v x|) ↔ Asymptotics.IsBigOWith c l u v


theorem range_inl : range (@Sum.inl α β) = {x | Sum.isLeft x}

Set.range Sum.inl = {x | x.isLeft = true}


theorem stmts₁_self {q : Stmt₂} : q ∈ stmts₁ q

{K : Type u_1}
{Γ : K → Type u_2}
{Λ : Type u_3}
{σ : Type u_4}
{q : Turing.TM2.Stmt Γ Λ σ}


/-- If `e : C ≌ D` is an equivalence of categories, and `iso : e.functor ≅ G` is
an isomorphism, then there is an equivalence of categories whose inverse is `G`. -/
@[simps!]
def changeInverse (e : C ≌ D) {G : D ⥤ C} (iso : e.inverse ≅ G) : C ≌ D

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(e : C ≌ D)
{G : CategoryTheory.Functor D C}
(iso : e.inverse ≅ G)
(X : D)

(e.changeInverse iso).counitIso.hom.app X =
  CategoryTheory.CategoryStruct.comp (e.functor.map (iso.inv.app X)) (e.counitIso.hom.app X)


@[simp] lemma antitone_vecCons : Antitone (vecCons a f) ↔ f 0 ≤ a ∧ Antitone f

{α : Type u_1}
[Preorder α]
{n : ℕ}
{f : Fin (n + 1) → α}
{a : α}

Antitone (Matrix.vecCons a f) ↔ f 0 ≤ a ∧ Antitone f


/-- Values of a multiplicative norm of the rationals coincide on ℕ if and only if they coincide
on `ℤ`. -/
lemma eq_on_nat_iff_eq_on_Int : (∀ n : ℕ , f n = g n) ↔ (∀ n : ℤ , f n = g n)

(∀ (n : ℕ), f ↑n = g ↑n) ↔ ∀ (n : ℤ), f ↑n = g ↑n


@[to_additive (attr := fun_prop) sub]
theorem ContinuousAt.div' {f g : α → G} {x : α} (hf : ContinuousAt f x) (hg : ContinuousAt g x) :
    ContinuousAt (fun x => f x / g x) x

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[Div G]
[ContinuousDiv G]
[TopologicalSpace α]
{f g : α → G}
{x : α}
(hf : ContinuousAt f x)
(hg : ContinuousAt g x)


@[to_additive (attr := simp)]
theorem toTopologicalSpace_sInf (s : Set (GroupTopology α)) :
    (sInf s).toTopologicalSpace = sInf (toTopologicalSpace '' s)

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

(sInf s).toTopologicalSpace = sInf (GroupTopology.toTopologicalSpace '' s)


/-- Given a graph embedding, map paths to paths. -/
@[simps!]
protected def mapEmbedding (f : G ↪g G') {u v : V} (p : G.Path u v) : G'.Path (f u) (f v)

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

↑(SimpleGraph.Path.mapEmbedding f p) = SimpleGraph.Walk.map f.toHom ↑p


@[to_additive (attr := simp)]
lemma antivaryOn_inv_left : AntivaryOn f⁻¹ g s ↔ MonovaryOn f g s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedCommGroup α]
[OrderedCommGroup β]
{s : Set ι}
{f : ι → α}
{g : ι → β}


lemma lt_add_of_lt {q r₁ r₂ : ℚ} (hqr : r₁ + r₂ ≠ 0)
    (hval₁ : padicValRat p q < padicValRat p r₁) (hval₂ : padicValRat p q < padicValRat p r₂) :
    padicValRat p q < padicValRat p (r₁ + r₂)


lemma IsIntegralCurve.comp_add (hγ : IsIntegralCurve γ v) (dt : ℝ) :
    IsIntegralCurve (γ ∘ (· + dt)) v

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type u_2}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type u_3}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{γ : ℝ → M}
{v : (x : M) → TangentSpace I x}
(hγ : IsIntegralCurve γ v)
(dt : ℝ)


/-- The function `oddKernel a` has exponential decay at `+∞`, for any `a`. -/
lemma isBigO_atTop_oddKernel (a : UnitAddCircle) :
    ∃ p, 0 < p ∧ IsBigO atTop (oddKernel a) (fun x ↦ Real.exp (-p * x))

∃ p, 0 < p ∧ HurwitzZeta.oddKernel a =O[Filter.atTop] fun x => rexp (-p * x)


/-- The identity is a group homomorphism. -/
@[to_additive "The identity is an additive group homomorphism."]
theorem id : IsGroupHom (@id α)


@[nolint unusedHavesSuffices] -- false positive from unfolding String.takeWhileAux
theorem takeWhileAux_of_valid (p : Char → Bool) : ∀ l m r,
    Substring.takeWhileAux ⟨l ++ m ++ r⟩ ⟨utf8Len l + utf8Len m⟩ p ⟨utf8Len l⟩ =
      ⟨utf8Len l + utf8Len (m.takeWhile p)⟩

Substring.takeWhileAux { data := l ++ m ++ r } { byteIdx := String.utf8Len l + String.utf8Len m } p
    { byteIdx := String.utf8Len l } =
  { byteIdx := String.utf8Len l + String.utf8Len (List.takeWhile p m) }


theorem tendsto_id {x : Filter α} : Tendsto id x x


@[simp] lemma inv_nhdsWithin_Ioi_zero : (𝓝[>] (0 : 𝕜))⁻¹ = atTop

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]


@[to_additive]
theorem ediam_mul_le (x y : Set E) : EMetric.diam (x * y) ≤ EMetric.diam x + EMetric.diam y

{E : Type u_1}
[SeminormedAddCommGroup E]
(x y : Set E)

EMetric.diam (x + y) ≤ EMetric.diam x + EMetric.diam y


@[reassoc]
theorem rightUnitor_inv_naturality {f g : a ⟶ b} (η : f ⟶ g) :
    η ≫ (ρ_ g).inv = (ρ_ f).inv ≫ η ▷ 𝟙 b

{B : Type u}
[CategoryTheory.Bicategory B]
{a b : B}
{f g : a ⟶ b}
(η : f ⟶ g)

CategoryTheory.CategoryStruct.comp η (CategoryTheory.Bicategory.rightUnitor g).inv =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.rightUnitor f).inv
    (CategoryTheory.Bicategory.whiskerRight η (CategoryTheory.CategoryStruct.id b))


theorem iUnion₂_inter (s : ∀ i, κ i → Set α) (t : Set α) :
    (⋃ (i) (j), s i j) ∩ t = ⋃ (i) (j), s i j ∩ t

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_7}
(s : (i : ι) → κ i → Set α)
(t : Set α)

(⋃ i, ⋃ j, s i j) ∩ t = ⋃ i, ⋃ j, s i j ∩ t


protected theorem Set.EquicontinuousAt.continuousAt_of_mem {H : Set <| X → α} {x₀ : X}
    (h : H.EquicontinuousAt x₀) {f : X → α} (hf : f ∈ H) : ContinuousAt f x₀

{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
{H : Set (X → α)}
{x₀ : X}
(h : H.EquicontinuousAt x₀)
{f : X → α}
(hf : f ∈ H)


/-- Convolution of the dirac measure at 1 with a measure μ returns μ. -/
@[to_additive (attr := simp)]
theorem dirac_one_mconv [MeasurableMul₂ M] (μ : Measure M) [SFinite μ] :
    (Measure.dirac 1) ∗ μ = μ

{M : Type u_1}
[AddMonoid M]
[MeasurableSpace M]
[MeasurableAdd₂ M]
(μ : MeasureTheory.Measure M)
[MeasureTheory.SFinite μ]

(MeasureTheory.Measure.dirac 0).conv μ = μ


protected theorem lt_iff_le_and_ne {m n : Nat} : m < n ↔ m ≤ n ∧ m ≠ n


/-- The counit isomorphism of the
equivalence `triangleOpEquivalence C : (Triangle C)ᵒᵖ ≌ Triangle Cᵒᵖ` . -/
@[simps!]
noncomputable def counitIso : inverse C ⋙ functor C ≅ 𝟭 _

(X : CategoryTheory.Pretriangulated.Triangle Cᵒᵖ)

((CategoryTheory.Pretriangulated.TriangleOpEquivalence.counitIso C).hom.app X).hom₂ =
  CategoryTheory.CategoryStruct.id X.obj₂


@[simp]
lemma map_id : W.map (RingHom.id R) = W

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


theorem lt_toDual_iff {a : WithBot αᵒᵈ} {b : WithTop α} :
    a < WithTop.toDual b ↔ b < WithBot.ofDual a

{α : Type u_1}
[LT α]
{a : WithBot αᵒᵈ}
{b : WithTop α}


theorem IsLUB.exists_between_sub_self' (h : IsLUB s a) (h₂ : a ∉ s) (hε : 0 < ε) :
    ∃ b ∈ s, a - ε < b ∧ b < a

{α : Type u_1}
[LinearOrderedAddCommGroup α]
{s : Set α}
{a ε : α}
(h : IsLUB s a)
(h₂ : a ∉ s)
(hε : 0 < ε)


theorem Nonneg.coe_ofScientific {K} [LinearOrderedField K] (m : ℕ) (s : Bool) (e : ℕ) :
    (ofScientific m s e : {x : K // 0 ≤ x}).val = ofScientific m s e

{K : Type u_1}
[LinearOrderedField K]
(m : ℕ)
(s : Bool)
(e : ℕ)

↑(OfScientific.ofScientific m s e) = OfScientific.ofScientific m s e


/-- If `f` tends to infinity along a nontrivial filter,
`fun x ↦ f x * r` tends to negative infinity if and only if `r < 0. `-/
theorem tendsto_mul_const_atBot_iff_neg [NeBot l] (h : Tendsto f l atTop) :
    Tendsto (fun x => f x * r) l atBot ↔ r < 0

{α : Type u_3}
{β : Type u_4}
[LinearOrderedField α]
{l : Filter β}
{f : β → α}
{r : α}
[l.NeBot]
(h : Filter.Tendsto f l Filter.atTop)

Filter.Tendsto (fun x => f x * r) l Filter.atBot ↔ r < 0


theorem Continuous.integral_pos_of_hasCompactSupport_nonneg_nonzero [IsFiniteMeasureOnCompacts μ]
    {f : X → ℝ} {x : X} (f_cont : Continuous f) (f_comp : HasCompactSupport f) (f_nonneg : 0 ≤ f)
    (f_x : f x ≠ 0) : 0 < ∫ x, f x ∂μ


lemma essSurj_of_comp_fully_faithful (F : C ⥤ D) (G : D ⥤ E) [(F ⋙ G).EssSurj]
    [G.Faithful] [G.Full] : F.EssSurj

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


theorem cylinder_eq_cylinder_union [DecidableEq ι] (I : Finset ι) (S : Set (∀ i : I, α i))
    (J : Finset ι) :
    cylinder I S =
      cylinder (I ∪ J) ((fun f ↦ fun j : I ↦ f ⟨j, Finset.mem_union_left J j.prop⟩) ⁻¹' S)

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
(I : Finset ι)
(S : Set ((i : { x // x ∈ I }) → α ↑i))
(J : Finset ι)

MeasureTheory.cylinder I S = MeasureTheory.cylinder (I ∪ J) ((fun f j => f ⟨↑j, ⋯⟩) ⁻¹' S)


@[simp]
theorem one_sub_inv_two : (1 : ℝ≥0∞) - 2⁻¹ = 2⁻¹


theorem dart_card_eq_sum_degrees : Fintype.card G.Dart = ∑ v, G.degree v

{V : Type u}
(G : SimpleGraph V)
[Fintype V]
[DecidableRel G.Adj]

Fintype.card G.Dart = ∑ v : V, G.degree v


@[simp]
theorem eval₂_intCastRingHom_X {R : Type*} [Ring R] (p : ℤ[X]) (f : ℤ[X] →+* R) :
    eval₂ (Int.castRingHom R) (f X) p = f p

{R : Type u_3}
[Ring R]
(p : ℤ[X])
(f : ℤ[X] →+* R)

Polynomial.eval₂ (Int.castRingHom R) (f Polynomial.X) p = f p


theorem isNat_fib : {x nx z : ℕ} → IsNat x nx → Nat.fib nx = z → IsNat (Nat.fib x) z

Mathlib.Meta.NormNum.IsNat x nx → Nat.fib nx = z → Mathlib.Meta.NormNum.IsNat (Nat.fib x) z


theorem det_apply' (M : Matrix n n R) : M.det = ∑ σ : Perm n, ε σ * ∏ i, M (σ i) i

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

M.det = ∑ σ : Equiv.Perm n, ↑↑(Equiv.Perm.sign σ) * ∏ i : n, M (σ i) i


@[to_additive]
theorem NeBot.of_smul_left : (f • g).NeBot → f.NeBot

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{f : Filter α}
{g : Filter β}


protected theorem IsTrail.dropUntil {u v w : V} {p : G.Walk v w} (hc : p.IsTrail)
    (h : u ∈ p.support) : (p.dropUntil u h).IsTrail

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


theorem sumCongr_symm (e : Equiv.Perm α) (f : Equiv.Perm β) :
    (sumCongr e f).symm = sumCongr e.symm f.symm

{α : Type u_1}
{β : Type u_2}
(e : Equiv.Perm α)
(f : Equiv.Perm β)

Equiv.symm (e.sumCongr f) = Equiv.Perm.sumCongr (Equiv.symm e) (Equiv.symm f)


/-- If the angle between three points is `-π / 2`, the last two points are not equal. -/
theorem right_ne_of_oangle_eq_neg_pi_div_two {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ = (-π / 2 : ℝ)) :
    p₃ ≠ p₂

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


theorem Submartingale.upcrossings_ae_lt_top [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ)
    (hbdd : ∀ n, eLpNorm (f n) 1 μ ≤ R) : ∀ᵐ ω ∂μ, ∀ a b : ℚ, a < b → upcrossings a b f ω < ∞

{f : ℕ → Ω → ℝ}

(hf : MeasureTheory.Submartingale f ℱ μ)

(hbdd : ∀ (n : ℕ), MeasureTheory.eLpNorm (f n) 1 μ ≤ ↑R)

∀ᵐ (ω : Ω) ∂μ, ∀ (a b : ℚ), a < b → MeasureTheory.upcrossings (↑a) (↑b) f ω < ⊤


/-- If `S` is dense and `x - y ∈ Kᗮ`, then `x = y`. -/
theorem eq_of_sub_mem_orthogonal (hK : Dense (K : Set E)) (h : x - y ∈ Kᗮ) : x = y

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
{x y : E}
(hK : Dense ↑K)
(h : x - y ∈ Kᗮ)


@[to_additive (attr := simp)]
theorem kerLift_mk (g : G) : (kerLift φ) g = φ g

{G : Type u}
[AddGroup G]
{H : Type v}
[AddGroup H]
(φ : G →+ H)
(g : G)


lemma aleph0_le_rank {ι : Type w} [Infinite ι] {v : ι → M}
    (hv : LinearIndependent R v) : ℵ₀ ≤ Module.rank R M

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[Nontrivial R]
{ι : Type w}
[Infinite ι]
{v : ι → M}
(hv : LinearIndependent R v)


theorem conjugatesOfSet_subset_normalClosure : conjugatesOfSet s ⊆ normalClosure s

Group.conjugatesOfSet s ⊆ Group.normalClosure s


theorem Nodup.not_mem_erase [DecidableEq α] (h : Nodup l) : a ∉ l.erase a

{α : Type u}
{l : List α}
{a : α}
[DecidableEq α]
(h : l.Nodup)


/-- Providing an empty vector to `scanl` gives the starting value `b : β`. -/
@[simp]
theorem scanl_nil : scanl f b nil = b ::ᵥ nil

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

Mathlib.Vector.scanl f b Mathlib.Vector.nil = b ::ᵥ Mathlib.Vector.nil


@[simp]
theorem index_some (i : ι) : hs.index (hs.some i) = i

{ι : Type u_1}
{α : Type u_2}
{s : ι → Set α}
(hs : IndexedPartition s)
(i : ι)


theorem UniformSpace.replaceTopology_eq {α : Type*} [i : TopologicalSpace α] (u : UniformSpace α)
    (h : i = u.toTopologicalSpace) : u.replaceTopology h = u

(h : i = UniformSpace.toTopologicalSpace)


@[ext]
theorem ext ⦃h₁ h₂ : α ≃ᵢ β⦄ (H : ∀ x, h₁ x = h₂ x) : h₁ = h₂

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
⦃h₁ h₂ : α ≃ᵢ β⦄
(H : ∀ (x : α), h₁ x = h₂ x)


theorem eq_X_add_C_of_degree_eq_one (h : degree p = 1) :
    p = C p.leadingCoeff * X + C (p.coeff 0)

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

p = Polynomial.C p.leadingCoeff * Polynomial.X + Polynomial.C (p.coeff 0)


@[to_additive]
theorem Submonoid.le_topologicalClosure (s : Submonoid M) : s ≤ s.topologicalClosure

{M : Type u_3}
[TopologicalSpace M]
[AddMonoid M]
[ContinuousAdd M]
(s : AddSubmonoid M)


@[to_additive Left.pow_nonpos]
theorem Left.pow_le_one_of_le (hx : x ≤ 1) : ∀ {n : ℕ}, x ^ n ≤ 1

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


/-- When the first map `S.f` is zero, this is the homology data on `S` given
by any limit kernel fork of `S.g` -/
@[simps]
def ofIsLimitKernelFork (hf : S.f = 0) (c : KernelFork S.g) (hc : IsLimit c) :
    S.HomologyData

(c : CategoryTheory.Limits.KernelFork S.g)

(CategoryTheory.ShortComplex.HomologyData.ofIsLimitKernelFork S hf c hc).right =
  CategoryTheory.ShortComplex.RightHomologyData.ofIsLimitKernelFork S hf c hc


protected nonrec theorem HasStrictDerivAt.star (h : HasStrictDerivAt f f' x) :
    HasStrictDerivAt (fun x => star (f x)) (star f') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
[StarRing 𝕜]
[TrivialStar 𝕜]
[StarAddMonoid F]
[ContinuousStar F]
[StarModule 𝕜 F]
{f' : F}
{x : 𝕜}
(h : HasStrictDerivAt f f' x)


/-- The triangle (polygon) inequality for sequences of points; `Finset.range` version. -/
theorem edist_le_range_sum_edist (f : ℕ → α) (n : ℕ) :
    edist (f 0) (f n) ≤ ∑ i ∈ Finset.range n, edist (f i) (f (i + 1))

{α : Type u}
[PseudoEMetricSpace α]
(f : ℕ → α)
(n : ℕ)


@[simp]
theorem fract_sub_ofNat (a : α) (n : ℕ) [n.AtLeastTwo] :
    fract (a - (no_index (OfNat.ofNat n))) = fract a

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(a : α)
(n : ℕ)
[n.AtLeastTwo]

Int.fract (a - OfNat.ofNat n) = Int.fract a


@[simp]
theorem insert_val (a : α) (s : Finset α) : (insert a s).1 = ndinsert a s.1

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

(insert a s).val = Multiset.ndinsert a s.val


theorem units_smul_resolvent_self {r : Rˣ} {a : A} :
    r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R)

{R : Type u}
{A : Type v}
[CommSemiring R]
[Ring A]
[Algebra R A]
{r : Rˣ}
{a : A}

r • resolvent a ↑r = resolvent (r⁻¹ • a) 1


@[simp]
theorem sum.of {x : α} : sum (of x) = x


theorem superpolynomialDecay_iff_norm_tendsto_zero :
    SuperpolynomialDecay l k f ↔ ∀ n : ℕ, Tendsto (fun a : α => ‖k a ^ n * f a‖) l (𝓝 0)

{α : Type u_1}
{β : Type u_2}
(l : Filter α)
(k f : α → β)
[NormedLinearOrderedField β]

Asymptotics.SuperpolynomialDecay l k f ↔ ∀ (n : ℕ), Filter.Tendsto (fun a => ‖k a ^ n * f a‖) l (nhds 0)


/-- The kernel of `S ⊗[R] S →ₐ[R] S` is generated by `1 ⊗ s - s ⊗ 1` as a `S`-module. -/
theorem KaehlerDifferential.submodule_span_range_eq_ideal :
    Submodule.span S (Set.range fun s : S => (1 : S) ⊗ₜ[R] s - s ⊗ₜ[R] (1 : S)) =
      (KaehlerDifferential.ideal R S).restrictScalars S

(R : Type u)
(S : Type v)
[CommRing R]
[CommRing S]
[Algebra R S]

Submodule.span S (Set.range fun s => 1 ⊗ₜ[R] s - s ⊗ₜ[R] 1) =
  Submodule.restrictScalars S (KaehlerDifferential.ideal R S)


theorem encard_insert_le (s : Set α) (x : α) : (insert x s).encard ≤ s.encard + 1


@[simp]
theorem card_mul (a b) : card (a * b) = card a * card b


@[simp] theorem mk_den_one {r : Int} :
    ⟨r, 1, Nat.one_ne_zero, (Nat.coprime_one_right _)⟩ = (r : Rat)

{ num := r, den := 1, den_nz := Nat.one_ne_zero, reduced := ⋯ } = ↑r


/-- A dependent version of `mul_induction_on`. -/
@[elab_as_elim]
protected theorem mul_induction_on' {C : ∀ r, r ∈ M * N → Prop}
    (mem_mul_mem : ∀ m (hm : m ∈ M) n (hn : n ∈ N), C (m * n) (mul_mem_mul hm hn))
    (add : ∀ x hx y hy, C x hx → C y hy → C (x + y) (add_mem hx hy)) {r : A} (hr : r ∈ M * N) :
    C r hr

(mem_mul_mem : ∀ (m : A) (hm : m ∈ M) (n : A) (hn : n ∈ N), C (m * n) ⋯)

(add : ∀ (x : A) (hx : x ∈ M * N) (y : A) (hy : y ∈ M * N), C x hx → C y hy → C (x + y) ⋯)


theorem inner_eq_norm_mul_iff_div {x y : E} (h₀ : x ≠ 0) :
    ⟪x, y⟫ = (‖x‖ : 𝕜) * ‖y‖ ↔ (‖y‖ / ‖x‖ : 𝕜) • x = y

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

⟪x, y⟫_𝕜 = ↑‖x‖ * ↑‖y‖ ↔ (↑‖y‖ / ↑‖x‖) • x = y


theorem comap_coe_nhds (x : X) : comap ((↑) : X → OnePoint X) (𝓝 x) = 𝓝 x

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


/-- Given `pb : PowerBasis K S`, then the trace of `pb.gen` is
`((minpoly K pb.gen).aroots F).sum`. -/
theorem PowerBasis.trace_gen_eq_sum_roots [Nontrivial S] (pb : PowerBasis K S)
    (hf : (minpoly K pb.gen).Splits (algebraMap K F)) :
    algebraMap K F (trace K S pb.gen) = ((minpoly K pb.gen).aroots F).sum

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

(algebraMap K F) ((Algebra.trace K S) pb.gen) = ((minpoly K pb.gen).aroots F).sum


@[to_additive]
theorem Isometry.norm_map_of_map_one {f : E → F} (hi : Isometry f) (h₁ : f 1 = 1) (x : E) :
    ‖f x‖ = ‖x‖

{E : Type u_3}
{F : Type u_4}
[SeminormedGroup E]
[SeminormedGroup F]
{f : E → F}
(hi : Isometry f)
(h₁ : f 1 = 1)
(x : E)


theorem iteratedFDerivWithin_zero_eq : iteratedFDerivWithin 𝕜 0 f s = iteratedFDeriv 𝕜 0 f

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}


lemma equiv_equiv_symm (L : C ⥤ D) [L.IsLocalization W]
    (L' : C ⥤ D') [L'.IsLocalization W] (G : D ⥤ D')
    (e : L ⋙ G ≅ L') {X Y : C} [HasSmallLocalizedHom.{w} W X Y]
    (f : L.obj X ⟶ L.obj Y) :
    equiv W L' ((equiv W L).symm f) =
      e.inv.app X ≫ G.map f ≫ e.hom.app Y

[CategoryTheory.Localization.HasSmallLocalizedHom W X Y]

(CategoryTheory.Localization.SmallHom.equiv W L') ((CategoryTheory.Localization.SmallHom.equiv W L).symm f) =
  CategoryTheory.CategoryStruct.comp (e.inv.app X) (CategoryTheory.CategoryStruct.comp (G.map f) (e.hom.app Y))


/-- If `a` and `b` fall within the same cycle WRT `c`, then they are congruent modulo `p`. -/
@[simp]
theorem toIcoMod_inj {c : α} : toIcoMod hp c a = toIcoMod hp c b ↔ a ≡ b [PMOD p]

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


@[simp]
theorem restrict_univ : μ.restrict univ = μ

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}


theorem inter_def [BEq α] (l₁ l₂ : List α)  : l₁ ∩ l₂ = filter (elem · l₂) l₁

l₁ ∩ l₂ = List.filter (fun x => List.elem x l₂) l₁


/-- Right multiplication by a nonzero element in a `GroupWithZero` is a permutation of the
underlying type. -/
@[simps! (config := .asFn)]
protected def mulRight₀ (a : G) (ha : a ≠ 0) : Perm G

{G : Type u_1}
[GroupWithZero G]
(a : G)
(ha : a ≠ 0)

⇑(Equiv.symm (Equiv.mulRight₀ a ha)) = fun x => x * a⁻¹


@[to_additive]
theorem lt_mul_of_one_lt_of_lt' [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a b c : α} (ha : 1 < a)
    (hbc : b < c) :
    b < a * c

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


theorem thickenedIndicator_one_of_mem_closure {δ : ℝ} (δ_pos : 0 < δ) (E : Set α) {x : α}
    (x_mem : x ∈ closure E) : thickenedIndicator δ_pos E x = 1

{α : Type u_1}
[PseudoEMetricSpace α]
{δ : ℝ}
(δ_pos : 0 < δ)
(E : Set α)
{x : α}
(x_mem : x ∈ closure E)


@[to_additive]
protected theorem Specializes.mul {a b c d : M} (hab : a ⤳ b) (hcd : c ⤳ d) : (a * c) ⤳ (b * d)

{M : Type u_3}
[TopologicalSpace M]
[Add M]
[ContinuousAdd M]
{a b c d : M}
(hab : a ⤳ b)
(hcd : c ⤳ d)


theorem KernelFork.app_one (s : KernelFork f) : s.π.app one = 0

(s : CategoryTheory.Limits.KernelFork f)

s.π.app CategoryTheory.Limits.WalkingParallelPair.one = 0


@[simp]
theorem inf'_const (a : α) : (s.inf' H fun _ => a) = a

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
{s : Finset β}
(H : s.Nonempty)
(a : α)


@[reassoc, simp]
theorem whiskerRight_tensor {X X' : C} (f : X ⟶ X') (Y Z : C) :
    f ▷ (Y ⊗ Z) = (α_ X Y Z).inv ≫ f ▷ Y ▷ Z ≫ (α_ X' Y Z).hom

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

CategoryTheory.MonoidalCategory.whiskerRight f (CategoryTheory.MonoidalCategory.tensorObj Y Z) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator X Y Z).inv
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.MonoidalCategory.whiskerRight f Y) Z)
      (CategoryTheory.MonoidalCategory.associator X' Y Z).hom)


theorem fromUnit_ker [hn : Fact <| 0 < n] :
    (@fromUnit R _ _ K _ _ _ n).ker = (powMonoidHom n : Rˣ →* Rˣ).range

{R : Type u}
[CommRing R]
[IsDedekindDomain R]
{K : Type v}
[Field K]
[Algebra R K]
[IsFractionRing R K]
{n : ℕ}
[hn : Fact (0 < n)]

IsDedekindDomain.selmerGroup.fromUnit.ker = (powMonoidHom n).range


lemma map_dep_iff {hf} {D : Set β} :
    (M.map f hf).Dep D ↔ ∃ D₀, M.Dep D₀ ∧ D = f '' D₀

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


@[aesop 90% apply]
theorem add {x y : R} (hx : IsSelfAdjoint x) (hy : IsSelfAdjoint y) : IsSelfAdjoint (x + y)

{R : Type u_1}
[AddMonoid R]
[StarAddMonoid R]
{x y : R}
(hx : IsSelfAdjoint x)
(hy : IsSelfAdjoint y)


theorem sup_induction {p : α → Prop} (hb : p ⊥) (hp : ∀ a₁, p a₁ → ∀ a₂, p a₂ → p (a₁ ⊔ a₂))
    (hs : ∀ b ∈ s, p (f b)) : p (s.sup f)

(hp : ∀ (a₁ : α), p a₁ → ∀ (a₂ : α), p a₂ → p (a₁ ⊔ a₂))


@[simp]
theorem filterMap_map (f : α → β) (g : β → Option γ) (l : List α) :
    filterMap g (map f l) = filterMap (g ∘ f) l

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

List.filterMap g (List.map f l) = List.filterMap (g ∘ f) l


/-- To rewrite from right to left, use `Finset.sup'_comp_eq_image`. -/
@[simp]
theorem sup'_image [DecidableEq β] {s : Finset γ} {f : γ → β} (hs : (s.image f).Nonempty)
    (g : β → α) :
    (s.image f).sup' hs g = s.sup' hs.of_image (g ∘ f)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[SemilatticeSup α]
[DecidableEq β]
{s : Finset γ}
{f : γ → β}
(hs : (Finset.image f s).Nonempty)
(g : β → α)

(Finset.image f s).sup' hs g = s.sup' ⋯ (g ∘ f)


@[simp]
theorem mk_out (c : Cardinal) : #c.out = c


theorem algebraicIndependent_empty [Nontrivial A] :
    AlgebraicIndependent K ((↑) : (∅ : Set A) → A)

{K : Type u_4}
{A : Type u_5}
[CommRing A]
[Field K]
[Algebra K A]
[Nontrivial A]


/-- This is the `List.prod` version of `mul_inv` -/
@[to_additive "This is the `List.sum` version of `add_neg`"]
theorem prod_inv : ∀ L : List G, L.prod⁻¹ = (L.map fun x => x⁻¹).prod

{G : Type u_7}
[AddCommGroup G]
(L : List G)


theorem Set.subsingleton_of_isLUB_le_isGLB (Ha : IsGLB s a) (Hb : IsLUB s b) (hab : b ≤ a) :
    s.Subsingleton

{α : Type u}
[PartialOrder α]
{s : Set α}
{a b : α}
(Ha : IsGLB s a)
(Hb : IsLUB s b)
(hab : b ≤ a)


@[simp]
theorem coe_extend (hs : LinearIndependent K ((↑) : s → V)) : ⇑(Basis.extend hs) = ((↑) : _ → _)

(hs : LinearIndependent (ι := { x // x ∈ s }) K Subtype.val)


/-- The colexigraphic order is insensitive to removing the same elements from both sets. -/
lemma toColex_sdiff_lt_toColex_sdiff (hus : u ⊆ s) (hut : u ⊆ t) :
    toColex (s \ u) < toColex (t \ u) ↔ toColex s < toColex t

{α : Type u_1}
[PartialOrder α]
{s t u : Finset α}
[DecidableEq α]
(hus : u ⊆ s)
(hut : u ⊆ t)

{ ofColex := s \ u } < { ofColex := t \ u } ↔ { ofColex := s } < { ofColex := t }


theorem C_1 : C 1 = (1 : MvPolynomial σ R)

{R : Type u}
{σ : Type u_1}
[CommSemiring R]


/-- Equality behind `SemiconjBy a x y`; useful for rewriting. -/
@[to_additive "Equality behind `AddSemiconjBy a x y`; useful for rewriting."]
protected theorem eq [Mul S] {a x y : S} (h : SemiconjBy a x y) : a * x = y * a

{S : Type u_1}
[Add S]
{a x y : S}
(h : AddSemiconjBy a x y)


@[simp]
theorem Biprod.inr_ofComponents :
    biprod.inr ≫ Biprod.ofComponents f₁₁ f₁₂ f₂₁ f₂₂ = f₂₁ ≫ biprod.inl + f₂₂ ≫ biprod.inr

CategoryTheory.Limits.biprod.inr ≫ CategoryTheory.Biprod.ofComponents f₁₁ f₁₂ f₂₁ f₂₂ =
  f₂₁ ≫ CategoryTheory.Limits.biprod.inl + f₂₂ ≫ CategoryTheory.Limits.biprod.inr


@[deprecated formPerm_apply_get_zero (since := "2024-05-30")]
theorem formPerm_apply_nthLe_zero (l : List α) (h : Nodup l) (hl : 1 < l.length) :
    formPerm l (l.nthLe 0 (by omega)) = l.nthLe 1 hl

{α : Type u_1}
[DecidableEq α]
(l : List α)
(h : l.Nodup)
(hl : 1 < l.length)


@[simp]
theorem commute_star_star {x y : R} : Commute (star x) (star y) ↔ Commute x y

{R : Type u}
[Mul R]
[StarMul R]
{x y : R}


@[to_additive (attr := simp)]
theorem mul_liftRight_inv (f : M →* N) (h : ∀ x, IsUnit (f x)) (x) :
    f x * ↑(IsUnit.liftRight f h x)⁻¹ = 1

{M : Type u_4}
{N : Type u_5}
[AddMonoid M]
[AddMonoid N]
(f : M →+ N)
(h : ∀ (x : M), IsAddUnit (f x))
(x : M)

f x + ↑(-(IsAddUnit.liftRight f h) x) = 0


theorem KaehlerDifferential.D_apply (s : S) :
    KaehlerDifferential.D R S s =
      (KaehlerDifferential.ideal R S).toCotangent
        ⟨1 ⊗ₜ s - s ⊗ₜ 1, KaehlerDifferential.one_smul_sub_smul_one_mem_ideal R s⟩

(R : Type u)
(S : Type v)
[CommRing R]
[CommRing S]
[Algebra R S]
(s : S)

(KaehlerDifferential.D R S) s = (KaehlerDifferential.ideal R S).toCotangent ⟨1 ⊗ₜ[R] s - s ⊗ₜ[R] 1, ⋯⟩


@[to_additive]
protected lemma mul_div_cancel (h : IsUnit a) (b : α) : a * (b / a) = b

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


/-- The additive equivalence between `(α ⊕ β) →₀ M` and `(α →₀ M) × (β →₀ M)`.

This is the `Finsupp` version of `Equiv.sum_arrow_equiv_prod_arrow`. -/
@[simps! apply symm_apply]
def sumFinsuppAddEquivProdFinsupp {α β : Type*} : (α ⊕ β →₀ M) ≃+ (α →₀ M) × (β →₀ M)

{M : Type u_5}
[AddMonoid M]
{α : Type u_13}
{β : Type u_14}
(fg : (α →₀ M) × (β →₀ M))

Finsupp.sumFinsuppAddEquivProdFinsupp.symm fg = fg.1.sumElim fg.2


theorem isCompactOperator_zero {M₁ M₂ : Type*} [Zero M₁] [TopologicalSpace M₁]
    [TopologicalSpace M₂] [Zero M₂] : IsCompactOperator (0 : M₁ → M₂)

{M₁ : Type u_1}
{M₂ : Type u_2}
[Zero M₁]
[TopologicalSpace M₁]
[TopologicalSpace M₂]
[Zero M₂]


theorem cocycle_snd_fst_fst (i j k : 𝒰.J) :
    t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j ≫ pullback.snd _ _ ≫ pullback.fst _ _ ≫
      pullback.fst _ _ = pullback.snd _ _ ≫ pullback.fst _ _ ≫ pullback.fst _ _

[∀ (i : 𝒰.J), CategoryTheory.Limits.HasPullback (𝒰.map i ≫ f) g]

AlgebraicGeometry.Scheme.Pullback.t' 𝒰 f g i j k ≫
    AlgebraicGeometry.Scheme.Pullback.t' 𝒰 f g j k i ≫
      AlgebraicGeometry.Scheme.Pullback.t' 𝒰 f g k i j ≫
        CategoryTheory.Limits.pullback.snd (AlgebraicGeometry.Scheme.Pullback.fV 𝒰 f g i j)
            (AlgebraicGeometry.Scheme.Pullback.fV 𝒰 f g i k) ≫
          CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.fst (𝒰.map i ≫ f) g ≫ 𝒰.map i) (𝒰.map k) ≫
            CategoryTheory.Limits.pullback.fst (𝒰.map i ≫ f) g =
  CategoryTheory.Limits.pullback.snd (AlgebraicGeometry.Scheme.Pullback.fV 𝒰 f g i j)
      (AlgebraicGeometry.Scheme.Pullback.fV 𝒰 f g i k) ≫
    CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.fst (𝒰.map i ≫ f) g ≫ 𝒰.map i) (𝒰.map k) ≫
      CategoryTheory.Limits.pullback.fst (𝒰.map i ≫ f) g


/-- This lemma is less general than `MeasureTheory.unifTight_finite` which applies to
all sequences indexed by a finite type. -/
private theorem unifTight_fin (hp_top : p ≠ ∞) {n : ℕ} {f : Fin n → α → β}
    (hf : ∀ i, Memℒp (f i) p μ) : UnifTight f p μ

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


@[simp, norm_cast]
theorem coe_monomial (n : σ →₀ ℕ) (a : R) :
    (monomial n a : MvPowerSeries σ R) = MvPowerSeries.monomial R n a

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
(n : σ →₀ ℕ)
(a : R)

↑((MvPolynomial.monomial n) a) = (MvPowerSeries.monomial R n) a


theorem not_isPredLimit_pred_of_not_isMin (ha : ¬IsMin a) : ¬IsPredLimit (pred a)

{α : Type u_1}
[Preorder α]
{a : α}
[PredOrder α]
(ha : ¬IsMin a)


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

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


@[norm_cast] lemma coe_ssubset_coe : (s : Set α) ⊂ t ↔ s < t

{α : Type u_1}
[LE α]
{s t : LowerSet α}


@[simp] lemma map_smul {f : Ω → Ω'} (c : ℝ≥0) (ν : FiniteMeasure Ω) :
    (c • ν).map f = c • (ν.map f)

{Ω : Type u_1}
{Ω' : Type u_2}
[MeasurableSpace Ω]
[MeasurableSpace Ω']
{f : Ω → Ω'}
(c : ℝ≥0)
(ν : MeasureTheory.FiniteMeasure Ω)


theorem IndepSets.inter {s₁ s' : Set (Set Ω)} (s₂ : Set (Set Ω)) (h₁ : IndepSets s₁ s' μ) :
    IndepSets (s₁ ∩ s₂) s' μ

(h₁ : ProbabilityTheory.IndepSets s₁ s' μ)

ProbabilityTheory.IndepSets (s₁ ∩ s₂) s' μ


@[simp]
theorem coe_comp (f : β →*₀o γ) (g : α →*₀o β) : (f.comp g : α → γ) = f ∘ g

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Preorder α]
[Preorder β]
[Preorder γ]
[MulZeroOneClass α]
[MulZeroOneClass β]
[MulZeroOneClass γ]
(f : β →*₀o γ)
(g : α →*₀o β)


theorem infinite_iff_infinite_of_encard_eq_encard (h : s.encard = t.encard) :
    s.Infinite ↔ t.Infinite

{α : Type u_1}
{s t : Set α}
(h : s.encard = t.encard)


theorem pi_Ioi_mem_nhds (ha : ∀ i, a i < x i) : Ioi a ∈ 𝓝 x

{ι : Type u_1}
{π : ι → Type u_2}
[Finite ι]
[(i : ι) → LinearOrder (π i)]
[(i : ι) → TopologicalSpace (π i)]
[∀ (i : ι), OrderTopology (π i)]
{a x : (i : ι) → π i}
[Nonempty ι]
(ha : ∀ (i : ι), a i < x i)


lemma isCoprime_scaleRoots (p q : R[X]) (r : R) (hr : IsUnit r) (h : IsCoprime p q) :
    IsCoprime (p.scaleRoots r) (q.scaleRoots r)

{R : Type u_1}
[CommSemiring R]
(p q : Polynomial R)
(r : R)
(hr : IsUnit r)
(h : IsCoprime p q)


@[simp]
theorem liftOn_toFinmap {γ} (s : AList β) (f : AList β → γ) (H) : liftOn ⟦s⟧ f H = f s

(H : ∀ (a b : AList β), a.entries ~ b.entries → f a = f b)


/-- A Fraïssé class is a nonempty, isomorphism-invariant, essentially countable class of structures
satisfying the hereditary, joint embedding, and amalgamation properties. -/
class IsFraisse : Prop where
  is_nonempty : K.Nonempty
  FG : ∀ M : Bundled.{w} L.Structure, M ∈ K → Structure.FG L M
  is_equiv_invariant : ∀ M N : Bundled.{w} L.Structure, Nonempty (M ≃[L] N) → (M ∈ K ↔ N ∈ K)
  is_essentially_countable : (Quotient.mk' '' K).Countable
  hereditary : Hereditary K
  jointEmbedding : JointEmbedding K
  amalgamation : Amalgamation K

{K : Set (CategoryTheory.Bundled L.Structure)}

[self : FirstOrder.Language.IsFraisse K]

(M N : CategoryTheory.Bundled L.Structure)