/-- Two products which differ by an equivalence in the indexing type,
and up to isomorphism in the factors, are isomorphic.
-/
@[simps]
def Pi.whiskerEquiv {J K : Type*} {f : J → C} {g : K → C} (e : J ≃ K) (w : ∀ j, g (e j) ≅ f j)
    [HasProduct f] [HasProduct g] : ∏ᶜ f ≅ ∏ᶜ g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{J : Type u_1}
{K : Type u_2}
{f : J → C}
{g : K → C}
(e : J ≃ K)
(w : (j : J) → g (e j) ≅ f j)
[CategoryTheory.Limits.HasProduct f]
[CategoryTheory.Limits.HasProduct g]

(CategoryTheory.Limits.Pi.whiskerEquiv e w).hom =
  CategoryTheory.Limits.Pi.map' ⇑e.symm fun k => (w (e.symm k)).inv ≫ CategoryTheory.eqToHom ⋯


/-- **Tietze extension theorem** for real-valued bounded continuous maps, a version for a closed
set. Let `s` be a closed set in a normal topological space `Y`. Let `f` be a bounded continuous
real-valued function on `s`. Let `t` be a nonempty convex set of real numbers (we use
`OrdConnected` instead of `Convex` to automatically deduce this argument by typeclass search) such
that `f x ∈ t` for all `x : s`. Then there exists a bounded continuous real-valued function
`g : Y →ᵇ ℝ` such that `g y ∈ t` for all `y` and `g.restrict s = f`. -/
theorem exists_forall_mem_restrict_eq_of_closed {s : Set Y} (f : s →ᵇ ℝ) (hs : IsClosed s)
    {t : Set ℝ} [OrdConnected t] (hf : ∀ x, f x ∈ t) (hne : t.Nonempty) :
    ∃ g : Y →ᵇ ℝ, (∀ y, g y ∈ t) ∧ g.restrict s = f

{Y : Type u_2}
[TopologicalSpace Y]
[NormalSpace Y]
{s : Set Y}
(f : ↑s →ᵇ ℝ)
(hs : IsClosed s)
{t : Set ℝ}
[t.OrdConnected]
(hf : ∀ (x : ↑s), f x ∈ t)
(hne : t.Nonempty)

∃ g, (∀ (y : Y), g y ∈ t) ∧ g.restrict s = f


@[continuity, fun_prop]
theorem Continuous.comp' {g : Y → Z} (hg : Continuous g) (hf : Continuous f) :
    Continuous (fun x => g (f x))

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


theorem _root_.Filter.EventuallyEq.restrict {f g : α → δ} {s : Set α} (hfg : f =ᵐ[μ] g) :
    f =ᵐ[μ.restrict s] g

{α : Type u_2}
{δ : Type u_4}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → δ}
{s : Set α}
(hfg : f =ᵐ[μ] g)


theorem nhds_basis_balanced :
    (𝓝 (0 : E)).HasBasis (fun s : Set E => s ∈ 𝓝 (0 : E) ∧ Balanced 𝕜 s) id

(𝕜 : Type u_1)
(E : Type u_2)
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[ContinuousSMul 𝕜 E]

(𝓝 0).HasBasis (fun s => s ∈ 𝓝 0 ∧ Balanced 𝕜 s) id


lemma IsPushout.unop {sq : Square Cᵒᵖ} (h : sq.IsPushout) : sq.unop.IsPullback

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{sq : CategoryTheory.Square Cᵒᵖ}
(h : sq.IsPushout)


@[to_additive]
theorem mem_sup_right {S T : Submonoid M} : ∀ {x : M}, x ∈ T → x ∈ S ⊔ T

{M : Type u_1}
[MulOneClass M]
{S T : Submonoid M}
{x : M}


@[simp]
theorem intrinsicClosure_singleton (x : P) : intrinsicClosure 𝕜 ({x} : Set P) = {x}

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_5}
[Ring 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
[TopologicalSpace P]
[AddTorsor V P]
(x : P)


@[simp]
theorem singleton_le {a : α} {s : Multiset α} : {a} ≤ s ↔ a ∈ s


/-- We have that `λ ^ 2 = -3 * η`. -/
private lemma lambda_sq : λ ^ 2 = -3 * η

{K : Type u_1}
[Field K]
{ζ : K}
(hζ : IsPrimitiveRoot ζ ↑3)


theorem destutter_of_chain' : ∀ l : List α, l.Chain' R → l.destutter R = l

{α : Type u_1}
(R : α → α → Prop)
[DecidableRel R]
(l : List α)

List.Chain' R l → List.destutter R l = l


/-- The parameterized integral `x ↦ ∫ y, g (y⁻¹ * x) ∂μ` depends continuously on `y` when `g` is a
compactly supported continuous function on a topological group `G`, and `μ` is finite on compact
sets. -/
@[to_additive]
lemma continuous_integral_apply_inv_mul
    {G : Type*} [TopologicalSpace G] [LocallyCompactSpace G] [Group G] [TopologicalGroup G]
    [MeasurableSpace G] [BorelSpace G]
    {μ : Measure G} [IsFiniteMeasureOnCompacts μ] {E : Type*} [NormedAddCommGroup E]
    [NormedSpace ℝ E] {g : G → E}
    (hg : Continuous g) (h'g : HasCompactSupport g) :
    Continuous (fun (x : G) ↦ ∫ y, g (y⁻¹ * x) ∂μ)

Continuous fun x => ∫ (y : G), g (y⁻¹ * x) ∂μ


theorem sub_supermartingale [Preorder E] [CovariantClass E E (· + ·) (· ≤ ·)]
    (hf : Submartingale f ℱ μ) (hg : Supermartingale g ℱ μ) : Submartingale (f - g) ℱ μ

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

(hf : MeasureTheory.Submartingale f ℱ μ)

(hg : MeasureTheory.Supermartingale g ℱ μ)


/-- If corresponding pairs of points in two angles have the same vector span, twice those angles
are equal. -/
theorem two_zsmul_oangle_of_vectorSpan_eq {p₁ p₂ p₃ p₄ p₅ p₆ : P}
    (h₁₂₄₅ : vectorSpan ℝ ({p₁, p₂} : Set P) = vectorSpan ℝ ({p₄, p₅} : Set P))
    (h₃₂₆₅ : vectorSpan ℝ ({p₃, p₂} : Set P) = vectorSpan ℝ ({p₆, p₅} : Set P)) :
    (2 : ℤ) • ∡ p₁ p₂ p₃ = (2 : ℤ) • ∡ p₄ p₅ p₆

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

(h₁₂₄₅ : vectorSpan ℝ {p₁, p₂} = vectorSpan ℝ {p₄, p₅})

(h₃₂₆₅ : vectorSpan ℝ {p₃, p₂} = vectorSpan ℝ {p₆, p₅})

2 • ∡ p₁ p₂ p₃ = 2 • ∡ p₄ p₅ p₆


theorem lookupFinsupp_eq_zero_iff [DecidableEq α] {l : AList fun _x : α => M} {a : α} :
    l.lookupFinsupp a = 0 ↔ a ∉ l ∨ (0 : M) ∈ l.lookup a

{α : Type u_1}
{M : Type u_2}
[Zero M]
[DecidableEq α]
{l : AList fun _x => M}
{a : α}

l.lookupFinsupp a = 0 ↔ a ∉ l ∨ 0 ∈ AList.lookup a l


lemma SigmaCompactSpace.exists_compact_covering [h : SigmaCompactSpace X] :
    ∃ K : ℕ → Set X, (∀ n, IsCompact (K n)) ∧ ⋃ n, K n = univ

{X : Type u_1}
[TopologicalSpace X]
[h : SigmaCompactSpace X]

∃ K, (∀ (n : ℕ), IsCompact (K n)) ∧ ⋃ n, K n = Set.univ


theorem mem_iSup₂_iff {f : ∀ i, κ i → LowerSet α} : (a ∈ ⨆ (i) (j), f i j) ↔ ∃ i j, a ∈ f i j

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_5}
[LE α]
{a : α}
{f : (i : ι) → κ i → LowerSet α}


/-- The first morphism of triangles given by an octahedron. -/
@[simps]
def triangleMorphism₁ : Triangle.mk u₁₂ v₁₂ w₁₂ ⟶ Triangle.mk u₁₃ v₁₃ w₁₃

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

{comm : CategoryTheory.CategoryStruct.comp u₁₂ u₂₃ = u₁₃}

{v₁₂ : X₂ ⟶ Z₁₂}

{w₁₂ : Z₁₂ ⟶ (CategoryTheory.shiftFunctor C 1).obj X₁}

{h₁₂ : CategoryTheory.Pretriangulated.Triangle.mk u₁₂ v₁₂ w₁₂ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles}

{v₂₃ : X₃ ⟶ Z₂₃}

{w₂₃ : Z₂₃ ⟶ (CategoryTheory.shiftFunctor C 1).obj X₂}

{h₂₃ : CategoryTheory.Pretriangulated.Triangle.mk u₂₃ v₂₃ w₂₃ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles}

{v₁₃ : X₃ ⟶ Z₁₃}

{w₁₃ : Z₁₃ ⟶ (CategoryTheory.shiftFunctor C 1).obj X₁}

{h₁₃ : CategoryTheory.Pretriangulated.Triangle.mk u₁₃ v₁₃ w₁₃ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles}

(h : CategoryTheory.Triangulated.Octahedron comm h₁₂ h₂₃ h₁₃)


@[simp, norm_cast] lemma coe_mk (s : Set α) (hs) : mk s hs = s

{α : Type u_1}
[LE α]
(s : Set α)
(hs : IsUpperSet s)


theorem toList_formPerm_isRotated_self (l : List α) (hl : 2 ≤ l.length) (hn : Nodup l) (x : α)
    (hx : x ∈ l) : toList (formPerm l) x ~r l

{α : Type u_1}
[Fintype α]
[DecidableEq α]
(l : List α)
(hl : 2 ≤ l.length)
(hn : l.Nodup)
(x : α)
(hx : x ∈ l)


@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
protected theorem div [Div β] [ContinuousDiv β] (hf : StronglyMeasurable f)
    (hg : StronglyMeasurable g) : StronglyMeasurable (f / g)

(hf : MeasureTheory.StronglyMeasurable f)

(hg : MeasureTheory.StronglyMeasurable g)

MeasureTheory.StronglyMeasurable (f - g)


@[simp]
theorem max_aleph_eq (o₁ o₂ : Ordinal) : max (aleph o₁) (aleph o₂) = aleph (max o₁ o₂)

max (Cardinal.aleph o₁) (Cardinal.aleph o₂) = Cardinal.aleph (max o₁ o₂)


@[simp]
theorem map_smul_of_tower {S : Type*} [SMul S A] [SMul S M] [LinearMap.CompatibleSMul A M S R]
    (D : Derivation R A M) (r : S) (a : A) : D (r • a) = r • D a

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
{S : Type u_5}
[SMul S A]
[SMul S M]
[LinearMap.CompatibleSMul A M S R]
(D : Derivation R A M)
(r : S)
(a : A)


@[to_additive rightAddCoset_zero]
theorem rightCoset_one : op (1 : α) • s = s


/-- The Bochner integral in L1 space -/
irreducible_def integral : (α →₁[μ] E) → E

{α : Type u_5}
{E : Type u_6}
[NormedAddCommGroup E]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedSpace ℝ E]
[CompleteSpace E]


theorem copy_eq (f : α →+* β) (f' : α → β) (h : f' = f) : f.copy f' h = f

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β) (f' : α → β) (h : f' = ⇑f), f.copy f' h = f


theorem absNorm_ne_zero_of_nonZeroDivisors (I : (Ideal S)⁰) : Ideal.absNorm (I : Ideal S) ≠ 0

{S : Type u_1}
[CommRing S]
[IsDomain S]
[Nontrivial S]
[IsDedekindDomain S]
[Module.Free ℤ S]
[Module.Finite ℤ S]
(I : ↥(Ideal S)⁰)


theorem HasFPowerSeriesOnBall.hasSum_sub (hf : HasFPowerSeriesOnBall f p x r) {y : E}
    (hy : y ∈ EMetric.ball x r) : HasSum (fun n : ℕ => p n fun _ => y - x) (f y)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
{r : ℝ≥0∞}
(hf : HasFPowerSeriesOnBall f p x r)
{y : E}
(hy : y ∈ EMetric.ball x r)

HasSum (fun n => (p n) fun x_1 => y - x) (f y)


lemma exp_eq_normedSpace_exp {a : A} (ha : p a := by cfc_tac) :
    cfc (exp 𝕜 : 𝕜 → 𝕜) a = exp 𝕜 a

{𝕜 : Type u_1}
{A : Type u_2}
[RCLike 𝕜]
{p : A → Prop}
[NormedRing A]
[StarRing A]
[TopologicalRing A]
[NormedAlgebra 𝕜 A]
[CompleteSpace A]
[ContinuousFunctionalCalculus 𝕜 p]
{a : A}
(ha : p a := by cfc_tac)

cfc (NormedSpace.exp 𝕜) a = NormedSpace.exp 𝕜 a


/-- Product of elements of a subgroup of a `CommGroup` indexed by a `Finset` is in the
    subgroup. -/
@[to_additive "Sum of elements in an `AddSubgroup` of an `AddCommGroup` indexed by a `Finset`
 is in the `AddSubgroup`."]
protected theorem prod_mem {G : Type*} [CommGroup G] (K : Subgroup G) {ι : Type*} {t : Finset ι}
    {f : ι → G} (h : ∀ c ∈ t, f c ∈ K) : (∏ c ∈ t, f c) ∈ K

{G : Type u_3}
[CommGroup G]
(K : Subgroup G)
{ι : Type u_4}
{t : Finset ι}
{f : ι → G}
(h : ∀ c ∈ t, f c ∈ K)


theorem of_nonempty (h : ∀ s, IsClosed s → s.Nonempty → IsClosed (f '' s)) :
    IsClosedMap f

(h : ∀ (s : Set X), IsClosed s → s.Nonempty → IsClosed (f '' s))


theorem setToFun_indicator_const (hT : DominatedFinMeasAdditive μ T C) {s : Set α}
    (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : E) :
    setToFun μ T hT (s.indicator fun _ => x) = T s x

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

MeasureTheory.setToFun μ T hT (s.indicator fun x_1 => x) = (T s) x


/-- If `L/K` is a field extension, then we have `Gal(L/K) ∈ fixedByFinite K L` -/
theorem top_fixedByFinite {K L : Type*} [Field K] [Field L] [Algebra K L] :
    ⊤ ∈ fixedByFinite K L

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]


protected theorem le_antisymm : ∀ {x y : Bool}, x ≤ y → y ≤ x → x = y


@[simp]
theorem coe_restrict (f : α →ₛ β) {s : Set α} (hs : MeasurableSet s) :
    ⇑(restrict f s) = indicator s f

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[Zero β]
(f : MeasureTheory.SimpleFunc α β)
{s : Set α}
(hs : MeasurableSet s)


/-- A monoid homomorphism (a bundled morphism of a type that implements `MonoidHomClass`) from a
topological group to a topological monoid is continuous provided that it is continuous at one. See
also `uniformContinuous_of_continuousAt_one`. -/
@[to_additive
  "An additive monoid homomorphism (a bundled morphism of a type that implements
  `AddMonoidHomClass`) from an additive topological group to an additive topological monoid is
  continuous provided that it is continuous at zero. See also
  `uniformContinuous_of_continuousAt_zero`."]
theorem continuous_of_continuousAt_one {M hom : Type*} [MulOneClass M] [TopologicalSpace M]
    [ContinuousMul M] [FunLike hom G M] [MonoidHomClass hom G M] (f : hom)
    (hf : ContinuousAt f 1) :
    Continuous f

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
{M : Type u_1}
{hom : Type u_2}
[MulOneClass M]
[TopologicalSpace M]
[ContinuousMul M]
[FunLike hom G M]
[MonoidHomClass hom G M]
(f : hom)
(hf : ContinuousAt (⇑f) 1)


theorem lcm_mul_right {m n k : ℤ} : (m * n).lcm (k * n) = m.lcm k * natAbs n

(m * n).lcm (k * n) = m.lcm k * n.natAbs


theorem eq_iff_true_of_subsingleton [Subsingleton α] (x y : α) : x = y ↔ True

{α : Sort u_1}
[Subsingleton α]
(x y : α)


@[simp]
theorem coe_toAffineMap : ⇑f.toAffineMap = f

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(f : P →ᵃⁱ[𝕜] P₂)


@[trans]
theorem SameCycle.trans : SameCycle f x y → SameCycle f y z → SameCycle f x z

{α : Type u_2}
{f : Equiv.Perm α}
{x y z : α}

f.SameCycle x y → f.SameCycle y z → f.SameCycle x z


@[to_additive]
theorem prod_apply [CommMonoid β] [ContinuousMul β] {ι : Type*} (s : Finset ι) (f : ι → C(α, β))
    (a : α) : (∏ i ∈ s, f i) a = ∏ i ∈ s, f i a

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[CommMonoid β]
[ContinuousMul β]
{ι : Type u_3}
(s : Finset ι)
(f : ι → C(α, β))
(a : α)


/-- A positive cone in a ring consists of a positive cone in underlying `AddCommGroup`,
which contains `1` and such that the positive elements are closed under multiplication. -/
structure PositiveCone (α : Type*) [Ring α] extends AddCommGroup.PositiveCone α where
  /-- In a positive cone, `1` is `nonneg` -/
  one_nonneg : nonneg 1
  /-- In a positive cone, if `a` and `b` are `pos` then so is `a * b` -/
  mul_pos : ∀ a b, pos a → pos b → pos (a * b)

{α : Type u_2}
[Ring α]
(self : Ring.PositiveCone α)


theorem triangle (F : A ⥤ B) (G : B ⥤ C) :
    (associator F (𝟭 B) G).hom ≫ whiskerLeft F (leftUnitor G).hom =
      whiskerRight (rightUnitor F).hom G

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

CategoryTheory.CategoryStruct.comp (F.associator (CategoryTheory.Functor.id B) G).hom
    (CategoryTheory.whiskerLeft F G.leftUnitor.hom) =
  CategoryTheory.whiskerRight F.rightUnitor.hom G


@[to_additive]
protected theorem mul_mul_mul_comm (hbc : Commute b c) (a d : S) :
    a * b * (c * d) = a * c * (b * d)

{S : Type u_3}
[Semigroup S]
{b c : S}
(hbc : Commute b c)
(a d : S)


@[simp]
theorem offDiag_eq_empty : s.offDiag = ∅ ↔ s.Subsingleton


lemma toClass_zero : toClass (0 : W.Point) = 0

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}

WeierstrassCurve.Affine.Point.toClass 0 = 0


lemma cutExpand_pair_left {a' a b} (hr : r a' a) : CutExpand r {a', b} {a, b}

{α : Type u_1}
{r : α → α → Prop}
{a' a b : α}
(hr : r a' a)


theorem sumElim_inl {α β γ : Type*} [Zero γ] (f : α →₀ γ) (g : β →₀ γ) (x : α) :
    sumElim f g (Sum.inl x) = f x

{α : Type u_13}
{β : Type u_14}
{γ : Type u_15}
[Zero γ]
(f : α →₀ γ)
(g : β →₀ γ)
(x : α)


/-- A class to indicate that there is a canonical injection between `A` and `Set B`.

This has the effect of giving terms of `A` elements of type `B` (through a `Membership`
instance) and a compatible coercion to `Type*` as a subtype.

Note: if `SetLike.coe` is a projection, implementers should create a simp lemma such as
```
@[simp] lemma mem_carrier {p : MySubobject X} : x ∈ p.carrier ↔ x ∈ (p : Set X) := Iff.rfl
```
to normalize terms.

If you declare an unbundled subclass of `SetLike`, for example:
```
class MulMemClass (S : Type*) (M : Type*) [Mul M] [SetLike S M] where
  ...
```
Then you should *not* repeat the `outParam` declaration so `SetLike` will supply the value instead.
This ensures your subclass will not have issues with synthesis of the `[Mul M]` parameter starting
before the value of `M` is known.
-/
@[notation_class * carrier Simps.findCoercionArgs]
class SetLike (A : Type*) (B : outParam Type*) where
  /-- The coercion from a term of a `SetLike` to its corresponding `Set`. -/
  protected coe : A → Set B
  /-- The coercion from a term of a `SetLike` to its corresponding `Set` is injective. -/
  protected coe_injective' : Function.Injective coe

{A : Type u_1}
{B : outParam (Type u_2)}
[self : SetLike A B]


theorem inf_lt_left_or_right (h : a ≠ b) : a ⊓ b < a ∨ a ⊓ b < b

{α : Type u}
[SemilatticeInf α]
{a b : α}
(h : a ≠ b)


lemma testBit_bit_zero (b n) : testBit (bit b n) 0 = b


@[simp]
theorem toEmbedding_toHom (f : M ≃[L] N) : f.toEmbedding.toHom = f.toHom

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


/-- The *Euler Product* for completely multiplicative functions.

If `f : ℕ →*₀ F`, where `F` is a complete normed field and `‖f ·‖` is summable, then
`∏' p : Nat.Primes, (1 - f p)⁻¹ = ∑' n, f n`.
This version is stated in the form of convergence of finite partial products. -/
theorem eulerProduct_completely_multiplicative {f : ℕ →*₀ F} (hsum : Summable (‖f ·‖)) :
    Tendsto (fun n : ℕ ↦ ∏ p ∈ primesBelow n, (1 - f p)⁻¹) atTop (𝓝 (∑' n, f n))

{F : Type u_1}
[NormedField F]
[CompleteSpace F]
{f : ℕ →*₀ F}
(hsum : Summable fun x => ‖f x‖)

Filter.Tendsto (fun n => ∏ p ∈ n.primesBelow, (1 - f p)⁻¹) Filter.atTop (𝓝 (∑' (n : ℕ), f n))


theorem generateFrom_iUnion_measurableSet (m : ι → MeasurableSpace α) :
    generateFrom (⋃ n, { t | MeasurableSet[m n] t }) = ⨆ n, m n

{α : Type u_1}
{ι : Sort u_6}
(m : ι → MeasurableSpace α)

MeasurableSpace.generateFrom (⋃ n, {t | MeasurableSet t}) = ⨆ n, m n


/-- A canonically ordered additive monoid is an ordered commutative additive monoid
  in which the ordering coincides with the subtractibility relation,
  which is to say, `a ≤ b` iff there exists `c` with `b = a + c`.
  This is satisfied by the natural numbers, for example, but not
  the integers or other nontrivial `OrderedAddCommGroup`s. -/
class CanonicallyOrderedAddCommMonoid (α : Type*) extends OrderedAddCommMonoid α, OrderBot α where
  /-- For `a ≤ b`, there is a `c` so `b = a + c`. -/
  protected exists_add_of_le : ∀ {a b : α}, a ≤ b → ∃ c, b = a + c
  /-- For any `a` and `b`, `a ≤ a + b` -/
  protected le_self_add : ∀ a b : α, a ≤ a + b

[self : CanonicallyOrderedAddCommMonoid α]


theorem IsBoundedUnder.mono_le [Preorder β] {l : Filter α} {u v : α → β}
    (hu : IsBoundedUnder (· ≤ ·) l u) (hv : v ≤ᶠ[l] u) : IsBoundedUnder (· ≤ ·) l v

(hu : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l u)

Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l v


@[to_additive]
theorem inv_div' : (a / b)⁻¹ = a⁻¹ / b⁻¹

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


lemma basis_iff_indep_closure : M.Basis I X ↔ M.Indep I ∧ X ⊆ M.closure I ∧ I ⊆ X

{α : Type u_2}
{M : Matroid α}
{X I : Set α}


/-- If `f : ℕ → M` is multipliable, then the partial products `∏ i ∈ range n, f i` converge
to `∏' i, f i`. -/
@[to_additive "If `f : ℕ → M` is summable, then the partial sums `∑ i ∈ range n, f i` converge
to `∑' i, f i`."]
theorem Multipliable.tendsto_prod_tprod_nat {f : ℕ → M} (h : Multipliable f) :
    Tendsto (fun n ↦ ∏ i ∈ range n, f i) atTop (𝓝 (∏' i, f i))

{M : Type u_1}
[CommMonoid M]
[TopologicalSpace M]
{f : ℕ → M}
(h : Multipliable f)

Filter.Tendsto (fun n => ∏ i ∈ Finset.range n, f i) Filter.atTop (𝓝 (∏' (i : ℕ), f i))


theorem exists_eq_add_of_lt {n : ℕ} {a b : Fin (n + 1)} (h : a < b) :
    ∃ k < b, k + 1 ≤ b ∧ b = a + k + 1


@[simp]
theorem toMultiset_inj : toMultiset f = toMultiset g ↔ f = g

{α : Type u_1}
[DecidableEq α]
{f g : Π₀ (_a : α), ℕ}

DFinsupp.toMultiset f = DFinsupp.toMultiset g ↔ f = g


@[to_additive]
theorem mulSupport_binop_subset (op : M → N → P) (op1 : op 1 1 = 1) (f : α → M) (g : α → N) :
    (mulSupport fun x => op (f x) (g x)) ⊆ mulSupport f ∪ mulSupport g

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
{P : Type u_8}
[One M]
[One N]
[One P]
(op : M → N → P)
(op1 : op 1 1 = 1)
(f : α → M)
(g : α → N)

(Function.mulSupport fun x => op (f x) (g x)) ⊆ Function.mulSupport f ∪ Function.mulSupport g


@[simp] theorem up_lt [LT α] {a b : α} : up a < up b ↔ a < b


@[simp] theorem mul_ediv_mul_of_pos {a : Int}
    (b c : Int) (H : 0 < a) : (a * b) / (a * c) = b / c


/-- The `J`-closure of a sieve is the collection of arrows which it covers. -/
@[simps]
def close {X : C} (S : Sieve X) : Sieve X

(J₁ : CategoryTheory.GrothendieckTopology C)

∀ (x : C) (f : x ⟶ X), (J₁.close S).arrows f = J₁.Covers S f


/-- If `M, M'` are `R`-modules, then any `R`-linear map `g : M ⟶ M'` induces an `S`-linear map
`(S →ₗ[R] M) ⟶ (S →ₗ[R] M')` defined by `h ↦ g ∘ h`-/
@[simps]
def map' {M M' : ModuleCat R} (g : M ⟶ M') : obj' f M ⟶ obj' f M'

(h : ↑(ModuleCat.CoextendScalars.obj' f M))

(ModuleCat.CoextendScalars.map' f g) h = g ∘ₗ h


lemma mk'_mem_map_algebraMap_iff (I : Ideal R) (x : R) (s : M) :
    IsLocalization.mk' S x s ∈ I.map (algebraMap R S) ↔ ∃ s ∈ M, s * x ∈ I

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

IsLocalization.mk' S x s ∈ Ideal.map (algebraMap R S) I ↔ ∃ s ∈ M, s * x ∈ I


theorem mul_inv_lt_iff' (h : 0 < b) : a * b⁻¹ < c ↔ a < c * b

{α : Type u_2}
[LinearOrderedSemifield α]
{a b c : α}
(h : 0 < b)


theorem Ici_subset_Icc_union_Ici : Ici a ⊆ Icc a b ∪ Ici b

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


theorem prod_assoc_symm (f : Filter α) (g : Filter β) (h : Filter γ) :
    map (Equiv.prodAssoc α β γ).symm (f ×ˢ (g ×ˢ h)) = (f ×ˢ g) ×ˢ h

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : Filter α)
(g : Filter β)
(h : Filter γ)

Filter.map (⇑(Equiv.prodAssoc α β γ).symm) (f ×ˢ g ×ˢ h) = (f ×ˢ g) ×ˢ h


theorem IsTorsionBySet.quotient (N : Submodule R M) {s}
    (h : IsTorsionBySet R M s) : IsTorsionBySet R (M⧸N) s

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(N : Submodule R M)
{s : Set R}
(h : Module.IsTorsionBySet R M s)


theorem mem_of_mem_odd (a : α) (s : Stream' α) : a ∈ odd s → a ∈ s


/-- See `List.count_bind` for the corresponding statement using `List.sum`. -/
lemma count_bind' [BEq β] (l : List α) (f : α → List β) (x : β) :
    count x (l.bind f) = Nat.sum (map (count x ∘ f) l)

{α : Type u_1}
{β : Type u_2}
[BEq β]
(l : List α)
(f : α → List β)
(x : β)

List.count x (l.bind f) = Nat.sum (List.map (List.count x ∘ f) l)


@[simp] theorem foldl_eq (f : δ → α → β → δ) (init l) :
    foldl f init l = l.toList.foldl (fun d (a, b) => f d a b) init

{δ : Type u_1}
{α : Type u_2}
{β : Type u_3}
(f : δ → α → β → δ)
(init : δ)
(l : Batteries.AssocList α β)

Batteries.AssocList.foldl f init l =
  List.foldl
    (fun d x =>
      match x with
      | (a, b) => f d a b)
    init l.toList


theorem congr_mk' (e : G ≃* H) (he : G'.map ↑e = H') (x) :
    congr G' H' e he (mk' G' x) = mk' H' (e x)

{G : Type u}
[Group G]
{H : Type v}
[Group H]
(G' : Subgroup G)
(H' : Subgroup H)
[G'.Normal]
[H'.Normal]
(e : G ≃* H)
(he : Subgroup.map (↑e) G' = H')
(x : G)

(QuotientGroup.congr G' H' e he) ((QuotientGroup.mk' G') x) = (QuotientGroup.mk' H') (e x)


theorem WithBot.sSup_eq [SupSet α] {s : Set (WithBot α)} (hs : ¬s ⊆ {⊥}) (h's : BddAbove s) :
    sSup s = ↑(sSup ((↑) ⁻¹' s) : α)

{α : Type u_1}
[Preorder α]
[SupSet α]
{s : Set (WithBot α)}
(hs : ¬s ⊆ {⊥})
(h's : BddAbove s)


theorem dickson_one_one_comp_comm (m n : ℕ) :
    (dickson 1 (1 : R) m).comp (dickson 1 1 n) = (dickson 1 1 n).comp (dickson 1 1 m)

(Polynomial.dickson 1 1 m).comp (Polynomial.dickson 1 1 n) = (Polynomial.dickson 1 1 n).comp (Polynomial.dickson 1 1 m)


lemma div_sq_cancel (a b : G₀) : a ^ 2 * b / a = a * b

{G₀ : Type u_3}
[CommGroupWithZero G₀]
(a b : G₀)


theorem isCycle_finRotate_of_le {n : ℕ} (h : 2 ≤ n) : IsCycle (finRotate n)


/-- The Poisson pmf is positive for all natural numbers -/
lemma poissonPMFReal_pos {r : ℝ≥0} {n : ℕ} (hr : 0 < r) : 0 < poissonPMFReal r n

0 < ProbabilityTheory.poissonPMFReal r n


@[to_additive]
theorem max_mul_mul_left (a b c : α) : max (a * b) (a * c) = a * max b c

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


/-- `SeminormClass F 𝕜 E` states that `F` is a type of seminorms on the `𝕜`-module `E`.

You should extend this class when you extend `Seminorm`. -/
class SeminormClass (F : Type*) (𝕜 E : outParam Type*) [SeminormedRing 𝕜] [AddGroup E]
  [SMul 𝕜 E] [FunLike F E ℝ] extends AddGroupSeminormClass F E ℝ : Prop where
  /-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
  and the original seminorm. -/
  map_smul_eq_mul (f : F) (a : 𝕜) (x : E) : f (a • x) = ‖a‖ * f x

{F : Type u_13}
{𝕜 : outParam (Type u_14)}
{E : outParam (Type u_15)}
[SeminormedRing 𝕜]
[AddGroup E]
[SMul 𝕜 E]
[FunLike F E ℝ]
[self : SeminormClass F 𝕜 E]
(f : F)
(a : 𝕜)
(x : E)


theorem Ioo_coe_coe : Ioo (a : WithTop α) b = (Ioo a b).map Embedding.some

(α : Type u_1)
[PartialOrder α]
[OrderTop α]
[LocallyFiniteOrder α]
(a b : α)

Finset.Ioo ↑a ↑b = Finset.map Function.Embedding.some (Finset.Ioo a b)


/-- The class `EquivLike E α β` expresses that terms of type `E` have an
injective coercion to bijections between `α` and `β`.

Note that this does not directly extend `FunLike`, nor take `FunLike` as a parameter,
so we can state `coe_injective'` in a nicer way.

This typeclass is used in the definition of the isomorphism (or equivalence) typeclasses,
such as `ZeroEquivClass`, `MulEquivClass`, `MonoidEquivClass`, ....
-/
class EquivLike (E : Sort*) (α β : outParam (Sort*)) where
  /-- The coercion to a function in the forward direction. -/
  coe : E → α → β
  /-- The coercion to a function in the backwards direction. -/
  inv : E → β → α
  /-- The coercions are left inverses. -/
  left_inv : ∀ e, Function.LeftInverse (inv e) (coe e)
  /-- The coercions are right inverses. -/
  right_inv : ∀ e, Function.RightInverse (inv e) (coe e)
  /-- The two coercions to functions are jointly injective. -/
  coe_injective' : ∀ e g, coe e = coe g → inv e = inv g → e = g

{E : Sort u_1}
{α : outParam (Sort u_2)}
{β : outParam (Sort u_3)}
[self : EquivLike E α β]
(e g : E)

EquivLike.coe e = EquivLike.coe g → EquivLike.inv e = EquivLike.inv g → e = g


theorem balanced_opposite [Balanced C] : Balanced Cᵒᵖ

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


theorem append_left_injective (t : List α) : Injective fun s ↦ s ++ t


@[reassoc (attr := simp)]
theorem image.fac : factorThruImage f ≫ image.ι f = f

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

CategoryTheory.Limits.factorThruImage f ≫ CategoryTheory.Limits.image.ι f = f


theorem _root_.algebraMap_memℓp_infty (k : 𝕜) : Memℓp (algebraMap 𝕜 (∀ i, B i) k) ∞

{I : Type u_3}
{𝕜 : Type u_4}
{B : I → Type u_5}
[NormedField 𝕜]
[(i : I) → NormedRing (B i)]
[(i : I) → NormedAlgebra 𝕜 (B i)]
[∀ (i : I), NormOneClass (B i)]
(k : 𝕜)

Memℓp ((algebraMap 𝕜 ((i : I) → B i)) k) ⊤


@[simp]
theorem sub_modEq_zero : a - b ≡ 0 [PMOD p] ↔ a ≡ b [PMOD p]

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


@[simp, norm_cast]
theorem coe_div (x y : ℝ) : ↑(x / y) = (x / y : ℝ*)


theorem HasDerivAt.smul_const (hc : HasDerivAt c c' x) (f : F) :
    HasDerivAt (fun y => c y • f) (c' • f) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : 𝕜}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{c : 𝕜 → 𝕜'}
{c' : 𝕜'}
(hc : HasDerivAt c c' x)
(f : F)


/-- For subgroups generated by a single element, see the simpler `zpow_induction_right`. -/
@[to_additive (attr := elab_as_elim)
  "For additive subgroups generated by a single element, see the simpler
  `zsmul_induction_right`."]
theorem closure_induction_right {p : (x : G) → x ∈ closure s → Prop} (one : p 1 (one_mem _))
    (mul_right : ∀ (x) hx, ∀ y (hy : y ∈ s), p x hx → p (x * y) (mul_mem hx (subset_closure hy)))
    (mul_right_inv : ∀ (x) hx, ∀ y (hy : y ∈ s), p x hx →
      p (x * y⁻¹) (mul_mem hx (inv_mem (subset_closure hy))))
    {x : G} (h : x ∈ closure s) : p x h

{p : (x : G) → x ∈ AddSubgroup.closure s → Prop}

(mul_right : ∀ (x : G) (hx : x ∈ AddSubgroup.closure s) (y : G) (hy : y ∈ s), p x hx → p (x + y) ⋯)

(mul_right_inv : ∀ (x : G) (hx : x ∈ AddSubgroup.closure s) (y : G) (hy : y ∈ s), p x hx → p (x + -y) ⋯)


@[simp]
theorem neg_negPart : (-j).negPart = j.posPart

(j : MeasureTheory.JordanDecomposition α)


theorem balanced_iff_neg_mem (hs : Convex ℝ s) : Balanced ℝ s ↔ ∀ ⦃x⦄, x ∈ s → -x ∈ s

{E : Type u_3}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
(hs : Convex ℝ s)

Balanced ℝ s ↔ ∀ ⦃x : E⦄, x ∈ s → -x ∈ s


/-- An element `ζ` is a primitive `k`-th root of unity if `ζ ^ k = 1`,
and if `l` satisfies `ζ ^ l = 1` then `k ∣ l`. -/
@[mk_iff IsPrimitiveRoot.iff_def]
structure IsPrimitiveRoot (ζ : M) (k : ℕ) : Prop where
  pow_eq_one : ζ ^ (k : ℕ) = 1
  dvd_of_pow_eq_one : ∀ l : ℕ, ζ ^ l = 1 → k ∣ l

{M : Type u_1}
[CommMonoid M]
(ζ : M)
(k : ℕ)

IsPrimitiveRoot ζ k ↔ ζ ^ k = 1 ∧ ∀ (l : ℕ), ζ ^ l = 1 → k ∣ l


theorem card_le_multiplicity_of_δ {s : Finset E} (hs : ∀ c ∈ s, ‖c‖ ≤ 2)
    (h's : ∀ c ∈ s, ∀ d ∈ s, c ≠ d → 1 - goodδ E ≤ ‖c - d‖) : s.card ≤ multiplicity E

(h's : ∀ c ∈ s, ∀ d ∈ s, c ≠ d → 1 - Besicovitch.goodδ E ≤ ‖c - d‖)


@[simp] lemma mem_measurableAtom_self (x : β) : x ∈ measurableAtom x

{β : Type u_2}
[MeasurableSpace β]
(x : β)


@[simp]
theorem hnot_symmDiff_self : (￢a) ∆ a = ⊤

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


@[simp]
theorem stereoInvFun_apply (hv : ‖v‖ = 1) (w : (ℝ ∙ v)ᗮ) :
    (stereoInvFun hv w : E) = (‖w‖ ^ 2 + 4)⁻¹ • ((4 : ℝ) • w + (‖w‖ ^ 2 - 4) • v)

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{v : E}
(hv : ‖v‖ = 1)
(w : ↥(Submodule.span ℝ {v})ᗮ)

↑(stereoInvFun hv w) = (‖w‖ ^ 2 + 4)⁻¹ • (4 • ↑w + (‖w‖ ^ 2 - 4) • v)


theorem MDifferentiableAt.sub (hf : MDifferentiableAt I 𝓘(𝕜, E') f z)
    (hg : MDifferentiableAt I 𝓘(𝕜, E') g z) : MDifferentiableAt I 𝓘(𝕜, E') (f - g) z

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{z : M}
{f g : M → E'}
(hf : MDifferentiableAt I 𝓘(𝕜, E') f z)
(hg : MDifferentiableAt I 𝓘(𝕜, E') g z)


theorem Complex.volume_sum_rpow_lt [Nonempty ι] {p : ℝ} (hp : 1 ≤ p) (r : ℝ) :
    volume {x : ι → ℂ | (∑ i, ‖x i‖ ^ p) ^ (1 / p) < r} = (.ofReal r) ^ (2 * card ι) *
      .ofReal ((π * Real.Gamma (2 / p + 1)) ^ card ι / Real.Gamma (2 * card ι / p + 1))

(ι : Type u_1)
[Fintype ι]
[Nonempty ι]
{p : ℝ}
(hp : 1 ≤ p)
(r : ℝ)

MeasureTheory.volume {x | (∑ i : ι, ‖x i‖ ^ p) ^ (1 / p) < r} =
  ENNReal.ofReal r ^ (2 * Fintype.card ι) *
    ENNReal.ofReal ((Real.pi * Real.Gamma (2 / p + 1)) ^ Fintype.card ι / Real.Gamma (2 * ↑(Fintype.card ι) / p + 1))


@[simp]
theorem adjoin_one : F⟮(1 : E)⟯ = ⊥

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]


@[simp]
theorem coe_copy (f : LatticeHom α β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f'

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
(f : LatticeHom α β)
(f' : α → β)
(h : f' = ⇑f)


@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
lemma piFinset_nonempty : (piFinset s).Nonempty ↔ ∀ a, (s a).Nonempty

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{γ : α → Type u_2}
{s : (a : α) → Finset (γ a)}

(Fintype.piFinset s).Nonempty ↔ ∀ (a : α), (s a).Nonempty


@[simp, bv_toNat] theorem toNat_cast (h : w = v) (x : BitVec w) : (cast h x).toNat = x.toNat


theorem IsNormal.vertexSubgroup (Sn : IsNormal S) (c : C) (cS : c ∈ S.objs) :
    (S.vertexSubgroup cS).Normal

{C : Type u}
[CategoryTheory.Groupoid C]
(S : CategoryTheory.Subgroupoid C)
(Sn : S.IsNormal)
(c : C)
(cS : c ∈ S.objs)


@[to_additive (attr := simp)]
theorem fst_inv : s⁻¹.fst = s.snd⁻¹

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


/-- Completion of normed group homs as a normed group hom. -/
@[simps]
def normedAddGroupHomCompletionHom :
    NormedAddGroupHom G H →+ NormedAddGroupHom (Completion G) (Completion H)

{G : Type u_1}
[SeminormedAddCommGroup G]
{H : Type u_2}
[SeminormedAddCommGroup H]
(f : NormedAddGroupHom G H)

normedAddGroupHomCompletionHom f = f.completion


lemma rootSpace_neg_nsmul_add_chainTop_of_le {n : ℕ} (hn : n ≤ chainLength α β) :
    rootSpace H (- (n • α) + chainTop α β) ≠ ⊥

(hn : n ≤ LieAlgebra.IsKilling.chainLength α β)

LieAlgebra.rootSpace H (-(n • ⇑α) + ⇑(LieModule.chainTop (⇑α) β)) ≠ ⊥


lemma cons_sublist_cons' {a b : α} : a :: l₁ <+ b :: l₂ ↔ a :: l₁ <+ l₂ ∨ a = b ∧ l₁ <+ l₂

(a :: l₁).Sublist (b :: l₂) ↔ (a :: l₁).Sublist l₂ ∨ a = b ∧ l₁.Sublist l₂


/-- A function that is complex differentiable on the open ball of radius `r ≤ ∞` around `c`
is given by evaluating its Taylor series at `c` on this open ball. -/
lemma taylorSeries_eq_on_emetric_ball' {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f (EMetric.ball c r)) :
    ∑' n : ℕ, (n ! : ℂ)⁻¹ * iteratedDeriv n f c * (z - c) ^ n = f z

∑' (n : ℕ), (↑n.factorial)⁻¹ * iteratedDeriv n f c * (z - c) ^ n = f z


@[to_additive prod_comp_prodMap]
theorem prod_comp_prodMap (f : P →ₙ* M) (g : P →ₙ* N) (f' : M →ₙ* M') (g' : N →ₙ* N') :
    (f'.prodMap g').comp (f.prod g) = (f'.comp f).prod (g'.comp g)

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
{M' : Type u_8}
{N' : Type u_9}
[Mul M]
[Mul N]
[Mul M']
[Mul N']
[Mul P]
(f : P →ₙ* M)
(g : P →ₙ* N)
(f' : M →ₙ* M')
(g' : N →ₙ* N')


/-- The inner product of a column of `A` and a column of `B` is an entry of `Aᴴ * B`. -/
theorem inner_matrix_col_col [Fintype m] (A B : Matrix m n 𝕜) (i j : n) :
    ⟪Aᵀ i, Bᵀ j⟫ₑ = (Aᴴ * B) i j

{𝕜 : Type u_3}
[RCLike 𝕜]
{m : Type u_8}
{n : Type u_9}
[Fintype m]
(A B : Matrix m n 𝕜)
(i j : n)

⟪(WithLp.equiv 2 (m → 𝕜)).symm (A.transpose i), (WithLp.equiv 2 (m → 𝕜)).symm (B.transpose j)⟫_𝕜 =
  (A.conjTranspose * B) i j


theorem mem_integralClosure_iff_mem_fg {r : A} :
    r ∈ integralClosure R A ↔ ∃ M : Subalgebra R A, M.toSubmodule.FG ∧ r ∈ M

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

r ∈ integralClosure R A ↔ ∃ M, (Subalgebra.toSubmodule M).FG ∧ r ∈ M


@[gcongr]
theorem product_subset_product_left (hs : s ⊆ s') : s ×ˢ t ⊆ s' ×ˢ t

{α : Type u_1}
{β : Type u_2}
{s s' : Finset α}
{t : Finset β}
(hs : s ⊆ s')

s ×ˢ t ⊆ s' ×ˢ t


@[deprecated isBoundedUnder_of (since := "2024-06-07")]
lemma Filter.isBounded_le_map_of_bounded_range {ι : Type*} (F : Filter ι) {f : ι → ℝ}
    (h : Bornology.IsBounded (Set.range f)) :
    (F.map f).IsBounded (· ≤ ·)

{ι : Type u_1}
(F : Filter ι)
{f : ι → ℝ}
(h : Bornology.IsBounded (Set.range f))

Filter.IsBounded (fun x x_1 => x ≤ x_1) (Filter.map f F)


@[to_additive]
theorem inv_le_one_of_one_le : 1 ≤ a → a⁻¹ ≤ 1

{α : Type u}
[OrderedAddCommGroup α]
{a : α}


@[deprecated "This lemma is unused, and can be proved by `simp`." (since := "2024-06-12")]
theorem toFinsupp_cons_apply_succ (x : M) (xs : List M) (n : ℕ)
    [DecidablePred (getD (x::xs) · 0 ≠ 0)] [DecidablePred (getD xs · 0 ≠ 0)] :
    (x::xs).toFinsupp n.succ = xs.toFinsupp n

[DecidablePred fun x_1 => (x :: xs).getD x_1 0 ≠ 0]

[DecidablePred fun x => xs.getD x 0 ≠ 0]

(x :: xs).toFinsupp n.succ = xs.toFinsupp n


theorem mapRange.addMonoidHom_comp (f : N →+ P) (f₂ : M →+ N) :
    (mapRange.addMonoidHom (f.comp f₂) : (α →₀ _) →+ _) =
      (mapRange.addMonoidHom f).comp (mapRange.addMonoidHom f₂)

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
{P : Type u_8}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
(f : N →+ P)
(f₂ : M →+ N)

Finsupp.mapRange.addMonoidHom (f.comp f₂) = (Finsupp.mapRange.addMonoidHom f).comp (Finsupp.mapRange.addMonoidHom f₂)


@[to_additive]
theorem disjoint_def {H₁ H₂ : Subgroup G} : Disjoint H₁ H₂ ↔ ∀ {x : G}, x ∈ H₁ → x ∈ H₂ → x = 1

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


theorem le_to_int {m n : ZNum} : (m : ℤ) ≤ n ↔ m ≤ n

↑m ≤ ↑n ↔ m ≤ n


/-- `ZeroAtInftyContinuousMapClass F α β` states that `F` is a type of continuous maps which
vanish at infinity.

You should also extend this typeclass when you extend `ZeroAtInftyContinuousMap`. -/
class ZeroAtInftyContinuousMapClass (F : Type*) (α β : outParam Type*) [TopologicalSpace α]
    [Zero β] [TopologicalSpace β] [FunLike F α β] extends ContinuousMapClass F α β : Prop where
  /-- Each member of the class tends to zero along the `cocompact` filter. -/
  zero_at_infty (f : F) : Tendsto f (cocompact α) (𝓝 0)

[self : ZeroAtInftyContinuousMapClass F α β]

Filter.Tendsto (⇑f) (Filter.cocompact α) (𝓝 0)


theorem rTensor_trans_apply : (f ≪≫ₗ g).rTensor M y = g.rTensor M (f.rTensor M y)

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

(LinearEquiv.rTensor M (f ≪≫ₗ g)) y = (LinearEquiv.rTensor M g) ((LinearEquiv.rTensor M f) y)


theorem card_eq [Finite α] [Finite β] : Nat.card α = Nat.card β ↔ Nonempty (α ≃ β)

{α : Type u_1}
{β : Type u_2}
[Finite α]
[Finite β]


@[simp]
theorem abs_eq_zero_iff {x : EReal} : x.abs = 0 ↔ x = 0


theorem sup_mul (a b c : ℝ≥0) : (a ⊔ b) * c = a * c ⊔ b * c


theorem lcm_dvd_mul (m n : ℕ) : lcm m n ∣ m * n


@[simp] lemma land_eq_and (p q : Num) : p.land q = p &&& q


theorem BlockTriangular.mul [Fintype m] {M N : Matrix m m R} (hM : BlockTriangular M b)
    (hN : BlockTriangular N b) : BlockTriangular (M * N) b

{α : Type u_1}
{m : Type u_3}
{R : Type v}
[CommRing R]
{b : m → α}
[LinearOrder α]
[Fintype m]
{M N : Matrix m m R}
(hM : M.BlockTriangular b)
(hN : N.BlockTriangular b)


@[simp]
theorem cocompact_eq_atTop [NoMaxOrder α] [OrderBot α]
    [ClosedIciTopology α] [CompactIccSpace α] : cocompact α = atTop

{α : Type u_2}
[LinearOrder α]
[TopologicalSpace α]
[NoMaxOrder α]
[OrderBot α]
[ClosedIciTopology α]
[CompactIccSpace α]


theorem iff_false_right (ha : ¬a) : (b ↔ a) ↔ ¬b


/-- The short complex `T.obj₁ ⟶ T.obj₂ ⟶ T.obj₃` attached to a distinguished triangle. -/
@[simps]
def shortComplexOfDistTriangle (T : Triangle C) (hT : T ∈ distTriang C) : ShortComplex C

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(CategoryTheory.Pretriangulated.shortComplexOfDistTriangle T hT).g = T.mor₂


@[simp]
theorem symm_trans' (h₁ : M ≃ₘ^n⟮I, I'⟯ M') (h₂ : M' ≃ₘ^n⟮I', J⟯ N) :
    (h₁.trans h₂).symm = h₂.symm.trans h₁.symm

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_5}
[TopologicalSpace H]
{H' : Type u_6}
[TopologicalSpace H']
{G : Type u_7}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{N : Type u_11}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}
(h₁ : M ≃ₘ^n⟮I, I'⟯ M')
(h₂ : M' ≃ₘ^n⟮I', J⟯ N)


/-- `S` is algebraic over `R` iff a fraction ring of `S` is algebraic over `R` -/
theorem isAlgebraic_iff' [Field K] [IsDomain R] [IsDomain S] [Algebra R K] [Algebra S K]
    [NoZeroSMulDivisors R K] [IsFractionRing S K] [IsScalarTower R S K] :
    Algebra.IsAlgebraic R S ↔ Algebra.IsAlgebraic R K

(R : Type u_1)
[CommRing R]
(S : Type u_2)
[CommRing S]
[Algebra R S]
(K : Type u_5)
[Field K]
[IsDomain R]
[IsDomain S]
[Algebra R K]
[Algebra S K]
[NoZeroSMulDivisors R K]
[IsFractionRing S K]
[IsScalarTower R S K]


theorem mem_chartAt_source_of_eq_one {i : ι} {x : M} (h : fs i x = 1) :
    x ∈ (chartAt H (fs.c i)).source

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
(fs : SmoothBumpCovering ι I M s)
{i : ι}
{x : M}
(h : ↑(fs.toFun i) x = 1)


lemma lieCharpoly_natDegree : (lieCharpoly R M x y).natDegree = finrank R M

(R : Type u_2)
{L : Type u_3}
(M : Type u_4)
[CommRing R]
[Nontrivial R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[Module.Finite R L]
[Module.Free R L]
[Module.Finite R M]
[Module.Free R M]
(x y : L)

(LieAlgebra.engel_isBot_of_isMin.lieCharpoly R M x y).natDegree = FiniteDimensional.finrank R M


/-- The conjugate transpose of a matrix mulitplied by the matrix is positive semidefinite -/
theorem posSemidef_conjTranspose_mul_self (A : Matrix m n R) : PosSemidef (Aᴴ * A)

{m : Type u_1}
{n : Type u_2}
{R : Type u_3}
[Fintype m]
[Fintype n]
[CommRing R]
[PartialOrder R]
[StarRing R]
[StarOrderedRing R]
(A : Matrix m n R)


/-- If the extended distance between consecutive points of a sequence is estimated
by a summable series of `NNReal`s, then the original sequence is a Cauchy sequence. -/
theorem cauchySeq_of_edist_le_of_summable [PseudoEMetricSpace α] {f : ℕ → α} (d : ℕ → ℝ≥0)
    (hf : ∀ n, edist (f n) (f n.succ) ≤ d n) (hd : Summable d) : CauchySeq f

(hf : ∀ (n : ℕ), edist (f n) (f n.succ) ≤ ↑(d n))


lemma finRotate_succ (n : ℕ) :
    finRotate (n + 1) = finAddFlip.trans (finCongr (Nat.add_comm 1 n))

finRotate (n + 1) = finAddFlip.trans (finCongr ⋯)


theorem kronecker_add [Distrib α] (A : Matrix l m α) (B₁ B₂ : Matrix n p α) :
    A ⊗ₖ (B₁ + B₂) = A ⊗ₖ B₁ + A ⊗ₖ B₂

{α : Type u_2}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
{p : Type u_11}
[Distrib α]
(A : Matrix l m α)
(B₁ B₂ : Matrix n p α)

Matrix.kroneckerMap (fun x x_1 => x * x_1) A (B₁ + B₂) =
  Matrix.kroneckerMap (fun x x_1 => x * x_1) A B₁ + Matrix.kroneckerMap (fun x x_1 => x * x_1) A B₂


theorem WithSeminorms.image_isVonNBounded_iff_finset_seminorm_bounded (f : G → E) {s : Set G}
    (hp : WithSeminorms p) :
    Bornology.IsVonNBounded 𝕜 (f '' s) ↔
      ∀ I : Finset ι, ∃ r > 0, ∀ x ∈ s, I.sup p (f x) < r

{𝕜 : Type u_1}
{E : Type u_5}
{G : Type u_7}
{ι : Type u_8}
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Nonempty ι]
{p : SeminormFamily 𝕜 E ι}
[TopologicalSpace E]
(f : G → E)
{s : Set G}
(hp : WithSeminorms p)

Bornology.IsVonNBounded 𝕜 (f '' s) ↔ ∀ (I : Finset ι), ∃ r > 0, ∀ x ∈ s, (I.sup p) (f x) < r


theorem support_esymm' (n : ℕ) [DecidableEq σ] [Nontrivial R] :
    (esymm σ R n).support =
      (powersetCard n (univ : Finset σ)).biUnion fun t => {∑ i ∈ t, Finsupp.single i 1}

(σ : Type u_1)
(R : Type u_2)
[CommSemiring R]
[Fintype σ]
(n : ℕ)
[DecidableEq σ]
[Nontrivial R]

(MvPolynomial.esymm σ R n).support = (Finset.powersetCard n Finset.univ).biUnion fun t => {∑ i ∈ t, Finsupp.single i 1}


@[to_additive]
theorem smul_def : a • x = x.map id fun _ => (a • ·)

{ι : Type u_1}
{M : Type u_2}
{α : ι → Type u_4}
[(i : ι) → VAdd M (α i)]
(a : M)
(x : (i : ι) × α i)

a +ᵥ x = Sigma.map id (fun x x_1 => a +ᵥ x_1) x


@[simp]
lemma coe_mk (S : Subalgebra R A) (h) : ((⟨S, h⟩ : StarSubalgebra R A) : Set A) = S

(h : ∀ {a : A}, a ∈ S.carrier → star a ∈ S.carrier)

↑{ toSubalgebra := S, star_mem' := h } = ↑S


@[reassoc (attr := simp)]
theorem ε_naturality {X Y : C} (f : X ⟶ Y) : F.ε.app X ≫ (F.obj (𝟙_ M)).map f = f ≫ F.ε.app Y

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

CategoryTheory.CategoryStruct.comp (F.ε.app X) ((F.obj (𝟙_ M)).map f) = CategoryTheory.CategoryStruct.comp f (F.ε.app Y)


@[reassoc]
lemma totalFlipIsoX_hom_D₁ (j j' : J) :
    (K.totalFlipIsoX c j).hom ≫ K.D₁ c j j' =
      K.flip.D₂ c j j' ≫ (K.totalFlipIsoX c j').hom

{C : Type u_1}
{I₁ : Type u_2}
{I₂ : Type u_3}
{J : Type u_4}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Preadditive C]
{c₁ : ComplexShape I₁}
{c₂ : ComplexShape I₂}
(K : HomologicalComplex₂ C c₁ c₂)
(c : ComplexShape J)
[TotalComplexShape c₁ c₂ c]
[TotalComplexShape c₂ c₁ c]
[TotalComplexShapeSymmetry c₁ c₂ c]
[K.HasTotal c]
[K.flip.HasTotal c]
[DecidableEq J]
(j j' : J)


/-- **Ruzsa's triangle inequality**. Multiplication version. -/
@[to_additive "**Ruzsa's triangle inequality**. Addition version."]
theorem ruzsa_triangle_inequality_mul_mul_mul (A B C : Finset α) :
    (A * C).card * B.card ≤ (A * B).card * (B * C).card

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

(A + C).card * B.card ≤ (A + B).card * (B + C).card


@[simp]
theorem subtype_comp_codRestrict (f : M ↪[L] N) (p : L.Substructure N) (h : ∀ b, f b ∈ p) :
    p.subtype.comp (codRestrict p f h) = f

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

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


theorem symmDiff_def [∀ i, GeneralizedCoheytingAlgebra (π i)] (a b : ∀ i, π i) :
    a ∆ b = fun i => a i ∆ b i

[(i : ι) → GeneralizedCoheytingAlgebra (π i)]


@[simp]
theorem lift.principalSeg_top : (lift.principalSeg.{u,v}).top = univ.{u,v}

Ordinal.lift.principalSeg.top = Ordinal.univ.{u, v}


theorem add (hf : DiffContOnCl 𝕜 f s) (hg : DiffContOnCl 𝕜 g s) : DiffContOnCl 𝕜 (f + g) s

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


/-- If `f : X → Y` is an `Embedding`, the image `f '' s` of a set `s` is compact
  if and only if `s` is compact. -/
theorem Embedding.isCompact_iff {f : X → Y} (hf : Embedding f) :
    IsCompact s ↔ IsCompact (f '' s)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{s : Set X}
{f : X → Y}
(hf : Embedding f)


lemma lintegral_condKernel (hf : Measurable f) (a : α) :
    ∫⁻ b, ∫⁻ ω, f (b, ω) ∂(Kernel.condKernel κ (a, b)) ∂(Kernel.fst κ a) = ∫⁻ x, f x ∂(κ a)

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

{f : β × Ω → ℝ≥0∞}

∫⁻ (b : β), ∫⁻ (ω : Ω), f (b, ω) ∂κ.condKernel (a, b) ∂κ.fst a = ∫⁻ (x : β × Ω), f x ∂κ a


theorem ne_zero_of_not_isOrtho_self {Q : QuadraticMap R M N} (x : M) (hx₁ : ¬Q.IsOrtho x x) :
    x ≠ 0

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
{Q : QuadraticMap R M N}
(x : M)
(hx₁ : ¬Q.IsOrtho x x)


@[simp]
theorem lift_comp_of (F : FreeLieAlgebra R X →ₗ⁅R⁆ L) : lift R (F ∘ of R) = F

{R : Type u}
{X : Type v}
[CommRing R]
{L : Type w}
[LieRing L]
[LieAlgebra R L]
(F : FreeLieAlgebra R X →ₗ⁅R⁆ L)

(FreeLieAlgebra.lift R) (⇑F ∘ FreeLieAlgebra.of R) = F


lemma mem_integer_iff (r : R) : r ∈ v.integer ↔ v r ≤ 1

{R : Type u}
{Γ₀ : Type v}
[Ring R]
[LinearOrderedCommGroupWithZero Γ₀]
(v : Valuation R Γ₀)
(r : R)


theorem Perm.permutations' {s t : List α} (p : s ~ t) : permutations' s ~ permutations' t

{α : Type u_1}
{s t : List α}
(p : s.Perm t)


@[to_additive]
theorem mulSupport_subset_comp {g : M → N} (hg : ∀ {x}, g x = 1 → x = 1) (f : α → M) :
    mulSupport f ⊆ mulSupport (g ∘ f)

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
[One M]
[One N]
{g : M → N}
(hg : ∀ {x : M}, g x = 1 → x = 1)
(f : α → M)

Function.mulSupport f ⊆ Function.mulSupport (g ∘ f)


theorem isSubterminal_of_terminal [HasTerminal C] : IsSubterminal (⊤_ C)

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


@[simp] lemma map_mk (x : K) (hx) : algebraMap (𝓞 K) K ⟨x, hx⟩ = x

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

(algebraMap (NumberField.RingOfIntegers K) K) ⟨x, hx⟩ = x


/-- If `R` preserves the appropriate limit, then given a cone for `F ⋙ fst L R : J ⥤ L` and a
limit cone for `F ⋙ snd L R : J ⥤ R` we can build a cone for `F` which will turn out to be a limit
cone.
-/
@[simps]
def coneOfPreserves [PreservesLimit (F ⋙ snd L R) R] (c₁ : Cone (F ⋙ fst L R))
    {c₂ : Cone (F ⋙ snd L R)} (t₂ : IsLimit c₂) : Cone F

(F : CategoryTheory.Functor J (CategoryTheory.Comma L R))

[CategoryTheory.Limits.PreservesLimit (F.comp (CategoryTheory.Comma.snd L R)) R]

(c₁ : CategoryTheory.Limits.Cone (F.comp (CategoryTheory.Comma.fst L R)))

{c₂ : CategoryTheory.Limits.Cone (F.comp (CategoryTheory.Comma.snd L R))}

(CategoryTheory.Comma.coneOfPreserves F c₁ t₂).pt.left = c₁.pt


@[simp]
theorem add_apply {M N : Mat_ C} (f g : M ⟶ N) (i j) : (f + g) i j = f i j + g i j

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Preadditive C]
{M N : CategoryTheory.Mat_ C}
(f g : M ⟶ N)
(i : M.ι)
(j : N.ι)


@[to_additive (attr := simp)]
theorem orbit.coe_smul {a : α} {m : M} {a' : orbit M a} : ↑(m • a') = m • (a' : α)

{M : Type u}
[AddMonoid M]
{α : Type v}
[AddAction M α]
{a : α}
{m : M}
{a' : ↑(AddAction.orbit M a)}


/-- Under the coercion from `ℤ` to `ℝ`, inverse images of compact sets are finite. -/
theorem tendsto_coe_cofinite : Tendsto ((↑) : ℤ → ℝ) cofinite (cocompact ℝ)

Filter.Tendsto Int.cast Filter.cofinite (Filter.cocompact ℝ)


theorem RingHom.IsIntegral.tower_top (h : (g.comp f).IsIntegral) : g.IsIntegral

{R : Type u_1}
{S : Type u_4}
{T : Type u_5}
[CommRing R]
[CommRing S]
[CommRing T]
(f : R →+* S)
(g : S →+* T)
(h : (g.comp f).IsIntegral)


lemma map_comp {a b c : M} (f : ShiftedHom X Y a) (g : ShiftedHom Y Z b)
    (h : b + a = c) (F : C ⥤ D) [F.CommShift M] :
    (f.comp g h).map F = (f.map F).comp (g.map F) h

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
{D : Type u_2}
[CategoryTheory.Category.{u_6, u_2} D]
{M : Type u_4}
[AddMonoid M]
[CategoryTheory.HasShift C M]
[CategoryTheory.HasShift D M]
{X Y Z : C}
{a b c : M}
(f : CategoryTheory.ShiftedHom X Y a)
(g : CategoryTheory.ShiftedHom Y Z b)
(h : b + a = c)
(F : CategoryTheory.Functor C D)
[F.CommShift M]


theorem intCast_fst (n : ℤ) : (n : 𝓜(𝕜, A)).fst = n

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]
(n : ℤ)


/-- The base function from which one will construct a family of bump functions. One could
add more properties if they are useful and satisfied in the examples of inner product spaces
and finite dimensional vector spaces, notably derivative norm control in terms of `R - 1`.

TODO: do we ever need `f x = 1 ↔ ‖x‖ ≤ 1`? -/
-- Porting note(#5171): linter not yet ported; was @[nolint has_nonempty_instance]
structure ContDiffBumpBase (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] where
  /-- The function underlying this family of bump functions -/
  toFun : ℝ → E → ℝ
  mem_Icc : ∀ (R : ℝ) (x : E), toFun R x ∈ Icc (0 : ℝ) 1
  symmetric : ∀ (R : ℝ) (x : E), toFun R (-x) = toFun R x
  smooth : ContDiffOn ℝ ⊤ (uncurry toFun) (Ioi (1 : ℝ) ×ˢ (univ : Set E))
  eq_one : ∀ R : ℝ, 1 < R → ∀ x : E, ‖x‖ ≤ 1 → toFun R x = 1
  support : ∀ R : ℝ, 1 < R → Function.support (toFun R) = Metric.ball (0 : E) R

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(self : ContDiffBumpBase E)

ContDiffOn ℝ ⊤ (Function.uncurry self.toFun) (Set.Ioi 1 ×ˢ Set.univ)


@[to_additive (attr := simp)]
theorem coe_mulRight (a : G) : ⇑(Equiv.mulRight a) = fun x => x * a


theorem Finset.nnnorm_prod_le' {α : Type*} [NormedCommRing α] (s : Finset ι) (hs : s.Nonempty)
    (f : ι → α) : ‖∏ i ∈ s, f i‖₊ ≤ ∏ i ∈ s, ‖f i‖₊

{ι : Type u_4}
{α : Type u_5}
[NormedCommRing α]
(s : Finset ι)
(hs : s.Nonempty)
(f : ι → α)

‖∏ i ∈ s, f i‖₊ ≤ ∏ i ∈ s, ‖f i‖₊


theorem regionBetween_subset (f g : α → ℝ) (s : Set α) : regionBetween f g s ⊆ s ×ˢ univ

{α : Type u_1}
(f g : α → ℝ)
(s : Set α)


@[simp] theorem map_dropLast (f : α → β) (l : List α) : l.dropLast.map f = (l.map f).dropLast

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

List.map f l.dropLast = (List.map f l).dropLast


/-- A greatest element of a set is the supremum of this set. -/
theorem IsGreatest.csSup_eq (H : IsGreatest s a) : sSup s = a

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s : Set α}
{a : α}
(H : IsGreatest s a)


/-- An affine equivalence, denoted `P₁ ≃ᵃ[k] P₂`, is an equivalence between affine spaces
such that both forward and inverse maps are affine.

We define it using an `Equiv` for the map and a `LinearEquiv` for the linear part in order
to allow affine equivalences with good definitional equalities. -/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure AffineEquiv (k P₁ P₂ : Type*) {V₁ V₂ : Type*} [Ring k] [AddCommGroup V₁] [Module k V₁]
  [AddTorsor V₁ P₁] [AddCommGroup V₂] [Module k V₂] [AddTorsor V₂ P₂] extends P₁ ≃ P₂ where
  linear : V₁ ≃ₗ[k] V₂
  map_vadd' : ∀ (p : P₁) (v : V₁), toEquiv (v +ᵥ p) = linear v +ᵥ toEquiv p

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_4}
{V₂ : Type u_5}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
(self : P₁ ≃ᵃ[k] P₂)
(p : P₁)
(v : V₁)

self.toEquiv (v +ᵥ p) = self.linear v +ᵥ self.toEquiv p


theorem length_cyclicPermutations_cons (x : α) (l : List α) :
    length (cyclicPermutations (x :: l)) = length l + 1

(x :: l).cyclicPermutations.length = l.length + 1


@[simp, norm_cast]
theorem coe_smul [Zero M] [SMulZeroClass R M] (b : R) (v : α →₀ M) : ⇑(b • v) = b • ⇑v

{α : Type u_1}
{M : Type u_5}
{R : Type u_11}
[Zero M]
[SMulZeroClass R M]
(b : R)
(v : α →₀ M)


protected theorem disjoint : (P.parts : Set α).PairwiseDisjoint id

{α : Type u_1}
[Lattice α]
[OrderBot α]
{a : α}
(P : Finpartition a)


protected lemma Odd.zpow_nonneg_iff (hn : Odd n) : 0 ≤ a ^ n ↔ 0 ≤ a

{α : Type u_1}
[LinearOrderedField α]
{a : α}
{n : ℤ}
(hn : Odd n)


@[gcongr]
lemma log_le_log (hx : 0 < x) (hxy : x ≤ y) : log x ≤ log y


@[to_additive]
theorem smul_def : s • t = (s ×ˢ t).image fun p : α × β => p.1 • p.2

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

s +ᵥ t = Finset.image (fun p => p.1 +ᵥ p.2) (s ×ˢ t)


@[simp]
theorem prod_norm_eq_card (f : WithLp 0 (α × β)) :
    ‖f‖ = (if ‖f.fst‖ = 0 then 0 else 1) + (if ‖f.snd‖ = 0 then 0 else 1)

{α : Type u_2}
{β : Type u_3}
[Norm α]
[Norm β]
(f : WithLp 0 (α × β))

‖f‖ = (if ‖f.1‖ = 0 then 0 else 1) + if ‖f.2‖ = 0 then 0 else 1


@[simp] theorem add_emod_self {a b : Int} : (a + b) % b = a % b


theorem not_isReduced_alternatingWord (i i' : B) {m : ℕ} (hM : M i i' ≠ 0) (hm : m > M i i') :
    ¬cs.IsReduced (alternatingWord i i' m)

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(i i' : B)
{m : ℕ}
(hM : M.M i i' ≠ 0)
(hm : m > M.M i i')

¬cs.IsReduced (CoxeterSystem.alternatingWord i i' m)


@[simp, norm_cast]
theorem toENNReal_coe (n : ℕ) : ((n : ℕ∞) : ℝ≥0∞) = n


theorem nadd_le_nadd_iff_left : ∀ (a) {b c}, a ♯ b ≤ a ♯ c ↔ b ≤ c

(a : Ordinal.{u_1})
{b c : Ordinal.{u_1}}


/-- The monoidal structure coming from finite products is symmetric.
-/
@[simps]
def symmetricOfHasFiniteProducts [HasTerminal C] [HasBinaryProducts C] : SymmetricCategory C

β_ X Y = CategoryTheory.Limits.prod.braiding X Y


/-- An induction principle for elements of `⨆ i, S i`.
If `C` holds for `1` and all elements of `S i` for all `i`, and is preserved under multiplication,
then it holds for all elements of the supremum of `S`. -/
@[to_additive (attr := elab_as_elim) " An induction principle for elements of `⨆ i, S i`.
If `C` holds for `0` and all elements of `S i` for all `i`, and is preserved under addition,
then it holds for all elements of the supremum of `S`. "]
theorem iSup_induction {ι : Sort*} (S : ι → Subgroup G) {C : G → Prop} {x : G} (hx : x ∈ ⨆ i, S i)
    (mem : ∀ (i), ∀ x ∈ S i, C x) (one : C 1) (mul : ∀ x y, C x → C y → C (x * y)) : C x

(mul : ∀ (x y : G), C x → C y → C (x * y))


theorem Fix.ind {α : TypeVec n} (p : Fix F α → Prop)
    (h : ∀ x : F (α.append1 (Fix F α)), LiftP (PredLast α p) x → p (Fix.mk x)) : ∀ x, p x

(h : ∀ (x : F (α ::: MvQPF.Fix F α)), MvFunctor.LiftP (α.PredLast p) x → p (MvQPF.Fix.mk x))


theorem iSup_subtype' {p : ι → Prop} {f : ∀ i, p i → α} :
    ⨆ (i) (h), f i h = ⨆ x : Subtype p, f x x.property

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
{p : ι → Prop}
{f : (i : ι) → p i → α}


@[fun_prop]
theorem HasFDerivAt.smul (hc : HasFDerivAt c c' x) (hf : HasFDerivAt f f' x) :
    HasFDerivAt (fun y => c y • f y) (c x • f' + c'.smulRight (f x)) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{x : E}
{𝕜' : Type u_6}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{c : E → 𝕜'}
{c' : E →L[𝕜] 𝕜'}
(hc : HasFDerivAt c c' x)
(hf : HasFDerivAt f f' x)


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

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


@[reassoc]
theorem coprod.map_id_comp {X Y Z W : C} (f : X ⟶ Y) (g : Y ⟶ Z) [HasBinaryCoproduct W X]
    [HasBinaryCoproduct W Y] [HasBinaryCoproduct W Z] :
    coprod.map (𝟙 W) (f ≫ g) = coprod.map (𝟙 W) f ≫ coprod.map (𝟙 W) g

CategoryTheory.Limits.coprod.map (𝟙 W) (f ≫ g) =
  CategoryTheory.Limits.coprod.map (𝟙 W) f ≫ CategoryTheory.Limits.coprod.map (𝟙 W) g


@[to_additive (attr := simp)]
theorem empty_mul (s : Finset α) : ∅ * s = ∅

{α : Type u_2}
[DecidableEq α]
[Mul α]
(s : Finset α)


/-- This property implies `IsRatCondKernelCDF`. The measurability, integrability and integral
conditions are the same, but the limit properties of `IsRatCondKernelCDF` are replaced by
limits of integrals. -/
structure IsRatCondKernelCDFAux (f : α × β → ℚ → ℝ) (κ : Kernel α (β × ℝ)) (ν : Kernel α β) :
    Prop :=
  measurable : Measurable f
  mono' (a : α) {q r : ℚ} (_hqr : q ≤ r) : ∀ᵐ c ∂(ν a), f (a, c) q ≤ f (a, c) r
  nonneg' (a : α) (q : ℚ) : ∀ᵐ c ∂(ν a), 0 ≤ f (a, c) q
  le_one' (a : α) (q : ℚ) : ∀ᵐ c ∂(ν a), f (a, c) q ≤ 1
  /- Same as `Tendsto (fun q : ℚ ↦ ∫ c, f (a, c) q ∂(ν a)) atBot (𝓝 0)` but slightly easier
  to prove in the current applications of this definition (some integral convergence lemmas
  currently apply only to `ℕ`, not `ℚ`) -/
  tendsto_integral_of_antitone (a : α) (seq : ℕ → ℚ) (_hs : Antitone seq)
    (_hs_tendsto : Tendsto seq atTop atBot) :
    Tendsto (fun m ↦ ∫ c, f (a, c) (seq m) ∂(ν a)) atTop (𝓝 0)
  /- Same as `Tendsto (fun q : ℚ ↦ ∫ c, f (a, c) q ∂(ν a)) atTop (𝓝 (ν a univ).toReal)` but
  slightly easier to prove in the current applications of this definition (some integral convergence
  lemmas currently apply only to `ℕ`, not `ℚ`) -/
  tendsto_integral_of_monotone (a : α) (seq : ℕ → ℚ) (_hs : Monotone seq)
    (_hs_tendsto : Tendsto seq atTop atTop) :
    Tendsto (fun m ↦ ∫ c, f (a, c) (seq m) ∂(ν a)) atTop (𝓝 (ν a univ).toReal)
  integrable (a : α) (q : ℚ) : Integrable (fun c ↦ f (a, c) q) (ν a)
  setIntegral (a : α) {A : Set β} (_hA : MeasurableSet A) (q : ℚ) :
    ∫ c in A, f (a, c) q ∂(ν a) = (κ a (A ×ˢ Iic ↑q)).toReal

{f : α × β → ℚ → ℝ}

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

(self : ProbabilityTheory.IsRatCondKernelCDFAux f κ ν)

∫ (c : β) in A, f (a, c) q ∂ν a = ((κ a) (A ×ˢ Set.Iic ↑q)).toReal


/-- An isomorphism of comonads gives a natural isomorphism of the underlying functors.
-/
@[simps!]
def ComonadIso.toNatIso {M N : Comonad C} (h : M ≅ N) : (M : C ⥤ C) ≅ N

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{M N : CategoryTheory.Comonad C}
(h : M ≅ N)

(CategoryTheory.ComonadIso.toNatIso h).inv = h.inv.toNatTrans


@[simp]
theorem toIcoMod_add_zsmul (a b : α) (m : ℤ) : toIcoMod hp a (b + m • p) = toIcoMod hp a b

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


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


@[to_additive (attr := simp)]
theorem eventuallyConst_inv_set_ae :
    EventuallyConst (s⁻¹ : Set G) (ae μ) ↔ EventuallyConst s (ae μ)

{G : Type u_1}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd₂ G]
(μ : MeasureTheory.Measure G)
[MeasureTheory.SFinite μ]
{s : Set G}
[MeasurableNeg G]
[μ.IsAddLeftInvariant]

Filter.EventuallyConst (-s) (MeasureTheory.ae μ) ↔ Filter.EventuallyConst s (MeasureTheory.ae μ)


@[simp]
theorem append1_cases_append1 {C : TypeVec (n + 1) → Sort u} (H : ∀ α β, C (append1 α β)) (α β) :
    @append1Cases _ C H (append1 α β) = H α β

(H : (α : TypeVec.{u_1} n) → (β : Type u_1) → C (α ::: β))

TypeVec.append1Cases H (α ::: β) = H α β


theorem IsPartition.compl_eq_bot {π : Prepartition I} (h : IsPartition π) : π.compl = ⊥

{ι : Type u_1}
{I : BoxIntegral.Box ι}
[Finite ι]
{π : BoxIntegral.Prepartition I}
(h : π.IsPartition)


theorem derivWithin_const_smul (hxs : UniqueDiffWithinAt 𝕜 s x) (c : R)
    (hf : DifferentiableWithinAt 𝕜 f s x) :
    derivWithin (fun y => c • f y) s x = c • derivWithin f s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
{s : Set 𝕜}
{R : Type u_2}
[Semiring R]
[Module R F]
[SMulCommClass 𝕜 R F]
[ContinuousConstSMul R F]
(hxs : UniqueDiffWithinAt 𝕜 s x)
(c : R)
(hf : DifferentiableWithinAt 𝕜 f s x)


@[simp]
lemma app_localPreimage {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) {U : Cᵒᵖ} (s : G.obj U)
    {V : C} (g : V ⟶ U.unop) (hg : imageSieve f s g) :
    f.app _ (localPreimage f s g hg) = G.map g.op s

(s : (CategoryTheory.forget A).obj (G.obj U))

(hg : (CategoryTheory.Presheaf.imageSieve f s).arrows g)

(f.app (Opposite.op V)) (CategoryTheory.Presheaf.localPreimage f s g hg) = (G.map g.op) s


@[to_additive]
theorem MulHom.comp_apply [Mul M] [Mul N] [Mul P] (g : N →ₙ* P) (f : M →ₙ* N) (x : M) :
    g.comp f x = g (f x)

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[Add M]
[Add N]
[Add P]
(g : AddHom N P)
(f : AddHom M N)
(x : M)


/-- If a function is `C^n` with `n ≥ 1` at a point, then it is differentiable there. -/
theorem ContDiffAt.differentiableAt (h : ContDiffAt 𝕜 n f x) (hn : 1 ≤ n) :
    DifferentiableAt 𝕜 f x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{n : ℕ∞}
(h : ContDiffAt 𝕜 n f x)
(hn : 1 ≤ n)


/-- An `R` algebra `A` is formally étale if for every `R`-algebra, every square-zero ideal
`I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists exactly one lift `A →ₐ[R] B`.

See <https://stacks.math.columbia.edu/tag/00UQ> -/
@[mk_iff]
class FormallyEtale : Prop where
  comp_bijective :
    ∀ ⦃B : Type u⦄ [CommRing B],
      ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥),
        Function.Bijective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I)

(R : Type u)
[CommSemiring R]
(A : Type u)
[Semiring A]
[Algebra R A]

Algebra.FormallyEtale R A ↔
  ∀ ⦃B : Type u⦄ [inst : CommRing B] [inst_1 : Algebra R B] (I : Ideal B),
    I ^ 2 = ⊥ → Function.Bijective (Ideal.Quotient.mkₐ R I).comp


theorem IsLittleO.right_isBigO_add' {f₁ f₂ : α → E'} (h : f₁ =o[l] f₂) :
    f₂ =O[l] (f₂ + f₁)

{α : Type u_1}
{E' : Type u_6}
[SeminormedAddCommGroup E']
{l : Filter α}
{f₁ f₂ : α → E'}
(h : f₁ =o[l] f₂)


/-- Given a (completely) multiplicative function `f : ℕ → F`, where `F` is a normed field,
such that `‖f p‖ < 1` for all primes `p`, we can express the sum of `f n` over all `s`-factored
positive integers `n` as a product of `(1 - f p)⁻¹` over the primes `p ∈ s`. At the same time,
we show that the sum involved converges absolutely. -/
lemma summable_and_hasSum_factoredNumbers_prod_filter_prime_geometric {f : ℕ →* F}
    (h : ∀ {p : ℕ}, p.Prime → ‖f p‖ < 1) (s : Finset ℕ) :
    Summable (fun m : factoredNumbers s ↦ ‖f m‖) ∧
      HasSum (fun m : factoredNumbers s ↦ f m) (∏ p ∈ s.filter Nat.Prime, (1 - f p)⁻¹)

(h : ∀ {p : ℕ}, Nat.Prime p → ‖f p‖ < 1)

(Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p ∈ Finset.filter Nat.Prime s, (1 - f p)⁻¹)


lemma arctan_ne_mul_pi_div_two {x : ℝ} : ∀ (k : ℤ), arctan x ≠ (2 * k + 1) * π / 2

Real.arctan x ≠ (2 * ↑k + 1) * Real.pi / 2


@[to_additive]
lemma IsCompact.smul_set {k : Set M} {u : Set X} (hk : IsCompact k) (hu : IsCompact u) :
    IsCompact (k • u)

{M : Type u_1}
{X : Type u_2}
[TopologicalSpace M]
[TopologicalSpace X]
[VAdd M X]
[ContinuousVAdd M X]
{k : Set M}
{u : Set X}
(hk : IsCompact k)
(hu : IsCompact u)


theorem le_one_iff {p : Associates α} : p ≤ 1 ↔ p = 1

{α : Type u_1}
[CancelCommMonoidWithZero α]
{p : Associates α}


protected theorem pow_zero (n : Nat) : n^0 = 1


@[simp]
theorem map_injective {f : α → γ} {g : β → δ} :
    Injective (Sum.map f g) ↔ Injective f ∧ Injective g

{α : Type u}
{β : Type v}
{γ : Type u_1}
{δ : Type u_2}
{f : α → γ}
{g : β → δ}

Function.Injective (Sum.map f g) ↔ Function.Injective f ∧ Function.Injective g


theorem bounded_gt_Ici [Preorder α] [NoMinOrder α] (a : α) : Bounded (· > ·) (Ici a)

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

Set.Bounded (fun x x_1 => x > x_1) (Set.Ici a)


theorem measure_eq_measure_smaller_of_between_null_diff {s₁ s₂ s₃ : Set α} (h12 : s₁ ⊆ s₂)
    (h23 : s₂ ⊆ s₃) (h_nulldiff : μ (s₃ \ s₁) = 0) : μ s₁ = μ s₂

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s₁ s₂ s₃ : Set α}
(h12 : s₁ ⊆ s₂)
(h23 : s₂ ⊆ s₃)
(h_nulldiff : μ (s₃ \ s₁) = 0)


lemma atBot_eq_pure_of_isBot [LinearOrder α] {x : α} (hx : IsBot x) :
    (atBot : Filter α) = pure x

{α : Type u}
[LinearOrder α]
{x : α}
(hx : IsBot x)


theorem joinM_map_joinM {α : Type u} (a : m (m (m α))) : joinM (joinM <$> a) = joinM (joinM a)

{m : Type u → Type u}
[Monad m]
[LawfulMonad m]
{α : Type u}
(a : m (m (m α)))


/-- finite p-groups with different p have coprime orders -/
theorem coprime_card_of_ne {G₂ : Type*} [Group G₂] (p₁ p₂ : ℕ) [hp₁ : Fact p₁.Prime]
    [hp₂ : Fact p₂.Prime] (hne : p₁ ≠ p₂) (H₁ : Subgroup G) (H₂ : Subgroup G₂) [Finite H₁]
    [Finite H₂] (hH₁ : IsPGroup p₁ H₁) (hH₂ : IsPGroup p₂ H₂) :
    Nat.Coprime (Nat.card H₁) (Nat.card H₂)

{G : Type u_1}
[Group G]
{G₂ : Type u_2}
[Group G₂]
(p₁ p₂ : ℕ)
[hp₁ : Fact (Nat.Prime p₁)]
[hp₂ : Fact (Nat.Prime p₂)]
(hne : p₁ ≠ p₂)
(H₁ : Subgroup G)
(H₂ : Subgroup G₂)
[Finite ↥H₁]
[Finite ↥H₂]
(hH₁ : IsPGroup p₁ ↥H₁)
(hH₂ : IsPGroup p₂ ↥H₂)


@[simp]
lemma ltTrichotomy_eq (h : x = y) : ltTrichotomy x y p q r = q

{α : Type u_2}
[LinearOrder α]
{P : Sort u_5}
{x y : α}
{p q r : P}
(h : x = y)


theorem SmoothWithinAt.smoothAt (h : SmoothWithinAt I I' f s x) (ht : s ∈ 𝓝 x) :
    SmoothAt I I' f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
{s : Set M}
{x : M}
(h : SmoothWithinAt I I' f s x)
(ht : s ∈ 𝓝 x)


@[to_additive]
theorem smul_subset_smul_left : t₁ ⊆ t₂ → s • t₁ ⊆ s • t₂

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

t₁ ⊆ t₂ → s • t₁ ⊆ s • t₂


lemma sum_div (s : Finset ι) (f : ι → α) (a : α) :
    (∑ i ∈ s, f i) / a = ∑ i ∈ s, f i / a

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


@[to_additive]
theorem closure.isSubgroup (s : Set G) : IsSubgroup (closure s)


theorem separable_X_sub_C {x : R} : Separable (X - C x)

(Polynomial.X - Polynomial.C x).Separable


@[simp]
theorem map_append (f : α → β) (s t) : map f (append s t) = append (map f s) (map f t)

{α : Type u}
{β : Type v}
(f : α → β)
(s t : Stream'.Seq α)

Stream'.Seq.map f (s.append t) = (Stream'.Seq.map f s).append (Stream'.Seq.map f t)


@[simp] theorem dual_indep_iff_exists (hI : I ⊆ M.E := by aesop_mat) :
    M✶.Indep I ↔ (∃ B, M.Base B ∧ Disjoint I B)

{α : Type u_1}
{M : Matroid α}
{I : Set α}
(hI : I ⊆ M.E := by aesop_mat)

M✶.Indep I ↔ ∃ B, M.Base B ∧ Disjoint I B


lemma mem_factoredNumbers {s : Finset ℕ} {m : ℕ} :
    m ∈ factoredNumbers s ↔ m ≠ 0 ∧ ∀ p ∈ primeFactorsList m, p ∈ s

m ∈ Nat.factoredNumbers s ↔ m ≠ 0 ∧ ∀ p ∈ m.primeFactorsList, p ∈ s


theorem directedOn_pair (h : Reflexive r) {a b : α} (hab : a ≼ b) : DirectedOn r ({a, b} : Set α)

{α : Type u}
{r : α → α → Prop}
(h : Reflexive r)
{a b : α}
(hab : r a b)


@[simp]
theorem ofFinsupp_sub {R : Type u} [Ring R] {a b} : (⟨a - b⟩ : R[X]) = ⟨a⟩ - ⟨b⟩

{ toFinsupp := a - b } = { toFinsupp := a } - { toFinsupp := b }


theorem Submartingale.sum_sub_upcrossingStrat_mul [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ)
    (a b : ℝ) (N : ℕ) : Submartingale (fun n : ℕ =>
      ∑ k ∈ Finset.range n, (1 - upcrossingStrat a b f N k) * (f (k + 1) - f k)) ℱ μ

{f : ℕ → Ω → ℝ}

(hf : MeasureTheory.Submartingale f ℱ μ)

MeasureTheory.Submartingale
  (fun n => ∑ k ∈ Finset.range n, (1 - MeasureTheory.upcrossingStrat a b f N k) * (f (k + 1) - f k)) ℱ μ


/-- **Hermite Theorem**. Let `N` be an integer. There are only finitely many number fields
(in some fixed extension of `ℚ`) of discriminant bounded by `N`. -/
theorem _root_.NumberField.finite_of_discr_bdd :
    {K : { F : IntermediateField ℚ A // FiniteDimensional ℚ F} |
      haveI :  NumberField K := @NumberField.mk _ _ inferInstance K.prop
      |discr K| ≤ N }.Finite

(A : Type u_2)
[Field A]
[CharZero A]
(N : ℕ)

{K | |NumberField.discr ↥↑K| ≤ ↑N}.Finite


/-- The geometric sequence `fun n ↦ φ^n` is a solution of `fibRec`. -/
theorem geom_gold_isSol_fibRec : fibRec.IsSolution (φ ^ ·)


theorem eventually_cocardinal_nmem_of_card_lt  {s : Set α} (hs : #s < c) :
    ∀ᶠ x in cocardinal α hreg, x ∉ s

{α : Type u}
{c : Cardinal.{u}}
{hreg : c.IsRegular}
{s : Set α}
(hs : #↑s < c)

∀ᶠ (x : α) in Filter.cocardinal α hreg, x ∉ s


theorem isSt_sSup {x : ℝ*} (hni : ¬Infinite x) : IsSt x (sSup { y : ℝ | (y : ℝ*) < x })


@[simp]
theorem measureUnivNNReal_zero : measureUnivNNReal (0 : Measure α) = 0


theorem coe_inv (A : symplecticGroup l R) : (↑A⁻¹ : Matrix _ _ _) = (-J l R) * (↑A)ᵀ * J l R

{l : Type u_1}
{R : Type u_2}
[DecidableEq l]
[Fintype l]
[CommRing R]
(A : ↥(Matrix.symplecticGroup l R))

↑A⁻¹ = -Matrix.J l R * (↑A)ᵀ * Matrix.J l R


/-- The assignment `x ↦ dirac x` is injective, assuming the measurable space separates points. -/
lemma injective_dirac [SeparatesPoints α] :
    Function.Injective (fun (x : α) ↦ dirac x)

{α : Type u_1}
[MeasurableSpace α]
[MeasurableSpace.SeparatesPoints α]

Function.Injective fun x => MeasureTheory.Measure.dirac x


theorem ord_le {c o} : ord c ≤ o ↔ c ≤ o.card

{c : Cardinal.{u_3}}
{o : Ordinal.{u_3}}


lemma map_injective {φ : R →+* A} (hφ : Function.Injective φ) :
    Function.Injective <| map (φ := φ)

{R : Type u}
[CommRing R]
{A : Type v}
[CommRing A]
{φ : R →+* A}
(hφ : Function.Injective ⇑φ)


@[simp]
theorem mk_zpow (f : α → γ) (hf) (n : ℤ) :
    (mk f hf : α →ₘ[μ] γ) ^ n = mk (f ^ n) ((continuous_zpow n).comp_aestronglyMeasurable hf)

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEEqFun.mk f hf ^ n = MeasureTheory.AEEqFun.mk (f ^ n) ⋯


theorem HasBasis.limsup_eq_sInf_iUnion_iInter {ι ι' : Type*} {f : ι → α} {v : Filter ι}
    {p : ι' → Prop} {s : ι' → Set ι} (hv : v.HasBasis p s) :
    limsup f v = sInf (⋃ (j : Subtype p), ⋂ (i : s j), Ici (f i))

{α : Type u_1}
[ConditionallyCompleteLattice α]
{ι : Type u_6}
{ι' : Type u_7}
{f : ι → α}
{v : Filter ι}
{p : ι' → Prop}
{s : ι' → Set ι}
(hv : v.HasBasis p s)

Filter.limsup f v = sInf (⋃ j, ⋂ i, Set.Ici (f ↑i))


theorem IsBounded.prod (hs : IsBounded s) (ht : IsBounded t) : IsBounded (s ×ˢ t)

{α : Type u_1}
{β : Type u_2}
[Bornology α]
[Bornology β]
{s : Set α}
{t : Set β}
(hs : Bornology.IsBounded s)
(ht : Bornology.IsBounded t)


@[simp] theorem decide_eq_false {b : Bool} [Decidable (b = false)] : decide (b = false) = !b


theorem iSup_mem_measurableLE' (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
    (⨆ (k) (_ : k ≤ n), f k) ∈ measurableLE μ ν

(f : ℕ → α → ℝ≥0∞)

(hf : ∀ (n : ℕ), f n ∈ MeasureTheory.Measure.LebesgueDecomposition.measurableLE μ ν)

⨆ k, ⨆ (_ : k ≤ n), f k ∈ MeasureTheory.Measure.LebesgueDecomposition.measurableLE μ ν


theorem continuousWithinAt_union {f : α → β} {s t : Set α} {x : α} :
    ContinuousWithinAt f (s ∪ t) x ↔ ContinuousWithinAt f s x ∧ ContinuousWithinAt f t x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{s t : Set α}
{x : α}


@[reassoc (attr := simp 1100)]
lemma shiftIso_hom_naturality {X Y : C} (n a a' : M) (ha' : n + a = a') (f : X ⟶ Y) :
    (shift F a).map (f⟦n⟧') ≫ (shiftIso F n a a' ha').hom.app Y =
      (shiftIso F n a a' ha').hom.app X ≫ (shift F a').map f

{C : Type u_1}
{A : Type u_2}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Category.{u_6, u_2} A]
(F : C ⥤ A)
{M : Type u_3}
[AddMonoid M]
[CategoryTheory.HasShift C M]
[F.ShiftSequence M]
{X Y : C}
(n a a' : M)
(ha' : n + a = a')
(f : X ⟶ Y)

(F.shift a).map ((CategoryTheory.shiftFunctor C n).map f) ≫ (F.shiftIso n a a' ha').hom.app Y =
  (F.shiftIso n a a' ha').hom.app X ≫ (F.shift a').map f


@[simp, fun_prop]
theorem DifferentiableAt.prod (hf₁ : DifferentiableAt 𝕜 f₁ x) (hf₂ : DifferentiableAt 𝕜 f₂ x) :
    DifferentiableAt 𝕜 (fun x : E => (f₁ x, f₂ x)) x

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

DifferentiableAt 𝕜 (fun x => (f₁ x, f₂ x)) x


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

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


@[simp]
theorem sigma_nil : ∀ l : List α, (l.sigma fun a => @nil (σ a)) = []

{α : Type u_1}
{σ : α → Type u_3}
(l : List α)


theorem not_mem_of_not_mem_sUnion {x : α} {t : Set α} {S : Set (Set α)} (hx : x ∉ ⋃₀S)
    (ht : t ∈ S) : x ∉ t

{α : Type u_1}
{x : α}
{t : Set α}
{S : Set (Set α)}
(hx : x ∉ ⋃₀ S)
(ht : t ∈ S)


/-- If `t n` is a monotone sequence of sets in `𝔖`
such that each `s ∈ 𝔖` is included in some `t n`
and `V n` is an antitone basis of entourages of `β`,
then `UniformOnFun.gen 𝔖 (t n) (V n)` is an antitone basis of entourages of `α →ᵤ[𝔖] β`. -/
protected theorem hasAntitoneBasis_uniformity {ι : Type*} [Preorder ι] [IsDirected ι (· ≤ ·)]
    {t : ι → Set α} {V : ι → Set (β × β)}
    (ht : ∀ n, t n ∈ 𝔖) (hmono : Monotone t) (hex : ∀ s ∈ 𝔖, ∃ n, s ⊆ t n)
    (hb : HasAntitoneBasis (𝓤 β) V) :
    (𝓤 (α →ᵤ[𝔖] β)).HasAntitoneBasis fun n ↦ UniformOnFun.gen 𝔖 (t n) (V n)

{α : Type u_1}
{β : Type u_2}
[UniformSpace β]
(𝔖 : Set (Set α))
{ι : Type u_5}
[Preorder ι]
[IsDirected ι fun x x_1 => x ≤ x_1]
{t : ι → Set α}
{V : ι → Set (β × β)}
(ht : ∀ (n : ι), t n ∈ 𝔖)
(hmono : Monotone t)
(hex : ∀ s ∈ 𝔖, ∃ n, s ⊆ t n)
(hb : (𝓤 β).HasAntitoneBasis V)

(𝓤 (α →ᵤ[𝔖] β)).HasAntitoneBasis fun n => UniformOnFun.gen 𝔖 (t n) (V n)


/-- Whisker a cone by precomposition of a functor. -/
@[simps]
def whisker (E : K ⥤ J) (c : Cone F) : Cone (E ⋙ F)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(E : K ⥤ J)
(c : CategoryTheory.Limits.Cone F)

(CategoryTheory.Limits.Cone.whisker E c).π = CategoryTheory.whiskerLeft E c.π


theorem inter_add_distrib (s t u : Multiset α) : s ∩ t + u = (s + u) ∩ (t + u)

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


theorem of_int_sub (m : ℤ) (h : Irrational (m - x)) : Irrational x

{x : ℝ}
(m : ℤ)
(h : Irrational (↑m - x))


theorem LinearMap.toMatrix_transpose_apply' (f : M₁ →ₗ[R] M₂) (j : n) :
    (LinearMap.toMatrix v₁ v₂ f)ᵀ j = v₂.repr (f (v₁ j))

{R : Type u_1}
[CommSemiring R]
{m : Type u_3}
{n : Type u_4}
[Fintype n]
[Finite m]
[DecidableEq n]
{M₁ : Type u_5}
{M₂ : Type u_6}
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[Module R M₁]
[Module R M₂]
(v₁ : Basis n R M₁)
(v₂ : Basis m R M₂)
(f : M₁ →ₗ[R] M₂)
(j : n)

((LinearMap.toMatrix v₁ v₂) f)ᵀ j = ⇑(v₂.repr (f (v₁ j)))


@[simp, norm_cast]
theorem ofReal_sum (f : α → ℝ) : ((∑ i ∈ s, f i : ℝ) : ℂ) = ∑ i ∈ s, (f i : ℂ)

{α : Type u_1}
(s : Finset α)
(f : α → ℝ)


theorem inner_zero_right (x : F) : ⟪x, 0⟫ = 0

{𝕜 : Type u_1}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup F]
[Module 𝕜 F]
[c : InnerProductSpace.Core 𝕜 F]
(x : F)


theorem proj_eq_self {x : I → Bool} (h : ∀ i, x i ≠ false → J i) : Proj J x = x

{I : Type u}
(J : I → Prop)
[(i : I) → Decidable (J i)]
{x : I → Bool}
(h : ∀ (i : I), x i ≠ false → J i)


lemma inv_rnDeriv' [SigmaFinite μ] [SigmaFinite ν] (hμν : μ ≪ ν) :
    (ν.rnDeriv μ)⁻¹ =ᵐ[μ] μ.rnDeriv ν

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


protected theorem add {β} [AddMonoid β] {f g : α →ₛ β} (hf : f.FinMeasSupp μ)
    (hg : g.FinMeasSupp μ) : (f + g).FinMeasSupp μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{β : Type u_5}
[AddMonoid β]
{f g : MeasureTheory.SimpleFunc α β}
(hf : f.FinMeasSupp μ)
(hg : g.FinMeasSupp μ)


/-- A subtype of a subtype is equivalent to the subtype of elements satisfying both predicates. This
version allows the “inner” predicate to depend on `h : p a`. -/
@[simps]
def subtypeSubtypeEquivSubtypeExists (p : α → Prop) (q : Subtype p → Prop) :
    Subtype q ≃ { a : α // ∃ h : p a, q ⟨a, h⟩ }

{α : Sort u_1}
(p : α → Prop)
(q : Subtype p → Prop)
(a : Subtype q)

↑((Equiv.subtypeSubtypeEquivSubtypeExists p q) a) = ↑↑a


@[simp] lemma ceilRoot_eq_zero : ceilRoot n a = 0 ↔ n = 0 ∨ a = 0


theorem preimage_univ : r.preimage Set.univ = r.dom

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


theorem le_dedup_self {s : Multiset α} : s ≤ dedup s ↔ Nodup s

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


theorem FinitaryExtensive.vanKampen [FinitaryExtensive C] {F : Discrete WalkingPair ⥤ C}
    (c : Cocone F) (hc : IsColimit c) : IsVanKampenColimit c

{F : CategoryTheory.Functor (CategoryTheory.Discrete CategoryTheory.Limits.WalkingPair) C}

(hc : CategoryTheory.Limits.IsColimit c)


theorem bliminf_congr' {f : Filter β} {p q : β → Prop} {u : β → α}
    (h : ∀ᶠ x in f, u x ≠ ⊤ → (p x ↔ q x)) : bliminf u f p = bliminf u f q

(h : ∀ᶠ (x : β) in f, u x ≠ ⊤ → (p x ↔ q x))

Filter.bliminf u f p = Filter.bliminf u f q


/-- The angle between a vector and the negation of another vector. -/
theorem angle_neg_right (x y : V) : angle x (-y) = π - angle x y

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

InnerProductGeometry.angle x (-y) = π - InnerProductGeometry.angle x y


theorem enum_cons : (a::as).enum = (0, a) :: as.enumFrom 1

∀ {α : Type u_1} {a : α} {as : List α}, (a :: as).enum = (0, a) :: List.enumFrom 1 as


theorem ContDiffOn.sum {ι : Type*} {f : ι → E → F} {s : Finset ι} {t : Set E}
    (h : ∀ i ∈ s, ContDiffOn 𝕜 n (fun x => f i x) t) :
    ContDiffOn 𝕜 n (fun x => ∑ i ∈ s, f i x) t


theorem _root_.LinearMap.isSemisimpleModule_iff_of_bijective (hl : Function.Bijective l) :
    IsSemisimpleModule R M ↔ IsSemisimpleModule S N

{R : Type u_2}
{S : Type u_3}
[Ring R]
[Ring S]
{M : Type u_4}
[AddCommGroup M]
[Module R M]
{N : Type u_5}
[AddCommGroup N]
[Module S N]
{σ : R →+* S}
[RingHomSurjective σ]
(l : M →ₛₗ[σ] N)
(hl : Function.Bijective ⇑l)


@[simp, norm_cast]
theorem coe_finset_inf (f : ι → Opens α) (s : Finset ι) : (↑(s.inf f) : Set α) = s.inf ((↑) ∘ f)

{ι : Type u_1}
{α : Type u_2}
[TopologicalSpace α]
(f : ι → TopologicalSpace.Opens α)
(s : Finset ι)


theorem subset_sups {s t : Set α} :
    ↑u ⊆ s ⊻ t → ∃ s' t' : Finset α, ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ s' ⊻ t'

{α : Type u_2}
[DecidableEq α]
[SemilatticeSup α]
{u : Finset α}
{s t : Set α}

↑u ⊆ s ⊻ t → ∃ s' t', ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ s' ⊻ t'


theorem eLpNorm'_le_eLpNorm'_mul_rpow_measure_univ {p q : ℝ} (hp0_lt : 0 < p) (hpq : p ≤ q)
    (hf : AEStronglyMeasurable f μ) :
    eLpNorm' f p μ ≤ eLpNorm' f q μ * μ Set.univ ^ (1 / p - 1 / q)

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.eLpNorm' f p μ ≤ MeasureTheory.eLpNorm' f q μ * μ Set.univ ^ (1 / p - 1 / q)


/-- The (open) thickening of the empty set is empty. -/
@[simp]
theorem thickening_empty (δ : ℝ) : thickening δ (∅ : Set α) = ∅

{α : Type u}
[PseudoEMetricSpace α]
(δ : ℝ)


theorem Ioc_eq_finset_map :
    Ioc a b =
      (Finset.range (b - a).toNat).map (Nat.castEmbedding.trans <| addLeftEmbedding (a + 1))

Finset.Ioc a b = Finset.map (Nat.castEmbedding.trans (addLeftEmbedding (a + 1))) (Finset.range (b - a).toNat)


@[simp] -- Should be replaced with `SemilinearIsometryClass.nnorm_map` when `lean4#3107` is fixed.
theorem nnnorm_map (x : E) : ‖e x‖₊ = ‖x‖₊

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(e : E ≃ₛₗᵢ[σ₁₂] E₂)
(x : E)

‖e x‖₊ = ‖x‖₊


@[to_additive]
protected theorem mul_assoc (x y z : R[S⁻¹]) : x * y * z = x * (y * z)

{R : Type u_1}
[AddMonoid R]
{S : AddSubmonoid R}
[AddOreLocalization.AddOreSet S]
(x y z : AddOreLocalization S R)


lemma limsup_le_iff {b : EReal} : limsup u f ≤ b ↔ ∀ c : ℝ, b < c → ∀ᶠ a : α in f, u a ≤ c

{α : Type u_2}
{f : Filter α}
{u : α → EReal}
{b : EReal}

Filter.limsup u f ≤ b ↔ ∀ (c : ℝ), b < ↑c → ∀ᶠ (a : α) in f, u a ≤ ↑c


/-- A transitive permutation group generated by transpositions must be the whole symmetric group -/
theorem surjective_of_isSwap_of_isPretransitive [Finite α] (S : Set G)
    (hS1 : ∀ σ ∈ S, Perm.IsSwap (MulAction.toPermHom G α σ)) (hS2 : Subgroup.closure S = ⊤)
    [h : MulAction.IsPretransitive G α] : Function.Surjective (MulAction.toPermHom G α)

(hS1 : ∀ σ ∈ S, ((MulAction.toPermHom G α) σ).IsSwap)

Function.Surjective ⇑(MulAction.toPermHom G α)


@[simp] theorem strictAntiOn_univ : StrictAntiOn f Set.univ ↔ StrictAnti f

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}


theorem add_mul_limit {a b c : Ordinal} (ba : b + a = a) (l : IsLimit c) : (a + b) * c = a * c

{a b c : Ordinal.{u_1}}
(ba : b + a = a)
(l : c.IsLimit)


theorem ContMDiff.snd {f : N → M × M'} (hf : ContMDiff J (I.prod I') n f) :
    ContMDiff J I' n fun x => (f x).2

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{F : Type u_11}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_12}
[TopologicalSpace G]
{J : ModelWithCorners 𝕜 F G}
{N : Type u_13}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}
{f : N → M × M'}
(hf : ContMDiff J (I.prod I') n f)


lemma restrictionApp_comp (M : PresheafOfModules R) {X Y Z : Cᵒᵖ} (f : X ⟶ Y) (g : Y ⟶ Z) :
    restrictionApp (f ≫ g) M =
      restrictionApp f M ≫
        (ModuleCat.restrictScalars (R.map f)).map (restrictionApp g M) ≫
        (ModuleCat.restrictScalarsComp' _ _ _ (R.map_comp f g)).inv.app (M.obj Z)

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

PresheafOfModules.restrictionApp (f ≫ g) M =
  PresheafOfModules.restrictionApp f M ≫
    (ModuleCat.restrictScalars (R.map f)).map (PresheafOfModules.restrictionApp g M) ≫
      (ModuleCat.restrictScalarsComp' (R.map f) (R.map g) (R.map (f ≫ g)) ⋯).inv.app (M.obj Z)


@[simp]
theorem toNat_ofNat (n : ℕ) [n.AtLeastTwo] : toNat (no_index (OfNat.ofNat n)) = n


protected theorem mul_left_cancel_iff' {a b c m : ℕ} (hc : c ≠ 0) :
    c * a ≡ c * b [MOD c * m] ↔ a ≡ b [MOD m]


lemma eq_nil_of_isRegular_on_artinian [IsArtinian R M] :
    {rs : List R} → IsRegular M rs → rs = []

{R : Type u_1}
{M : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
[IsArtinian R M]
{rs : List R}

RingTheory.Sequence.IsRegular M rs → rs = []


theorem disjoint_compl_left : Disjoint aᶜ a

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


lemma mem_primesBelow {k n : ℕ} :
    n ∈ primesBelow k ↔ n < k ∧ n.Prime


nonrec theorem IsLocalMaxOn.sub (hf : IsLocalMaxOn f s a) (hg : IsLocalMinOn g s a) :
    IsLocalMaxOn (fun x => f x - g x) s a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[OrderedAddCommGroup β]
{f g : α → β}
{a : α}
{s : Set α}
(hf : IsLocalMaxOn f s a)
(hg : IsLocalMinOn g s a)


theorem inf_sup {κ : ι → Type*} (s : Finset ι) (t : ∀ i, Finset (κ i)) (f : ∀ i, κ i → α) :
    (s.inf fun i => (t i).sup (f i)) =
      (s.pi t).sup fun g => s.attach.inf fun i => f _ <| g _ i.2

{α : Type u_2}
{ι : Type u_5}
[DistribLattice α]
[BoundedOrder α]
[DecidableEq ι]
{κ : ι → Type u_7}
(s : Finset ι)
(t : (i : ι) → Finset (κ i))
(f : (i : ι) → κ i → α)

(s.inf fun i => (t i).sup (f i)) = (s.pi t).sup fun g => s.attach.inf fun i => f (↑i) (g ↑i ⋯)


theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s')

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

some (a', s') ∈ s.destruct → (a ∈ s ↔ a = a' ∨ a ∈ s')


@[simp]
theorem union_mem_iff : s ∪ t ∈ f ↔ s ∈ f ∨ t ∈ f

{α : Type u}
{f : Ultrafilter α}
{s t : Set α}


theorem ceil_lt_mul {x : ℝ} (hx : 50 / 19 ≤ x) : (⌈x⌉₊ : ℝ) < 1.38 * x


/-- Being differentiable in the model space is a local property, invariant under smooth maps.
Therefore, it will lift nicely to manifolds. -/
theorem differentiable_within_at_localInvariantProp :
    (contDiffGroupoid ⊤ I).LocalInvariantProp (contDiffGroupoid ⊤ I')
      (DifferentiableWithinAtProp I I')

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


@[simp]
theorem invOf_two_add_invOf_two [NonAssocSemiring α] [Invertible (2 : α)] :
    (⅟ 2 : α) + (⅟ 2 : α) = 1

{α : Type u}
[NonAssocSemiring α]
[Invertible 2]


theorem opLinearEquiv_symm_toAddEquiv :
    (opLinearEquiv R : M ≃ₗ[R] Mᵐᵒᵖ).symm.toAddEquiv = opAddEquiv.symm

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

(MulOpposite.opLinearEquiv R).symm.toAddEquiv = MulOpposite.opAddEquiv.symm


@[simp]
theorem comp_id (f : C(α, β)) : f.comp (ContinuousMap.id _) = f

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


@[norm_cast] lemma coe_div (a b : α) : ↑(a / b : α) = (a / b : WithZero α)


/-- A common special case of `image_congr` -/
theorem image_congr' {f g : α → β} {s : Set α} (h : ∀ x : α, f x = g x) : f '' s = g '' s

{α : Type u_1}
{β : Type u_2}
{f g : α → β}
{s : Set α}
(h : ∀ (x : α), f x = g x)


@[to_additive apply_single₂]
theorem apply_mulSingle₂ (f' : ∀ i, f i → g i → h i) (hf' : ∀ i, f' i 1 1 = 1) (i : I)
    (x : f i) (y : g i) (j : I) :
    f' j (mulSingle i x j) (mulSingle i y j) = mulSingle i (f' i x y) j

{I : Type u}
{f : I → Type v₁}
{g : I → Type v₂}
{h : I → Type v₃}
[DecidableEq I]
[(i : I) → One (f i)]
[(i : I) → One (g i)]
[(i : I) → One (h i)]
(f' : (i : I) → f i → g i → h i)
(hf' : ∀ (i : I), f' i 1 1 = 1)
(i : I)
(x : f i)
(y : g i)
(j : I)

f' j (Pi.mulSingle i x j) (Pi.mulSingle i y j) = Pi.mulSingle i (f' i x y) j


theorem finite_of_ncard_ne_zero (hs : s.ncard ≠ 0) : s.Finite

{α : Type u_1}
{s : Set α}
(hs : s.ncard ≠ 0)


theorem maximals_union : maximals r (s ∪ t) ⊆ maximals r s ∪ maximals r t

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


theorem subtypeEquivCodomain_symm_apply_eq (f : { x' // x' ≠ x } → Y) (y : Y) :
    ((subtypeEquivCodomain f).symm y : X → Y) x = y

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

↑((Equiv.subtypeEquivCodomain f).symm y) x = y


@[simp]
theorem degree_cubic (ha : a ≠ 0) : degree (C a * X ^ 3 + C b * X ^ 2 + C c * X + C d) = 3

{R : Type u}
{a b c d : R}
[Semiring R]
(ha : a ≠ 0)

(Polynomial.C a * Polynomial.X ^ 3 + Polynomial.C b * Polynomial.X ^ 2 + Polynomial.C c * Polynomial.X +
      Polynomial.C d).degree =
  3


theorem tails_cons (a : α) (l : List α) : tails (a :: l) = (a :: l) :: l.tails


lemma sInf_iUnion_Ici (f : ι → α) : sInf (⋃ (i : ι), Ici (f i)) = ⨅ i, f i

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


@[simp]
theorem card_eq_one {o} : card o = 1 ↔ o = 1


theorem nhds_inr (y : Y) : 𝓝 (inr y : X ⊕ Y) = map inr (𝓝 y)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
(y : Y)

𝓝 (Sum.inr y) = Filter.map Sum.inr (𝓝 y)


theorem conductor_subset_adjoin : (conductor R x : Set S) ⊆ R<x>

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[CommRing S]
[Algebra R S]
{x : S}

↑(conductor R x) ⊆ ↑(Algebra.adjoin R {x})


theorem Monic.coeff_natDegree {p : R[X]} (hp : p.Monic) : p.coeff p.natDegree = 1

{R : Type u}
[Semiring R]
{p : R[X]}
(hp : p.Monic)


/-- Constructor for isomorphisms in `ComposableArrows C 4`. -/
@[simps]
def isoMk₄ {f g : ComposableArrows C 4}
    (app₀ : f.obj' 0 ≅ g.obj' 0) (app₁ : f.obj' 1 ≅ g.obj' 1) (app₂ : f.obj' 2 ≅ g.obj' 2)
    (app₃ : f.obj' 3 ≅ g.obj' 3) (app₄ : f.obj' 4 ≅ g.obj' 4)
    (w₀ : f.map' 0 1 ≫ app₁.hom = app₀.hom ≫ g.map' 0 1)
    (w₁ : f.map' 1 2 ≫ app₂.hom = app₁.hom ≫ g.map' 1 2)
    (w₂ : f.map' 2 3 ≫ app₃.hom = app₂.hom ≫ g.map' 2 3)
    (w₃ : f.map' 3 4 ≫ app₄.hom = app₃.hom ≫ g.map' 3 4) :
    f ≅ g

{f g : CategoryTheory.ComposableArrows C 4}

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

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

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

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

(CategoryTheory.ComposableArrows.isoMk₄ app₀ app₁ app₂ app₃ app₄ w₀ w₁ w₂ w₃).hom =
  CategoryTheory.ComposableArrows.homMk₄ app₀.hom app₁.hom app₂.hom app₃.hom app₄.hom w₀ w₁ w₂ w₃


/-- An equivalence of algebras is an equivalence of rings commuting with the actions of scalars. -/
structure AlgEquiv (R : Type u) (A : Type v) (B : Type w) [CommSemiring R] [Semiring A] [Semiring B]
  [Algebra R A] [Algebra R B] extends A ≃ B, A ≃* B, A ≃+ B, A ≃+* B where
  /-- An equivalence of algebras commutes with the action of scalars. -/
  protected commutes' : ∀ r : R, toFun (algebraMap R A r) = algebraMap R B r

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(self : A ≃ₐ[R] B)
(r : R)

self.toFun ((algebraMap R A) r) = (algebraMap R B) r


protected theorem injective [Nontrivial R] : Injective b

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


protected theorem Nodup.sublist : l₁ <+ l₂ → Nodup l₂ → Nodup l₁


theorem image_preimage [DecidableEq β] (f : α → β) (s : Finset β) [∀ x, Decidable (x ∈ Set.range f)]
    (hf : Set.InjOn f (f ⁻¹' ↑s)) : image f (preimage s f hf) = s.filter fun x => x ∈ Set.range f

{α : Type u}
{β : Type v}
[DecidableEq β]
(f : α → β)
(s : Finset β)
[(x : β) → Decidable (x ∈ Set.range f)]
(hf : Set.InjOn f (f ⁻¹' ↑s))

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


theorem nth_strictMono (hf : (setOf p).Infinite) : StrictMono (nth p)

{p : ℕ → Prop}
(hf : (setOf p).Infinite)


@[to_additive le_prod_iff]
theorem le_prod_iff {s : Subsemigroup M} {t : Subsemigroup N} {u : Subsemigroup (M × N)} :
    u ≤ s.prod t ↔ u.map (fst M N) ≤ s ∧ u.map (snd M N) ≤ t

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
{s : AddSubsemigroup M}
{t : AddSubsemigroup N}
{u : AddSubsemigroup (M × N)}

u ≤ s.prod t ↔ AddSubsemigroup.map (AddHom.fst M N) u ≤ s ∧ AddSubsemigroup.map (AddHom.snd M N) u ≤ t


theorem algebraMap₀_mul {n} (r : R) (a : ⨂[R]^n M) :
    cast R M (zero_add _) (algebraMap₀ r ₜ* a) = r • a

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{n : ℕ}
(r : R)
(a : ⨂[R]^n M)

(TensorPower.cast R M ⋯) (GradedMonoid.GMul.mul (TensorPower.algebraMap₀ r) a) = r • a


@[simp] theorem toCoalgEquiv_refl : toCoalgEquiv (.refl X) = .refl _ _

{R : Type u}
[CommRing R]
{X : CoalgebraCat R}

(CategoryTheory.Iso.refl X).toCoalgEquiv = CoalgEquiv.refl R ↑X.toModuleCat


@[simp]
theorem coprime_add_mul_right_left (m n k : ℕ) : Coprime (m + k * n) n ↔ Coprime m n


theorem outOfBounds_eq_default [Inhabited α] : (outOfBounds : α) = default


theorem subtype_mk (hf : LipschitzWith K f) {p : β → Prop} (hp : ∀ x, p (f x)) :
    LipschitzWith K (fun x => ⟨f x, hp x⟩ : α → { y // p y })

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : LipschitzWith K f)
{p : β → Prop}
(hp : ∀ (x : α), p (f x))


theorem cauchy_nhds {a : α} : Cauchy (𝓝 a)

{α : Type u}
[uniformSpace : UniformSpace α]
{a : α}


/-- If `oscillationWithin f D x < ε` at every `x` in a compact set `K`, then there exists `δ > 0`
such that the oscillation of `f` on `ball x δ ∩ D` is less than `ε` for every `x` in `K`. -/
theorem uniform_oscillationWithin (hK : ∀ x ∈ K, oscillationWithin f D x < ε) :
    ∃ δ > 0, ∀ x ∈ K, diam (f '' (ball x (ENNReal.ofReal δ) ∩ D)) ≤ ε

∃ δ > 0, ∀ x ∈ K, EMetric.diam (f '' (EMetric.ball x (ENNReal.ofReal δ) ∩ D)) ≤ ε


lemma closed_range_of_antilipschitz {f : E →SL[σ] F} {c : ℝ≥0} (hf : AntilipschitzWith c f) :
    (LinearMap.range f).topologicalClosure = LinearMap.range f

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
{σ : 𝕜 →+* 𝕜'}
{σ' : 𝕜' →+* 𝕜}
[RingHomInvPair σ σ']
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜' F]
[CompleteSpace E]
{f : E →SL[σ] F}
{c : ℝ≥0}
(hf : AntilipschitzWith c ⇑f)


/-- If a vector space (or module) has a finite basis, then its dimension (or rank) is equal to the
cardinality of the basis. -/
theorem finrank_eq_card_basis {ι : Type w} [Fintype ι] (h : Basis ι R M) :
    finrank R M = Fintype.card ι

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[StrongRankCondition R]
{ι : Type w}
[Fintype ι]
(h : Basis ι R M)

FiniteDimensional.finrank R M = Fintype.card ι


/--
An object `J` is injective iff every morphism into `J` can be obtained by extending a monomorphism.
-/
class Injective (J : C) : Prop where
  factors : ∀ {X Y : C} (g : X ⟶ J) (f : X ⟶ Y) [Mono f], ∃ h : Y ⟶ J, f ≫ h = g

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{J : C}
[self : CategoryTheory.Injective J]
{X Y : C}
(g : X ⟶ J)
(f : X ⟶ Y)
[CategoryTheory.Mono f]


theorem degree_le_zero_iff : degree p ≤ 0 ↔ p = C (coeff p 0)

p.degree ≤ 0 ↔ p = Polynomial.C (p.coeff 0)


theorem map_orElse {x y : Option α} : (x <|> y).map f = (x.map f <|> y.map f)

∀ {α_1 : Type u_2} {f : α → α_1} {x y : Option α},
  Option.map f (HOrElse.hOrElse x fun x => y) = HOrElse.hOrElse (Option.map f x) fun x => Option.map f y


theorem Dense.Ioi_eq_biUnion [DenselyOrdered α] {s : Set α} (hs : Dense s) (x : α) :
    Ioi x = ⋃ y ∈ s ∩ Ioi x, Ioi y

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderClosedTopology α]
[DenselyOrdered α]
{s : Set α}
(hs : Dense s)
(x : α)

Set.Ioi x = ⋃ y ∈ s ∩ Set.Ioi x, Set.Ioi y


/-- If a locally integrable function `f` on a finite-dimensional real vector space has zero integral
when multiplied by any smooth compactly supported function, then `f` vanishes almost everywhere. -/
theorem ae_eq_zero_of_integral_contDiff_smul_eq_zero (hf : LocallyIntegrable f μ)
    (h : ∀ (g : E → ℝ), ContDiff ℝ ⊤ g → HasCompactSupport g → ∫ x, g x • f x ∂μ = 0) :
    ∀ᵐ x ∂μ, f x = 0

(hf : MeasureTheory.LocallyIntegrable f μ)

(h : ∀ (g : E → ℝ), ContDiff ℝ ⊤ g → HasCompactSupport g → ∫ (x : E), g x • f x ∂μ = 0)


/-- The natural transformation `K.opcyclesToCycles i j : K.opcycles i ⟶ K.cycles j` for all
`K : HomologicalComplex C c`. -/
@[simps]
noncomputable def natTransOpCyclesToCycles [CategoryWithHomology C] :
    opcyclesFunctor C c i ⟶ cyclesFunctor C c j

(HomologicalComplex.natTransOpCyclesToCycles C c i j).app K = K.opcyclesToCycles i j


private theorem newton_seq_norm_tendsto_zero :
    Tendsto (fun i => ‖F.eval (newton_cau_seq hnorm i)‖) atTop (𝓝 0)

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

Filter.Tendsto (fun i => ‖Polynomial.eval (↑(newton_cau_seq hnorm) i) F‖) Filter.atTop (𝓝 0)


/-- The triangle in `CochainComplex C ℤ` attached to a degreewise split short exact sequence
of cochain complexes. -/
@[simps! obj₁ obj₂ obj₃ mor₁ mor₂ mor₃]
def triangleOfDegreewiseSplit : Triangle (CochainComplex C ℤ)

(S : CategoryTheory.ShortComplex (CochainComplex C ℤ))

(σ : (n : ℤ) → (S.map (HomologicalComplex.eval C (ComplexShape.up ℤ) n)).Splitting)

(CochainComplex.triangleOfDegreewiseSplit S σ).obj₃ = S.X₃


theorem iSup_continuous {ι : Sort*} {f : ι → α →o β} (h : ∀ i, Continuous (f i)) :
    Continuous (⨆ i, f i)

{f : ι → α →o β}

(h : ∀ (i : ι), OmegaCompletePartialOrder.Continuous (f i))

OmegaCompletePartialOrder.Continuous (⨆ i, f i)


theorem rOut_pos {c : E} (f : ContDiffBump c) : 0 < f.rOut

{E : Type u_1}
{c : E}
(f : ContDiffBump c)


theorem self_mem_range_succ (n : Nat) : n ∈ range (n + 1)


theorem reindex_apply (i i' : B') : M.reindex e i i' = M (e.symm i) (e.symm i')

{B : Type u_1}
{B' : Type u_2}
(e : B ≃ B')
(M : CoxeterMatrix B)
(i i' : B')

(CoxeterMatrix.reindex e M).M i i' = M.M (e.symm i) (e.symm i')


theorem add_le_gt (a : Nat) {b c : Nat} (h : b > c) : (a + b ≤ c) = False


theorem map_circulant [Sub n] (v : n → α) (f : α → β) :
    (circulant v).map f = circulant fun i => f (v i)

{α : Type u_1}
{β : Type u_2}
{n : Type u_4}
[Sub n]
(v : n → α)
(f : α → β)

(Matrix.circulant v).map f = Matrix.circulant fun i => f (v i)


@[to_additive (attr := norm_cast)]
theorem pow_apply [Monoid β] [ContinuousMul β] (f : C(α, β)) (n : ℕ) (x : α) :
    (f ^ n) x = f x ^ n

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[Monoid β]
[ContinuousMul β]
(f : C(α, β))
(n : ℕ)
(x : α)


theorem eval_map (S : Type uᵒᵖ ⥤ Type u) (α β) (f : β ⟶ α) (s x) :
    eval S β (S.map f.op s) x = eval S α s (f x)

(S : CategoryTheory.Functor Type uᵒᵖ (Type u))

CategoryTheory.eval S β (S.map f.op s) x = CategoryTheory.eval S α s (f x)


theorem comp_factorThruImage_eq_zero {X Y Z : C} {f : X ⟶ Y} {g : Y ⟶ Z} [HasImage g]
    (h : f ≫ g = 0) : f ≫ factorThruImage g = 0

f ≫ CategoryTheory.Limits.factorThruImage g = 0


theorem exists_gcd_one {m n : ℤ} (H : 0 < gcd m n) :
    ∃ m' n' : ℤ, gcd m' n' = 1 ∧ m = m' * gcd m n ∧ n = n' * gcd m n

∃ m' n', m'.gcd n' = 1 ∧ m = m' * ↑(m.gcd n) ∧ n = n' * ↑(m.gcd n)


/-- Some ordinal approximation of the greatest fixed point is the greatest fixed point. -/
theorem gfp_mem_range_gfpApprox : gfp f ∈ Set.range (gfpApprox f ⊤)

{α : Type u}
[CompleteLattice α]
(f : α →o α)

OrderHom.gfp f ∈ Set.range (OrdinalApprox.gfpApprox f ⊤)


protected theorem Nonempty.inf_eq_bot_iff {α : Type*} [LinearOrder α] [BoundedOrder α]
    {s : Finset ι} {f : ι → α} (h : s.Nonempty) : s.inf f = ⊥ ↔ ∃ b ∈ s, f b = ⊥

{ι : Type u_5}
{α : Type u_7}
[LinearOrder α]
[BoundedOrder α]
{s : Finset ι}
{f : ι → α}
(h : s.Nonempty)