/-- Let `P →ₐ[R] A` be a surjection with kernel `J`, and `P` a formally smooth `R`-algebra,
then `A` is formally smooth over `R` iff the surjection `P ⧸ J ^ 2 →ₐ[R] A` has a section.

Geometric intuition: we require that a first-order thickening of `Spec A` inside `Spec P` admits
a retraction. -/
theorem iff_split_surjection [FormallySmooth R P] :
    FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A

{R : Type u}
[CommRing R]
{P A : Type u}
[CommRing A]
[Algebra R A]
[CommRing P]
[Algebra R P]
(f : P →ₐ[R] A)
(hf : Function.Surjective ⇑f)
[Algebra.FormallySmooth R P]

Algebra.FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A


theorem TendstoLocallyUniformlyOn.unique [p.NeBot] [T2Space β] {g : α → β}
    (hf : TendstoLocallyUniformlyOn F f p s) (hg : TendstoLocallyUniformlyOn F g p s) :
    s.EqOn f g

{F : ι → α → β}


theorem setSeq_mem (n : ℕ) : setSeq hf U_mem n ∈ f

{α : Type u}
[uniformSpace : UniformSpace α]
{f : Filter α}
(hf : Cauchy f)
{U : ℕ → Set (α × α)}
(U_mem : ∀ (n : ℕ), U n ∈ 𝓤 α)
(n : ℕ)

SequentiallyComplete.setSeq hf U_mem n ∈ f


theorem eq_X_sub_C' (a : A) : minpoly A a = X - C a

minpoly A a = Polynomial.X - Polynomial.C a


theorem right_nhdsWithin_Ico_neBot {a b : α} (H : a < b) : NeBot (𝓝[Ico a b] b)

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
{a b : α}
(H : a < b)


@[simp]
theorem sbtw_lineMap_iff [NoZeroSMulDivisors R V] {x y : P} {r : R} :
    Sbtw R x (lineMap x y r) y ↔ x ≠ y ∧ r ∈ Set.Ioo (0 : R) 1

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[OrderedRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
[NoZeroSMulDivisors R V]
{x y : P}
{r : R}

Sbtw R x ((AffineMap.lineMap x y) r) y ↔ x ≠ y ∧ r ∈ Set.Ioo 0 1


theorem dart_snd_mem_support_of_mem_darts {u v : V} (p : G.Walk u v) {d : G.Dart}
    (h : d ∈ p.darts) : d.snd ∈ p.support

{V : Type u}
{G : SimpleGraph V}
{u v : V}
(p : G.Walk u v)
{d : G.Dart}
(h : d ∈ p.darts)


@[simp]
theorem isTheta_norm_left : (fun x ↦ ‖f' x‖) =Θ[l] g ↔ f' =Θ[l] g

{α : Type u_1}
{F : Type u_4}
{E' : Type u_6}
[Norm F]
[SeminormedAddCommGroup E']
{g : α → F}
{f' : α → E'}
{l : Filter α}


theorem shiftLeft_eq (a b : Nat) : a <<< b = a * 2 ^ b


@[simp]
theorem ennrealToMeasure_toENNRealVectorMeasure (μ : Measure α) :
    ennrealToMeasure (toENNRealVectorMeasure μ) = μ

{α : Type u_1}
{m : MeasurableSpace α}
(μ : MeasureTheory.Measure α)


theorem range_comp_subset_range [MeasurableSpace β] (f : β →ₛ γ) {g : α → β} (hgm : Measurable g) :
    (f.comp g hgm).range ⊆ f.range

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
(f : MeasureTheory.SimpleFunc β γ)
{g : α → β}
(hgm : Measurable g)


/-- The second projection within a domain at a point in a product is `C^∞`. -/
theorem contDiffWithinAt_snd {s : Set (E × F)} {p : E × F} :
    ContDiffWithinAt 𝕜 n (Prod.snd : E × F → F) s p

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
{s : Set (E × F)}
{p : E × F}


theorem algebraMap_matrix_apply {r : R} {i j : n} :
    algebraMap R (Matrix n n α) r i j = if i = j then algebraMap R α r else 0

{n : Type u_3}
{R : Type u_7}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommSemiring R]
[Semiring α]
[Algebra R α]
{r : R}
{i j : n}

(algebraMap R (Matrix n n α)) r i j = if i = j then (algebraMap R α) r else 0


protected theorem pow_zero (b : Int) : b^0 = 1


/-- A `SemilatticeSup` is a join-semilattice, that is, a partial order
  with a join (a.k.a. lub / least upper bound, sup / supremum) operation
  `⊔` which is the least element larger than both factors. -/
class SemilatticeSup (α : Type u) extends Sup α, PartialOrder α where
  /-- The supremum is an upper bound on the first argument -/
  protected le_sup_left : ∀ a b : α, a ≤ a ⊔ b
  /-- The supremum is an upper bound on the second argument -/
  protected le_sup_right : ∀ a b : α, b ≤ a ⊔ b
  /-- The supremum is the *least* upper bound -/
  protected sup_le : ∀ a b c : α, a ≤ c → b ≤ c → a ⊔ b ≤ c

{α : Type u}
[self : SemilatticeSup α]
(a b : α)


protected theorem StrictAntiOn.compares (hf : StrictAntiOn f s) {a b : α} (ha : a ∈ s)
    (hb : b ∈ s) {o : Ordering} : o.Compares (f a) (f b) ↔ o.Compares b a

{α : Type u}
{β : Type v}
[LinearOrder α]
[Preorder β]
{f : α → β}
{s : Set α}
(hf : StrictAntiOn f s)
{a b : α}
(ha : a ∈ s)
(hb : b ∈ s)
{o : Ordering}


/-- If `μ i` is a countable family of outer measures, then for every set `s` there exists
a measurable set `t ⊇ s` such that `μ i t = (μ i).trim s` for all `i`. -/
theorem exists_measurable_superset_forall_eq_trim {ι} [Countable ι] (μ : ι → OuterMeasure α)
    (s : Set α) : ∃ t, s ⊆ t ∧ MeasurableSet t ∧ ∀ i, μ i t = (μ i).trim s

{α : Type u_1}
[MeasurableSpace α]
{ι : Sort u_2}
[Countable ι]
(μ : ι → MeasureTheory.OuterMeasure α)
(s : Set α)

∃ t, s ⊆ t ∧ MeasurableSet t ∧ ∀ (i : ι), (μ i) t = (μ i).trim s


@[simp]
theorem stirlingSeq_one : stirlingSeq 1 = exp 1 / √2


theorem not_mem_Icc_of_lt (ha : c < a) : c ∉ Icc a b

{α : Type u_1}
[Preorder α]
{a b c : α}
(ha : c < a)


@[simp]
theorem support_map : (map f p).support = f '' p.support

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


theorem counit_tensorObj_tensorObj_left :
    Coalgebra.counit (R := R)
      (A := ((CoalgebraCat.of R M ⊗ CoalgebraCat.of R N) ⊗ CoalgebraCat.of R P : CoalgebraCat R))
      = Coalgebra.counit (A := (M ⊗[R] N) ⊗[R] P)

{R : Type u}
[CommRing R]
{M N P : Type u}
[AddCommGroup M]
[AddCommGroup N]
[AddCommGroup P]
[Module R M]
[Module R N]
[Module R P]
[Coalgebra R M]
[Coalgebra R N]
[Coalgebra R P]


theorem mem_pointwise_smul_iff_inv_smul_mem {a : α} {S : Submonoid M} {x : M} :
    x ∈ a • S ↔ a⁻¹ • x ∈ S

{α : Type u_1}
{M : Type u_3}
[Monoid M]
[Group α]
[MulDistribMulAction α M]
{a : α}
{S : Submonoid M}
{x : M}

x ∈ a • S ↔ a⁻¹ • x ∈ S


lemma prod_eq_zero_iff : ∏ x ∈ s, f x = 0 ↔ ∃ a ∈ s, f a = 0

{ι : Type u_1}
{M₀ : Type u_4}
[CommMonoidWithZero M₀]
{f : ι → M₀}
{s : Finset ι}
[Nontrivial M₀]
[NoZeroDivisors M₀]


@[simp]
theorem ciInf_const_zero {α : Sort*} : ⨅ _ : α, (0 : ℝ) = 0


@[simp] theorem fst_comp_inr : fst R M M₂ ∘ₗ inr R M M₂ = 0

(R : Type u)
(M : Type v)
(M₂ : Type w)
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]

LinearMap.fst R M M₂ ∘ₗ LinearMap.inr R M M₂ = 0


@[to_additive]
theorem lipschitzOnWith_iff_norm_div_le {f : E → F} {C : ℝ≥0} :
    LipschitzOnWith C f s ↔ ∀ ⦃x⦄, x ∈ s → ∀ ⦃y⦄, y ∈ s → ‖f x / f y‖ ≤ C * ‖x / y‖

{E : Type u_3}
{F : Type u_4}
[SeminormedAddGroup E]
[SeminormedAddGroup F]
{s : Set E}
{f : E → F}
{C : ℝ≥0}

LipschitzOnWith C f s ↔ ∀ ⦃x : E⦄, x ∈ s → ∀ ⦃y : E⦄, y ∈ s → ‖f x - f y‖ ≤ ↑C * ‖x - y‖


/-- An `AddMonoidWithOne` is an `AddMonoid` with a `1`.
It also contains data for the unique homomorphism `ℕ → R`. -/
class AddMonoidWithOne (R : Type*) extends NatCast R, AddMonoid R, One R where
  natCast := Nat.unaryCast
  /-- The canonical map `ℕ → R` sends `0 : ℕ` to `0 : R`. -/
  natCast_zero : natCast 0 = 0 := by intros; rfl
  /-- The canonical map `ℕ → R` is a homomorphism. -/
  natCast_succ : ∀ n, natCast (n + 1) = natCast n + 1 := by intros; rfl

{R : Type u_2}
[self : AddMonoidWithOne R]
(n : ℕ)

NatCast.natCast (n + 1) = NatCast.natCast n + 1


theorem differentiableOn_pi : DifferentiableOn 𝕜 Φ s ↔ ∀ i, DifferentiableOn 𝕜 (fun x => Φ x i) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{s : Set E}
{ι : Type u_6}
[Fintype ι]
{F' : ι → Type u_7}
[(i : ι) → NormedAddCommGroup (F' i)]
[(i : ι) → NormedSpace 𝕜 (F' i)]
{Φ : E → (i : ι) → F' i}

DifferentiableOn 𝕜 Φ s ↔ ∀ (i : ι), DifferentiableOn 𝕜 (fun x => Φ x i) s


theorem decay_smul_aux (k n : ℕ) (f : 𝓢(E, F)) (c : 𝕜) (x : E) :
    ‖x‖ ^ k * ‖iteratedFDeriv ℝ n (c • (f : E → F)) x‖ =
      ‖c‖ * ‖x‖ ^ k * ‖iteratedFDeriv ℝ n f x‖

{𝕜 : Type u_1}
{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[NormedField 𝕜]
[NormedSpace 𝕜 F]
[SMulCommClass ℝ 𝕜 F]
(k n : ℕ)
(f : SchwartzMap E F)
(c : 𝕜)
(x : E)

‖x‖ ^ k * ‖iteratedFDeriv ℝ n (c • ⇑f) x‖ = ‖c‖ * ‖x‖ ^ k * ‖iteratedFDeriv ℝ n (⇑f) x‖


/-- A version of `Matrix.ext` that unfolds the `Matrix.transpose`. -/
-- @[ext] -- Porting note: removed attribute
theorem IsSymm.ext {A : Matrix n n α} : (∀ i j, A j i = A i j) → A.IsSymm

{α : Type u_1}
{n : Type u_3}
{A : Matrix n n α}


theorem rangeRestrict_surjective (f : R →+* S) : Function.Surjective f.rangeRestrict

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
(f : R →+* S)


@[to_additive]
theorem mem_sup : x ∈ s ⊔ t ↔ ∃ y ∈ s, ∃ z ∈ t, y * z = x

{C : Type u_6}
[CommGroup C]
{s t : Subgroup C}
{x : C}


theorem openEmbedding_of_le {U V : Opens α} (i : U ≤ V) :
    OpenEmbedding (Set.inclusion <| SetLike.coe_subset_coe.2 i)

{α : Type u_2}
[TopologicalSpace α]
{U V : TopologicalSpace.Opens α}
(i : U ≤ V)


@[simp]
lemma sqrt_mul_self : hA.sqrt * hA.sqrt = A

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


@[to_additive (attr := simp)]
theorem smul_down [SMul α β] (a : α) (b : ULift.{v} β) : (a • b).down = a • b.down

{α : Type u}
{β : Type u_1}
[VAdd α β]
(a : α)
(b : ULift.{v, u_1} β)


theorem pullback_fst_map_snd_isPullback :
    IsPullback (fst _ _ ≫ i₁ ≫ fst _ _)
      (map i₁ i₂ (i₁ ≫ snd _ _) (i₂ ≫ snd _ _) _ _ _
        (Category.id_comp _).symm (Category.id_comp _).symm)
      (diagonal f)
      (map (i₁ ≫ snd _ _) (i₂ ≫ snd _ _) f f (i₁ ≫ fst _ _) (i₂ ≫ fst _ _) i (by simp [condition])
        (by simp [condition]))

(i₁ : V₁ ⟶ CategoryTheory.Limits.pullback f i)

(i₂ : V₂ ⟶ CategoryTheory.Limits.pullback f i)

CategoryTheory.IsPullback (CategoryTheory.Limits.pullback.fst i₁ i₂ ≫ i₁ ≫ CategoryTheory.Limits.pullback.fst f i)
  (CategoryTheory.Limits.pullback.map i₁ i₂ (i₁ ≫ CategoryTheory.Limits.pullback.snd f i)
    (i₂ ≫ CategoryTheory.Limits.pullback.snd f i) (𝟙 V₁) (𝟙 V₂) (CategoryTheory.Limits.pullback.snd f i) ⋯ ⋯)
  (CategoryTheory.Limits.pullback.diagonal f)
  (CategoryTheory.Limits.pullback.map (i₁ ≫ CategoryTheory.Limits.pullback.snd f i)
    (i₂ ≫ CategoryTheory.Limits.pullback.snd f i) f f (i₁ ≫ CategoryTheory.Limits.pullback.fst f i)
    (i₂ ≫ CategoryTheory.Limits.pullback.fst f i) i ⋯ ⋯)


@[simp]
theorem type_lt_iff {α β} {r : α → α → Prop} {s : β → β → Prop} [IsWellOrder α r]
    [IsWellOrder β s] : type r < type s ↔ Nonempty (r ≺i s)

{α β : Type u_3}
{r : α → α → Prop}
{s : β → β → Prop}
[IsWellOrder α r]
[IsWellOrder β s]

Ordinal.type r < Ordinal.type s ↔ Nonempty (r ≺i s)


theorem hitting_of_le {m : ι} (hmn : m ≤ n) : hitting u s n m ω = m

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
[ConditionallyCompleteLinearOrder ι]
{u : ι → Ω → β}
{s : Set β}
{n : ι}
{ω : Ω}
{m : ι}
(hmn : m ≤ n)


/-- A nonsquare is a natural number that is not equal to the square of an
  integer. This is implemented as a typeclass because it's a necessary condition
  for much of the Pell equation theory. -/
class Nonsquare (x : ℕ) : Prop where
  ns' : ∀ n : ℕ, x ≠ n * n

{x : ℕ}
[self : Zsqrtd.Nonsquare x]
(n : ℕ)


theorem eventually_left_inverse' {x} (hx : x ∈ e.target) :
    ∀ᶠ y in 𝓝 (e.symm x), e.symm (e y) = y

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
{x : Y}
(hx : x ∈ e.target)

∀ᶠ (y : X) in 𝓝 (↑e.symm x), ↑e.symm (↑e y) = y


/-- If `l` lists all the elements of `α` without duplicates, then `List.get` defines
an equivalence between `Fin l.length` and `α`.

See `List.Nodup.getBijectionOfForallMemList` for a version without
decidable equality. -/
@[simps]
def getEquivOfForallMemList (l : List α) (nd : l.Nodup) (h : ∀ x : α, x ∈ l) :
    Fin l.length ≃ α

{α : Type u_1}
[DecidableEq α]
(l : List α)
(nd : l.Nodup)
(h : ∀ (x : α), x ∈ l)
(i : Fin l.length)

(List.Nodup.getEquivOfForallMemList l nd h) i = l.get i


@[to_additive]
theorem ofHom_apply {X Y : Type _} [Group X] [Group Y] (f : X →* Y) (x : X) :
    (ofHom f) x = f x

{X Y : Type u_1}
[Group X]
[Group Y]
(f : X →* Y)
(x : X)


theorem ker_mulVecLin_conjTranspose_mul_self (A : Matrix m n R) :
    LinearMap.ker (Aᴴ * A).mulVecLin = LinearMap.ker (mulVecLin A)

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

LinearMap.ker (Aᴴ * A).mulVecLin = LinearMap.ker A.mulVecLin


protected theorem _root_.StrictAntiOn.strictAnti (h : StrictAntiOn f s) :
    StrictAnti (f ∘ Subtype.val : s → β)

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{f : α → β}
[Preorder α]
[Preorder β]
(h : StrictAntiOn f s)


@[to_additive (attr := simp)]
theorem reduce_toWord : ∀ x : FreeGroup α, reduce (toWord x) = toWord x

{α : Type u}
[DecidableEq α]
(x : FreeGroup α)


theorem toRingHom_injective : Function.Injective (toRingHom : R ≃+* S → R →+* S)

{R : Type u_4}
{S : Type u_5}
[NonAssocSemiring R]
[NonAssocSemiring S]


theorem divInt_sub_divInt (n₁ n₂ : Int) {d₁ d₂} (z₁ : d₁ ≠ 0) (z₂ : d₂ ≠ 0) :
    n₁ /. d₁ - n₂ /. d₂ = (n₁ * d₂ - n₂ * d₁) /. (d₁ * d₂)

(n₁ n₂ : Int)
{d₁ d₂ : Int}
(z₁ : d₁ ≠ 0)
(z₂ : d₂ ≠ 0)


theorem iSup_plift_up (f : PLift ι → α) : ⨆ i, f (PLift.up i) = ⨆ i, f i

{α : Type u_1}
{ι : Sort u_5}
[SupSet α]
(f : PLift ι → α)


@[to_additive]
theorem ofMulEquivOfLocalizations_eq_iff_eq {k : N ≃* P} {x y} :
    (f.ofMulEquivOfLocalizations k).toMap x = y ↔ f.toMap x = k.symm y

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{P : Type u_3}
[AddCommMonoid P]
(f : S.LocalizationMap N)
{k : N ≃+ P}
{x : M}
{y : P}

(f.ofAddEquivOfLocalizations k).toMap x = y ↔ f.toMap x = k.symm y


/-- **Intermediate Value Theorem** for continuous functions on closed intervals, unordered case. -/
theorem intermediate_value_uIcc {a b : α} {f : α → δ} (hf : ContinuousOn f (uIcc a b)) :
    uIcc (f a) (f b) ⊆ f '' uIcc a b

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{δ : Type u_1}
[LinearOrder δ]
[TopologicalSpace δ]
[OrderClosedTopology δ]
{a b : α}
{f : α → δ}
(hf : ContinuousOn f (Set.uIcc a b))

Set.uIcc (f a) (f b) ⊆ f '' Set.uIcc a b


theorem rotate_darts {u v : V} (c : G.Walk v v) (h : u ∈ c.support) :
    (c.rotate h).darts ~r c.darts

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


theorem abs_integral_eq_abs_integral_uIoc (f : ℝ → ℝ) :
    |∫ x in a..b, f x ∂μ| = |∫ x in Ι a b, f x ∂μ|

{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
(f : ℝ → ℝ)

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


@[simp]
theorem map_id : map (LinearMap.id : V →ₗ[K] V) (LinearEquiv.refl K V).injective = id

{K : Type u_1}
{V : Type u_2}
[DivisionRing K]
[AddCommGroup V]
[Module K V]

Projectivization.map LinearMap.id ⋯ = id


@[to_additive (attr := simp) abs_nonneg] lemma one_le_mabs (a : α) : 1 ≤ |a|ₘ

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

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


@[simp]
theorem disjoint_compl_compl_right_iff : Disjoint a bᶜᶜ ↔ Disjoint a b

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


protected theorem add_right_cancel_iff {n : Nat} : m + n = k + n ↔ m = k


nonrec theorem Ultrafilter.le_nhds_lim [CompactSpace X] (F : Ultrafilter X) : ↑F ≤ 𝓝 F.lim

{X : Type u}
[TopologicalSpace X]
[CompactSpace X]
(F : Ultrafilter X)


/-- Given `x` and `y` between `0` and `1`, `x` is between two successive powers of `y`.
This is the same as `exists_nat_pow_near`, but for elements between `0` and `1` -/
theorem exists_nat_pow_near_of_lt_one (xpos : 0 < x) (hx : x ≤ 1) (ypos : 0 < y) (hy : y < 1) :
    ∃ n : ℕ, y ^ (n + 1) < x ∧ x ≤ y ^ n

{α : Type u_1}
[LinearOrderedSemifield α]
[Archimedean α]
[ExistsAddOfLE α]
{x y : α}
(xpos : 0 < x)
(hx : x ≤ 1)
(ypos : 0 < y)
(hy : y < 1)


/-- Division as a monoid homomorphism. -/
@[to_additive (attr := simps) "Subtraction as an additive monoid homomorphism."]
def divMonoidHom [DivisionCommMonoid α] : α × α →* α

{α : Type u_8}
[DivisionCommMonoid α]
(a : α × α)


@[reassoc] theorem associator_inv_snd (X Y Z : C) :
    (α_ X Y Z).inv ≫ prod.snd = prod.snd ≫ prod.snd

CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator X Y Z).inv
    CategoryTheory.Limits.prod.snd =
  CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.snd


@[to_additive (attr := simp)]
theorem lowerClosure_one : lowerClosure (1 : Set α) = 1


@[to_additive]
theorem mk_one_mul_mk_one [Mul M] [Monoid N] (a₁ a₂ : M) :
    (a₁, (1 : N)) * (a₂, 1) = (a₁ * a₂, 1)

{M : Type u_5}
{N : Type u_6}
[Add M]
[AddMonoid N]
(a₁ a₂ : M)


theorem faces_bot : (⊥ : SimplicialComplex 𝕜 E).faces = ∅

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]


lemma map_preΨ (n : ℤ) : (W.map f).preΨ n = (W.preΨ n).map f

{R : Type r}
{S : Type s}
[CommRing R]
[CommRing S]
(W : WeierstrassCurve R)
(f : R →+* S)
(n : ℤ)

(W.map f).preΨ n = Polynomial.map f (W.preΨ n)


theorem rel_bind : (Forall₂ R ⇒ (R ⇒ Forall₂ P) ⇒ Forall₂ P) List.bind List.bind

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{R : α → β → Prop}
{P : γ → δ → Prop}

(List.Forall₂ R ⇒ (R ⇒ List.Forall₂ P) ⇒ List.Forall₂ P) List.bind List.bind


/-- When both `S.f` and `S.g` are zero, the middle object `S.X₂`
gives a right homology data on S -/
@[simps]
def ofZeros (hf : S.f = 0) (hg : S.g = 0) : S.RightHomologyData

(CategoryTheory.ShortComplex.RightHomologyData.ofZeros S hf hg).H = S.X₂


@[simp, norm_cast] lemma filter_coe (l : List α) : filter p l = l.filter p

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]
(l : List α)

Multiset.filter p ↑l = ↑(List.filter (fun b => decide (p b)) l)


@[simp]
theorem neg_comp [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃] [TopologicalAddGroup M₃] (g : M₂ →SL[σ₂₃] M₃)
    (f : M →SL[σ₁₂] M₂) : (-g).comp f = -g.comp f

{R : Type u_1}
[Ring R]
{R₂ : Type u_2}
[Ring R₂]
{R₃ : Type u_3}
[Ring R₃]
{M : Type u_4}
[TopologicalSpace M]
[AddCommGroup M]
{M₂ : Type u_5}
[TopologicalSpace M₂]
[AddCommGroup M₂]
{M₃ : Type u_6}
[TopologicalSpace M₃]
[AddCommGroup M₃]
[Module R M]
[Module R₂ M₂]
[Module R₃ M₃]
{σ₁₂ : R →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R →+* R₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
[TopologicalAddGroup M₃]
(g : M₂ →SL[σ₂₃] M₃)
(f : M →SL[σ₁₂] M₂)


@[simp]
theorem divMonomial_monomial_mul (a : σ →₀ ℕ) (x : MvPolynomial σ R) :
    monomial a 1 * x /ᵐᵒⁿᵒᵐⁱᵃˡ a = x

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
(a : σ →₀ ℕ)
(x : MvPolynomial σ R)

((MvPolynomial.monomial a) 1 * x).divMonomial a = x


/-- A `RingFilterBasis` on a ring is a `FilterBasis` satisfying some additional axioms.
  Example : if `R` is a topological ring then the neighbourhoods of the identity are a
  `RingFilterBasis`. Conversely given a `RingFilterBasis` on a ring `R`, one can define a
  topology on `R` which is compatible with the ring structure. -/
class RingFilterBasis (R : Type u) [Ring R] extends AddGroupFilterBasis R where
  mul' : ∀ {U}, U ∈ sets → ∃ V ∈ sets, V * V ⊆ U
  mul_left' : ∀ (x₀ : R) {U}, U ∈ sets → ∃ V ∈ sets, V ⊆ (fun x ↦ x₀ * x) ⁻¹' U
  mul_right' : ∀ (x₀ : R) {U}, U ∈ sets → ∃ V ∈ sets, V ⊆ (fun x ↦ x * x₀) ⁻¹' U

{R : Type u}
[Ring R]
[self : RingFilterBasis R]
(x₀ : R)
{U : Set R}

U ∈ AddGroupFilterBasis.toFilterBasis.sets → ∃ V ∈ AddGroupFilterBasis.toFilterBasis.sets, V ⊆ (fun x => x * x₀) ⁻¹' U


theorem contDiff_prod' {t : Finset ι} {f : ι → E → 𝔸'} (h : ∀ i ∈ t, ContDiff 𝕜 n (f i)) :
    ContDiff 𝕜 n (∏ i ∈ t, f i)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{n : ℕ∞}
{𝔸' : Type u_4}
{ι : Type u_5}
[NormedCommRing 𝔸']
[NormedAlgebra 𝕜 𝔸']
{t : Finset ι}
{f : ι → E → 𝔸'}
(h : ∀ i ∈ t, ContDiff 𝕜 n (f i))


@[simp]
theorem quotientSpanXSubCAlgEquiv_symm_apply (x : R) (y : R) :
    (quotientSpanXSubCAlgEquiv x).symm y = algebraMap R _ y

(Polynomial.quotientSpanXSubCAlgEquiv x).symm y = (algebraMap R (R[X] ⧸ Ideal.span {Polynomial.X - Polynomial.C x})) y


@[simp, nolint simpNF]
theorem ofElement_apply {α : Type*} (r : α → α → Prop) (a : α) (b) : ofElement r a b = b.1

{α : Type u_4}
(r : α → α → Prop)
(a : α)
(b : ↑{b | r b a})

(PrincipalSeg.ofElement r a).toRelEmbedding b = ↑b


theorem disjoint_assoc : Disjoint (a ⊓ b) c ↔ Disjoint a (b ⊓ c)

{α : Type u_1}
[SemilatticeInf α]
[OrderBot α]
{a b c : α}


theorem u_iSup_of_lu_eq_self [CompleteLattice α] [CompleteLattice β] (gi : GaloisCoinsertion l u)
    {ι : Sort x} (f : ι → β) (hf : ∀ i, l (u (f i)) = f i) : u (⨆ i, f i) = ⨆ i, u (f i)

{α : Type u}
{β : Type v}
{l : α → β}
{u : β → α}
[CompleteLattice α]
[CompleteLattice β]
(gi : GaloisCoinsertion l u)
{ι : Sort x}
(f : ι → β)
(hf : ∀ (i : ι), l (u (f i)) = f i)


/-- If an intermediate field of `E / F` is separable over `F`, and `E` is purely inseparable
over it, then it is equal to the separable closure of `F` in `E`. -/
theorem eq_separableClosure (L : IntermediateField F E)
    [Algebra.IsSeparable F L] [IsPurelyInseparable L E] : L = separableClosure F E

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(L : IntermediateField F E)
[Algebra.IsSeparable F ↥L]
[IsPurelyInseparable (↥L) E]


theorem modPart_nonneg : 0 ≤ modPart p r

{p : ℕ}
[hp_prime : Fact (Nat.Prime p)]
(r : ℚ)


/-- If a direct sum of submodules is internal then the submodules are independent. -/
theorem IsInternal.submodule_independent (h : IsInternal A) : CompleteLattice.Independent A

{R : Type u}
[Semiring R]
{ι : Type v}
[dec_ι : DecidableEq ι]
{M : Type u_1}
[AddCommMonoid M]
[Module R M]
{A : ι → Submodule R M}
(h : DirectSum.IsInternal A)


/-- The trivial `I`-filtration of `N`. -/
@[simps]
def _root_.Ideal.trivialFiltration (I : Ideal R) (N : Submodule R M) : I.Filtration M

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
(I : Ideal R)
(N : Submodule R M)

∀ (x : ℕ), (I.trivialFiltration N).N x = N


theorem antitoneOn_iff_forall_lt :
    AntitoneOn f s ↔ ∀ ⦃a⦄ (_ : a ∈ s) ⦃b⦄ (_ : b ∈ s), a < b → f b ≤ f a

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

AntitoneOn f s ↔ ∀ ⦃a : α⦄, a ∈ s → ∀ ⦃b : α⦄, b ∈ s → a < b → f b ≤ f a


theorem coePNat_nat (v : PrimeMultiset) : ((v : Multiset ℕ+) : Multiset ℕ) = (v : Multiset ℕ)

Multiset.map PNat.val v.toPNatMultiset = v.toNatMultiset


theorem Pullback.continuous_totalSpaceMk [∀ x, TopologicalSpace (E x)] [FiberBundle F E]
    {f : B' → B} {x : B'} : Continuous (@TotalSpace.mk _ F (f *ᵖ E) x)

[TopologicalSpace (Bundle.TotalSpace F E)]


/-- If `δ` is small enough, a `(1-δ)`-separated set in the ball of radius `2` also has cardinality
at most `multiplicity E`. -/
theorem exists_goodδ :
    ∃ δ : ℝ, 0 < δ ∧ δ < 1 ∧ ∀ s : Finset E, (∀ c ∈ s, ‖c‖ ≤ 2) →
      (∀ c ∈ s, ∀ d ∈ s, c ≠ d → 1 - δ ≤ ‖c - d‖) → s.card ≤ multiplicity E

(E : Type u_1)
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]

∃ δ,
  0 < δ ∧
    δ < 1 ∧
      ∀ (s : Finset E),
        (∀ c ∈ s, ‖c‖ ≤ 2) → (∀ c ∈ s, ∀ d ∈ s, c ≠ d → 1 - δ ≤ ‖c - d‖) → s.card ≤ Besicovitch.multiplicity E


lemma isLocallyInjective_comp_iff [IsLocallyInjective J ψ] :
    IsLocallyInjective J (φ ≫ ψ) ↔ IsLocallyInjective J φ

(J : CategoryTheory.GrothendieckTopology C)

{F₁ F₂ F₃ : CategoryTheory.Functor Cᵒᵖ D}

CategoryTheory.Presheaf.IsLocallyInjective J (CategoryTheory.CategoryStruct.comp φ ψ) ↔
  CategoryTheory.Presheaf.IsLocallyInjective J φ


theorem length_eraseIdx : ∀ {l i}, i < length l → length (@eraseIdx α l i) = length l - 1

i < l.length → (l.eraseIdx i).length = l.length - 1


@[simp]
theorem not_ite_eq_true_eq_false (p : Prop) [h : Decidable p] (b c : Bool) :
  ¬(ite p (b = true) (c = false)) ↔ (ite p (b = false) (c = true))

(¬if p then b = true else c = false) ↔ if p then b = false else c = true


@[to_additive]
theorem eq_mul_inv_iff_mul_eq {a b : α} : a = b * ↑c⁻¹ ↔ a * c = b

{α : Type u}
[AddMonoid α]
(c : AddUnits α)
{a b : α}


lemma lmul_elem [EssFiniteType R S] [FormallyUnramified R S] :
    TensorProduct.lmul' R (elem R S) = 1

{R S : Type u_2}
[CommRing R]
[CommRing S]
[Algebra R S]
[Algebra.EssFiniteType R S]
[Algebra.FormallyUnramified R S]

(Algebra.TensorProduct.lmul' R) (Algebra.FormallyUnramified.elem R S) = 1


@[to_additive (attr := simp)]
theorem mul_left_inj (a : αˣ) {b c : α} : b * a = c * a ↔ b = c

{α : Type u}
[AddMonoid α]
(a : AddUnits α)
{b c : α}


theorem IsSubterminal.def : IsSubterminal A ↔ ∀ ⦃Z : C⦄ (f g : Z ⟶ A), f = g

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

CategoryTheory.IsSubterminal A ↔ ∀ ⦃Z : C⦄ (f g : Z ⟶ A), f = g


/-- **Intersecting Chords Theorem**. -/
theorem mul_dist_eq_mul_dist_of_cospherical_of_angle_eq_pi {a b c d p : P}
    (h : Cospherical ({a, b, c, d} : Set P)) (hapb : ∠ a p b = π) (hcpd : ∠ c p d = π) :
    dist a p * dist b p = dist c p * dist d p

(h : EuclideanGeometry.Cospherical {a, b, c, d})


@[to_additive]
lemma IsMulFreimanIso.mul_eq_mul (hf : IsMulFreimanIso 2 A B f) {a b c d : α}
    (ha : a ∈ A) (hb : b ∈ A) (hc : c ∈ A) (hd : d ∈ A) :
    f a * f b = f c * f d ↔ a * b = c * d

{α : Type u_2}
{β : Type u_3}
[AddCommMonoid α]
[AddCommMonoid β]
{A : Set α}
{B : Set β}
{f : α → β}
(hf : IsAddFreimanIso 2 A B f)
{a b c d : α}
(ha : a ∈ A)
(hb : b ∈ A)
(hc : c ∈ A)
(hd : d ∈ A)


@[simp]
theorem isWF_support (x : HahnSeries Γ R) : x.support.IsWF

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
(x : HahnSeries Γ R)


theorem isSplittingField_of_card_eq (h : Fintype.card K = p ^ n) :
    IsSplittingField (ZMod p) K (X ^ p ^ n - X)

(p : ℕ)
[h_prime : Fact (Nat.Prime p)]
(n : ℕ)
{K : Type u_1}
[Field K]
[Fintype K]
[Algebra (ZMod p) K]
(h : Fintype.card K = p ^ n)

Polynomial.IsSplittingField (ZMod p) K (Polynomial.X ^ p ^ n - Polynomial.X)


lemma add'_zero (f : L.obj X ⟶ L.obj Y) :
    add' W f (L.map 0) = f

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_3, u_2} D]
[CategoryTheory.Preadditive C]
{L : CategoryTheory.Functor C D}
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasLeftCalculusOfFractions]
{X Y : C}
(f : L.obj X ⟶ L.obj Y)

CategoryTheory.Localization.Preadditive.add' W f (L.map 0) = f


lemma self_intCast_mul_intCast_mul : Commute (m * a : α) (n * a : α)

{α : Type u_3}
[Ring α]
(a : α)
(m n : ℤ)


theorem duplicate_iff_two_le_count [DecidableEq α] : x ∈+ l ↔ 2 ≤ count x l

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


@[ext]
theorem ext {f g : P →ᴬ[R] Q} (h : ∀ x, f x = g x) : f = g

{R : Type u_1}
{V : Type u_2}
{W : Type u_3}
{P : Type u_4}
{Q : Type u_5}
[Ring R]
[AddCommGroup V]
[Module R V]
[TopologicalSpace P]
[AddTorsor V P]
[AddCommGroup W]
[Module R W]
[TopologicalSpace Q]
[AddTorsor W Q]
{f g : P →ᴬ[R] Q}
(h : ∀ (x : P), f x = g x)


@[simp]
protected theorem fderiv_aeval :
    fderiv 𝕜 (fun x => aeval x q) x = smulRight (1 : 𝕜 →L[𝕜] 𝕜) (aeval x (derivative q))

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{R : Type u_1}
[CommSemiring R]
[Algebra R 𝕜]
(q : R[X])

fderiv 𝕜 (fun x => (Polynomial.aeval x) q) x =
  ContinuousLinearMap.smulRight 1 ((Polynomial.aeval x) (Polynomial.derivative q))


lemma prod_primeFactors_invOn_squarefree :
    Set.InvOn (fun n : ℕ ↦ (factorization n).support) (fun s ↦ ∏ p ∈ s, p)
      {s | ∀ p ∈ s, p.Prime} {n | Squarefree n}

Set.InvOn (fun n => n.factorization.support) (fun s => ∏ p ∈ s, p) {s | ∀ p ∈ s, Nat.Prime p} {n | Squarefree n}


/-- The right fraction in the opposite category corresponding to a left fraction. -/
@[simps]
def LeftFraction.op {X Y : C} (φ : W.LeftFraction X Y) :
    W.op.RightFraction (Opposite.op Y) (Opposite.op X)

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


/-- The distinguished triangle in the derived category associated to a short
exact sequence of cochain complexes. -/
@[simps!]
noncomputable def triangleOfSES : Triangle (DerivedCategory C)

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

(DerivedCategory.triangleOfSES hS).obj₃ = DerivedCategory.Q.obj S.X₃


@[to_additive (attr := simp)]
theorem conj_iff {a x y b : G} :
    SemiconjBy (b * a * b⁻¹) (b * x * b⁻¹) (b * y * b⁻¹) ↔ SemiconjBy a x y

{G : Type u_3}
[AddGroup G]
{a x y b : G}

AddSemiconjBy (b + a + -b) (b + x + -b) (b + y + -b) ↔ AddSemiconjBy a x y


theorem contDiffAt_pi : ContDiffAt 𝕜 n Φ x ↔ ∀ i, ContDiffAt 𝕜 n (fun x => Φ x i) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{n : ℕ∞}
{ι : Type u_3}
[Fintype ι]
{F' : ι → Type u_5}
[(i : ι) → NormedAddCommGroup (F' i)]
[(i : ι) → NormedSpace 𝕜 (F' i)]
{Φ : E → (i : ι) → F' i}

ContDiffAt 𝕜 n Φ x ↔ ∀ (i : ι), ContDiffAt 𝕜 n (fun x => Φ x i) x


@[simp]
theorem unbot'_bot {α} (d : α) : unbot' d ⊥ = d


@[reassoc (attr := simp)]
theorem inv_hom_whiskerRight {f g : a ⟶ b} (η : f ≅ g) (h : b ⟶ c) :
    η.inv ▷ h ≫ η.hom ▷ h = 𝟙 (g ≫ h)

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight η.inv h)
    (CategoryTheory.Bicategory.whiskerRight η.hom h) =
  CategoryTheory.CategoryStruct.id (CategoryTheory.CategoryStruct.comp g h)


@[to_additive (attr := simp)]
theorem mk_smul (n : ℕ) (x : α) : mk (f := f) n • x = f^[n] x

{α : Type u_1}
{f : α → α}
(n : ℕ)
(x : α)


/-- Backwards map of `Trivialization.continuousLinearEquivAt`, defined everywhere. -/
@[simps (config := .asFn) apply]
def symmL (e : Trivialization F (π F E)) [e.IsLinear R] (b : B) : F →L[R] E b

[TopologicalSpace (Bundle.TotalSpace F E)]

(e : Trivialization F Bundle.TotalSpace.proj)

⇑(Trivialization.symmL R e b) = e.symm b


/-- An auxiliary lemma for `linearIndependent_le_basis`:
we handle the case where the basis `b` is infinite.
-/
theorem linearIndependent_le_infinite_basis {ι : Type w} (b : Basis ι R M) [Infinite ι] {κ : Type w}
    (v : κ → M) (i : LinearIndependent R v) : #κ ≤ #ι

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[StrongRankCondition R]
{ι : Type w}
(b : Basis ι R M)
[Infinite ι]
{κ : Type w}
(v : κ → M)
(i : LinearIndependent R v)


@[to_additive (attr := simp)]
theorem coe_snd : ⇑(snd M N) = Prod.snd

{M : Type u_5}
{N : Type u_6}
[Mul M]
[Mul N]


theorem C_mul_monomial : C a * monomial s a' = monomial s (a * a')

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

MvPolynomial.C a * (MvPolynomial.monomial s) a' = (MvPolynomial.monomial s) (a * a')


theorem inf_himp_right (s : Finset ι) (f : ι → α) (a : α) :
    (s.inf fun b => f b ⇨ a) = s.sup f ⇨ a

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


theorem min'_le (x) (H2 : x ∈ s) : s.min' ⟨x, H2⟩ ≤ x

{α : Type u_2}
[LinearOrder α]
(s : Finset α)
(x : α)
(H2 : x ∈ s)


theorem clusterPt_iff_not_disjoint {F : Filter X} :
    ClusterPt x F ↔ ¬Disjoint (𝓝 x) F

{X : Type u}
{x : X}
[TopologicalSpace X]
{F : Filter X}


@[simp]
theorem sections_add (s t : Multiset (Multiset α)) :
    Sections (s + t) = (Sections s).bind fun m => (Sections t).map (m + ·)

{α : Type u_1}
(s t : Multiset (Multiset α))

(s + t).Sections = s.Sections.bind fun m => Multiset.map (fun x => m + x) t.Sections


/-- A version of `Finset.sup'_image` with LHS and RHS reversed.
Also, this lemma assumes that `s` is nonempty instead of assuming that its image is nonempty. -/
lemma sup'_comp_eq_image [DecidableEq β] {s : Finset γ} {f : γ → β} (hs : s.Nonempty) (g : β → α) :
    s.sup' hs (g ∘ f) = (s.image f).sup' (hs.image f) g

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

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


@[simp]
lemma ΨSq_four : W.ΨSq 4 = W.preΨ₄ ^ 2 * W.Ψ₂Sq

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


theorem geom₂_sum [Field α] {x y : α} (h : x ≠ y) (n : ℕ) :
    ∑ i ∈ range n, x ^ i * y ^ (n - 1 - i) = (x ^ n - y ^ n) / (x - y)

{α : Type u}
[Field α]
{x y : α}
(h : x ≠ y)
(n : ℕ)

∑ i ∈ Finset.range n, x ^ i * y ^ (n - 1 - i) = (x ^ n - y ^ n) / (x - y)


/-- See also `continuousAt_cpow` for a version that assumes `p.1 ≠ 0` but makes no
assumptions about `p.2`. -/
theorem continuousAt_cpow_of_re_pos {p : ℂ × ℂ} (h₁ : 0 ≤ p.1.re ∨ p.1.im ≠ 0) (h₂ : 0 < p.2.re) :
    ContinuousAt (fun x : ℂ × ℂ => x.1 ^ x.2) p


/-- If `(x, y)` is a solution with `x` and `y` positive, then all its powers with positive
exponents have positive `y`. -/
theorem y_zpow_pos {a : Solution₁ d} (hax : 0 < a.x) (hay : 0 < a.y) {n : ℤ} (hn : 0 < n) :
    0 < (a ^ n).y

{d : ℤ}
{a : Pell.Solution₁ d}
(hax : 0 < a.x)
(hay : 0 < a.y)
{n : ℤ}
(hn : 0 < n)


lemma iSup_coe_ne_top : ⨆ i, (f i : ℕ∞) ≠ ⊤ ↔ BddAbove (range f)

⨆ i, ↑(f i) ≠ ⊤ ↔ BddAbove (Set.range f)


theorem _root_.StrictAntiOn.mono (h : StrictAntiOn f s) (h' : s₂ ⊆ s) : StrictAntiOn f s₂

{α : Type u_1}
{β : Type u_2}
{s s₂ : Set α}
{f : α → β}
[Preorder α]
[Preorder β]
(h : StrictAntiOn f s)
(h' : s₂ ⊆ s)


theorem kroneckerMap_map_right (f : α → β' → γ) (g : β → β') (A : Matrix l m α) (B : Matrix n p β) :
    kroneckerMap f A (B.map g) = kroneckerMap (fun a b => f a (g b)) A B

{α : Type u_2}
{β : Type u_4}
{β' : Type u_5}
{γ : Type u_6}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
{p : Type u_11}
(f : α → β' → γ)
(g : β → β')
(A : Matrix l m α)
(B : Matrix n p β)

Matrix.kroneckerMap f A (B.map g) = Matrix.kroneckerMap (fun a b => f a (g b)) A B


theorem pimage_congr (h₁ : s = t) (h₂ : ∀ x ∈ t, f x = g x) : s.pimage f = t.pimage g

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{f g : α →. β}
[(x : α) → Decidable (f x).Dom]
[(x : α) → Decidable (g x).Dom]
{s t : Finset α}
(h₁ : s = t)
(h₂ : ∀ x ∈ t, f x = g x)


theorem Bounded.mono_right {x y : α} (xy : x ≤ y) :
    ∀ {t : Ordnode α} {o}, Bounded t o x → Bounded t o y

{α : Type u_1}
[Preorder α]
{x y : α}
(xy : x ≤ y)
{t : Ordnode α}
{o : WithBot α}


theorem Filter.nonneg_of_eventually_pow_nonneg {α : Type*} [LinearOrderedRing α] {a : α}
    (h : ∀ᶠ n in atTop, 0 ≤ a ^ (n : ℕ)) : 0 ≤ a

(h : ∀ᶠ (n : ℕ) in Filter.atTop, 0 ≤ a ^ n)


/-- A generalisation of the **Cauchy-Davenport theorem** to arbitrary groups. The size of `s * t` is
lower-bounded by `|s| + |t| - 1` unless this quantity is greater than the size of the smallest
subgroup. -/
@[to_additive "A generalisation of the **Cauchy-Davenport theorem** to arbitrary groups. The size of
`s + t` is lower-bounded by `|s| + |t| - 1` unless this quantity is greater than the size of the
smallest subgroup."]
lemma Finset.min_le_card_mul (hs : s.Nonempty) (ht : t.Nonempty) :
    min (minOrder α) ↑(s.card + t.card - 1) ≤ (s * t).card

{α : Type u_1}
[Group α]
[DecidableEq α]
{s t : Finset α}
(hs : s.Nonempty)
(ht : t.Nonempty)

min (Monoid.minOrder α) ↑(s.card + t.card - 1) ≤ ↑(s * t).card


protected theorem IsChain.directed {f : β → α} {c : Set β} (h : IsChain (f ⁻¹'o r) c) :
    Directed r fun x : { a : β // a ∈ c } => f x

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
[IsRefl α r]
{f : β → α}
{c : Set β}
(h : IsChain (f ⁻¹'o r) c)


theorem neg_pi_div_two_lt_arctan (x : ℝ) : -(π / 2) < arctan x


/-- The **extreme value theorem**: if a function `f` is continuous on a closed set `s` and it is
larger than a value in its image away from compact sets, then it has a minimum on this set. -/
@[deprecated ContinuousOn.exists_isMinOn' (since := "2023-02-06")]
theorem ContinuousOn.exists_forall_le' [ClosedIicTopology α] {s : Set β} {f : β → α}
    (hf : ContinuousOn f s) (hsc : IsClosed s) {x₀ : β} (h₀ : x₀ ∈ s)
    (hc : ∀ᶠ x in cocompact β ⊓ 𝓟 s, f x₀ ≤ f x) : ∃ x ∈ s, ∀ y ∈ s, f x ≤ f y

(hc : ∀ᶠ (x : β) in Filter.cocompact β ⊓ 𝓟 s, f x₀ ≤ f x)


/--
Functorially postcompose a cone for `F` by a natural transformation `F ⟶ G` to give a cone for `G`.
-/
@[simps]
def postcompose {G : J ⥤ C} (α : F ⟶ G) : Cone F ⥤ Cone G

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

∀ {X Y : CategoryTheory.Limits.Cone F} (f : X ⟶ Y), ((CategoryTheory.Limits.Cones.postcompose α).map f).hom = f.hom


theorem AEMeasurable.snd [SFinite ν] {f : β → γ} (hf : AEMeasurable f ν) :
    AEMeasurable (fun z : α × β => f z.2) (μ.prod ν)

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[MeasurableSpace α]
[MeasurableSpace β]
[MeasurableSpace γ]
{μ : MeasureTheory.Measure α}
{ν : MeasureTheory.Measure β}
[MeasureTheory.SFinite ν]
{f : β → γ}
(hf : AEMeasurable f ν)

AEMeasurable (fun z => f z.2) (μ.prod ν)


/-- Chord-length is a multiple of arc-length up to constants. -/
lemma norm_sub_mem_Icc_angle (hx : ‖x‖ = 1) (hy : ‖y‖ = 1) :
    ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)

‖x - y‖ ∈ Set.Icc (2 / π * InnerProductGeometry.angle x y) (InnerProductGeometry.angle x y)


/-- Let `p` be a predicate on `Box ι`, let `I` be a box. Suppose that the following two properties
hold true.

* `H_ind` : Consider a smaller box `J ≤ I`. The hyperplanes passing through the center of `J` split
  it into `2 ^ n` boxes. If `p` holds true on each of these boxes, then it true on `J`.

* `H_nhds` : For each `z` in the closed box `I.Icc` there exists a neighborhood `U` of `z` within
  `I.Icc` such that for every box `J ≤ I` such that `z ∈ J.Icc ⊆ U`, if `J` is homothetic to `I`
  with a coefficient of the form `1 / 2 ^ m`, then `p` is true on `J`.

Then `p I` is true. See also `BoxIntegral.Box.subbox_induction_on` for a version using
`BoxIntegral.Prepartition.splitCenter` instead of `BoxIntegral.Box.splitCenterBox`.

The proof still works if we assume `H_ind` only for subboxes `J ≤ I` that are homothetic to `I` with
a coefficient of the form `2⁻ᵐ` but we do not need this generalization yet. -/
@[elab_as_elim]
theorem subbox_induction_on' {p : Box ι → Prop} (I : Box ι)
    (H_ind : ∀ J ≤ I, (∀ s, p (splitCenterBox J s)) → p J)
    (H_nhds : ∀ z ∈ Box.Icc I, ∃ U ∈ 𝓝[Box.Icc I] z, ∀ J ≤ I, ∀ (m : ℕ), z ∈ Box.Icc J →
      Box.Icc J ⊆ U → (∀ i, J.upper i - J.lower i = (I.upper i - I.lower i) / 2 ^ m) → p J) :
    p I

(H_ind : ∀ J ≤ I, (∀ (s : Set ι), p (J.splitCenterBox s)) → p J)

(H_nhds :
  ∀ z ∈ BoxIntegral.Box.Icc I,
    ∃ U ∈ 𝓝[BoxIntegral.Box.Icc I] z,
      ∀ J ≤ I,
        ∀ (m : ℕ),
          z ∈ BoxIntegral.Box.Icc J →
            BoxIntegral.Box.Icc J ⊆ U → (∀ (i : ι), J.upper i - J.lower i = (I.upper i - I.lower i) / 2 ^ m) → p J)


/-- The splitting of the short complex `S.unop` deduced from a splitting of `S`. -/
@[simps]
def unop {S : ShortComplex Cᵒᵖ} (h : Splitting S) : Splitting S.unop

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{S : CategoryTheory.ShortComplex Cᵒᵖ}
(h : S.Splitting)


protected theorem LTCmp.compareOfLessAndEq_of_le
    [LT α] [DecidableRel (LT.lt (α := α))] [DecidableEq α] [LE α]
    (lt_irrefl : ∀ x : α, ¬x < x)
    (lt_trans : ∀ {x y z : α}, x < y → y < z → x < z)
    (not_lt : ∀ {x y : α}, ¬x < y → y ≤ x)
    (le_antisymm : ∀ {x y : α}, x ≤ y → y ≤ x → x = y) :
    LTCmp (α := α) (compareOfLessAndEq · ·)

Batteries.LTCmp fun x x_1 => compareOfLessAndEq x x_1


@[to_additive (attr := simp) zsmul_smul_addOrderOf]
theorem zpow_pow_orderOf : (x ^ i) ^ orderOf x = 1

{G : Type u_1}
[Group G]
{x : G}
{i : ℤ}


@[to_additive]
protected theorem Inducing.hasProd_iff [CommMonoid γ] [TopologicalSpace γ] {G}
    [FunLike G α γ] [MonoidHomClass G α γ] {g : G} (hg : Inducing g) (f : β → α) (a : α) :
    HasProd (g ∘ f) (g a) ↔ HasProd f a

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CommMonoid α]
[TopologicalSpace α]
[CommMonoid γ]
[TopologicalSpace γ]
{G : Type u_5}
[FunLike G α γ]
[MonoidHomClass G α γ]
{g : G}
(hg : Inducing ⇑g)
(f : β → α)
(a : α)


lemma isSelfAdjoint_algebraMap_iff {r : R} (h : Function.Injective (algebraMap R A)) :
    IsSelfAdjoint (algebraMap R A r) ↔ IsSelfAdjoint r

(h : Function.Injective ⇑(algebraMap R A))

IsSelfAdjoint ((algebraMap R A) r) ↔ IsSelfAdjoint r


theorem natAbs_le_iff_mul_self_le {a b : ℤ} : a.natAbs ≤ b.natAbs ↔ a * a ≤ b * b


@[to_additive]
theorem mem_map_of_mem (f : M →ₙ* N) {S : Subsemigroup M} {x : M} (hx : x ∈ S) : f x ∈ S.map f

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
(f : M →ₙ* N)
{S : Subsemigroup M}
{x : M}
(hx : x ∈ S)


/-- If `f` has a formal power series on a ball bounded by `1`, then `f` is constant equal
to `f x` on the ball. -/
theorem HasFiniteFPowerSeriesOnBall.eq_const_of_bound_one
    (hf : HasFiniteFPowerSeriesOnBall f pf x 1 r) : ∀ y ∈ EMetric.ball x r, f y = f x


/-- Corresponds to `norm_eq_zero`. -/
@[simp]
theorem hammingNorm_eq_zero {x : ∀ i, β i} : hammingNorm x = 0 ↔ x = 0

{ι : Type u_2}
{β : ι → Type u_3}
[Fintype ι]
[(i : ι) → DecidableEq (β i)]
[(i : ι) → Zero (β i)]
{x : (i : ι) → β i}


/-- The orientations given by two bases are equal if and only if the determinant of one basis
with respect to the other is positive. -/
theorem orientation_eq_iff_det_pos (e₁ e₂ : Basis ι R M) :
    e₁.orientation = e₂.orientation ↔ 0 < e₁.det e₂

{R : Type u_1}
[LinearOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{ι : Type u_3}
[Fintype ι]
[DecidableEq ι]
(e₁ e₂ : Basis ι R M)

e₁.orientation = e₂.orientation ↔ 0 < e₁.det ⇑e₂


/-- If `S`, `Q` are localizations of `R` at the submonoid `M` respectively,
there is an isomorphism of localizations `S ≃ₐ[R] Q`. -/
@[simps!]
noncomputable def algEquiv : S ≃ₐ[R] Q

{R : Type u_1}
[CommSemiring R]
(M : Submonoid R)
(S : Type u_2)
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
(Q : Type u_4)
[CommSemiring Q]
[Algebra R Q]
[IsLocalization M Q]
(a : Q)

(IsLocalization.algEquiv M S Q).symm a = (IsLocalization.map S (RingHom.id R) ⋯) a


theorem add_smul_subset (a b : α) (s : Set β) : (a + b) • s ⊆ a • s + b • s

{α : Type u_2}
{β : Type u_3}
[Semiring α]
[AddCommMonoid β]
[Module α β]
(a b : α)
(s : Set β)


/-- Seminorm-balls at the origin are absorbent. -/
protected theorem absorbent_ball_zero (hr : 0 < r) : Absorbent 𝕜 (ball p (0 : E) r)

{𝕜 : Type u_3}
{E : Type u_7}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : Seminorm 𝕜 E)
{r : ℝ}
(hr : 0 < r)


theorem add [ContinuousAdd M] {v₁ v₂ : VectorMeasure α M} {w : VectorMeasure α N} (hv₁ : v₁ ≪ᵥ w)
    (hv₂ : v₂ ≪ᵥ w) : v₁ + v₂ ≪ᵥ w

{v₁ v₂ : MeasureTheory.VectorMeasure α M}

v₁ + v₂ ≪ᵥ w


theorem comap_map_eq (hf : f.ker = ⊥) : comap f (map f N) = N

{R : Type u}
{L : Type v}
{M : Type w}
{M₂ : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[AddCommGroup M₂]
[Module R M₂]
[LieRingModule L M₂]
(N : LieSubmodule R L M)
(f : M →ₗ⁅R,L⁆ M₂)
(hf : f.ker = ⊥)

LieSubmodule.comap f (LieSubmodule.map f N) = N


theorem ofInt_im (n : ℤ) : (ofInt n : ℤ√d).im = 0


@[simp] theorem zero_fdiv (b : Int) : fdiv 0 b = 0


theorem intersecting_empty : (∅ : Set α).Intersecting

{α : Type u_1}
[SemilatticeInf α]
[OrderBot α]


@[simp] lemma support_nonempty : p.support.Nonempty ↔ p ≠ 0


@[simp] theorem Proj.sub_apply : (s - t).1 x = s.1 x - t.1 x

{V : (TopologicalSpace.Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ}

(s t : ↑((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).val.obj V))


theorem of_smul_eq_smul {i : ι} (g : G i) (w : NormalWord d) :
    of (φ := φ) i g • w = g • w

{d : Monoid.PushoutI.NormalWord.Transversal φ}


@[simp]
theorem iterToSum_C_C (a : R) : iterToSum R S₁ S₂ (C (C a)) = C a

(R : Type u)
(S₁ : Type v)
(S₂ : Type w)
[CommSemiring R]
(a : R)

(MvPolynomial.iterToSum R S₁ S₂) (MvPolynomial.C (MvPolynomial.C a)) = MvPolynomial.C a


@[to_additive (attr := simp)]
theorem ofLex_inv [Inv α] (a : Lex α) : ofLex a⁻¹ = (ofLex a)⁻¹


theorem setIntegral_nonpos_ae (hs : MeasurableSet s) (hf : ∀ᵐ x ∂μ, x ∈ s → f x ≤ 0) :
    ∫ x in s, f x ∂μ ≤ 0

{X : Type u_1}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
{f : X → ℝ}
{s : Set X}
(hs : MeasurableSet s)
(hf : ∀ᵐ (x : X) ∂μ, x ∈ s → f x ≤ 0)


theorem neg_pi_div_two_le_arcsin (x : ℝ) : -(π / 2) ≤ arcsin x


@[simp]
theorem Tape.move_right_left {Γ} [Inhabited Γ] (T : Tape Γ) :
    (T.move Dir.right).move Dir.left = T

{Γ : Type u_1}
[Inhabited Γ]
(T : Turing.Tape Γ)

Turing.Tape.move Turing.Dir.left (Turing.Tape.move Turing.Dir.right T) = T


theorem minCardFinsetOfMemConvexHull_subseteq : ↑(minCardFinsetOfMemConvexHull hx) ⊆ s

{𝕜 : Type u_1}
{E : Type u}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
{x : E}
(hx : x ∈ (convexHull 𝕜) s)

↑(Caratheodory.minCardFinsetOfMemConvexHull hx) ⊆ s


/-- The `skeleton` of `C` given by choice is a skeleton of `C`. -/
lemma skeleton_isSkeleton : IsSkeletonOf C (Skeleton C) (fromSkeleton C)

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

CategoryTheory.IsSkeletonOf C (CategoryTheory.Skeleton C) (CategoryTheory.fromSkeleton C)


theorem measure_eq_measure_of_null_diff {s t : Set α} (hst : s ⊆ t) (h_nulldiff : μ (t \ s) = 0) :
    μ s = μ t

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
(hst : s ⊆ t)
(h_nulldiff : μ (t \ s) = 0)


@[simp]
theorem one_cpow (x : ℂ) : (1 : ℂ) ^ x = 1


private theorem HD_lipschitz_aux3 (f g : Cb X Y) : HD f ≤ HD g + dist f g

{X : Type u}
{Y : Type v}
[MetricSpace X]
[Nonempty X]
[MetricSpace Y]
[Nonempty Y]
(f g : GromovHausdorff.Cb X Y)

GromovHausdorff.HD f ≤ GromovHausdorff.HD g + dist f g


@[simp]
lemma natTransLift_app (F G : Quotient r ⥤ D)
    (τ : Quotient.functor r ⋙ F ⟶ Quotient.functor r ⋙ G) (X : C) :
  (natTransLift r τ).app ((Quotient.functor r).obj X) = τ.app X

(F G : CategoryTheory.Functor (CategoryTheory.Quotient r) D)

(τ : (CategoryTheory.Quotient.functor r).comp F ⟶ (CategoryTheory.Quotient.functor r).comp G)

(CategoryTheory.Quotient.natTransLift r τ).app ((CategoryTheory.Quotient.functor r).obj X) = τ.app X


theorem norm_rat_le_one : ∀ {q : ℚ} (_ : ¬p ∣ q.den), ‖(q : ℚ_[p])‖ ≤ 1

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


@[simp 1100]
theorem normalize_gcd [NormalizedGCDMonoid α] : ∀ a b : α, normalize (gcd a b) = gcd a b

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


theorem ascPochhammer_succ_eval {S : Type*} [Semiring S] (n : ℕ) (k : S) :
    (ascPochhammer S (n + 1)).eval k = (ascPochhammer S n).eval k * (k + n)

{S : Type u_1}
[Semiring S]
(n : ℕ)
(k : S)

Polynomial.eval k (ascPochhammer S (n + 1)) = Polynomial.eval k (ascPochhammer S n) * (k + ↑n)


theorem convex_uIcc (r s : β) : Convex 𝕜 (uIcc r s)

{𝕜 : Type u_1}
{β : Type u_4}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid β]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
(r s : β)


@[simp]
theorem cardFactors_eq_one_iff_prime {n : ℕ} : Ω n = 1 ↔ n.Prime

ArithmeticFunction.cardFactors n = 1 ↔ Nat.Prime n


/-- The unoriented angle at `p` between two points not equal to `p` is the absolute value of the
oriented angle. -/
theorem angle_eq_abs_oangle_toReal {p p₁ p₂ : P} (hp₁ : p₁ ≠ p) (hp₂ : p₂ ≠ p) :
    ∠ p₁ p p₂ = |(∡ p₁ p p₂).toReal|

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


theorem C_p_pow_dvd_bind₁_rename_wittPolynomial_sub_sum (Φ : MvPolynomial idx ℤ) (n : ℕ)
    (IH :
      ∀ m : ℕ,
        m < n →
          map (Int.castRingHom ℚ) (wittStructureInt p Φ m) =
            wittStructureRat p (map (Int.castRingHom ℚ) Φ) m) :
    (C ((p ^ n :) : ℤ) : MvPolynomial (idx × ℕ) ℤ) ∣
      bind₁ (fun b : idx => rename (fun i => (b, i)) (wittPolynomial p ℤ n)) Φ -
        ∑ i ∈ range n, C ((p : ℤ) ^ i) * wittStructureInt p Φ i ^ p ^ (n - i)

(IH :
  ∀ m < n,
    (MvPolynomial.map (Int.castRingHom ℚ)) (wittStructureInt p Φ m) =
      wittStructureRat p ((MvPolynomial.map (Int.castRingHom ℚ)) Φ) m)

MvPolynomial.C ↑(p ^ n) ∣
  (MvPolynomial.bind₁ fun b => (MvPolynomial.rename fun i => (b, i)) (W_ ℤ n)) Φ -
    ∑ i ∈ Finset.range n, MvPolynomial.C (↑p ^ i) * wittStructureInt p Φ i ^ p ^ (n - i)


/-- As long as the category has equalizers,
the image inclusion maps commute with `image.eqToIso`.
-/
theorem image.eq_fac [HasEqualizers C] (h : f = f') :
    image.ι f = (image.eqToIso h).hom ≫ image.ι f'

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

CategoryTheory.Limits.image.ι f = (CategoryTheory.Limits.image.eqToIso h).hom ≫ CategoryTheory.Limits.image.ι f'


theorem map_sup [SemilatticeInf β] (hf : AntitoneOn f s) (hx : x ∈ s) (hy : y ∈ s) :
    f (x ⊔ y) = f x ⊓ f y

{α : Type u}
{β : Type v}
{f : α → β}
{s : Set α}
{x y : α}
[LinearOrder α]
[SemilatticeInf β]
(hf : AntitoneOn f s)
(hx : x ∈ s)
(hy : y ∈ s)


@[simp]
theorem coe_comp {X Y Z : UniformSpaceCat} (f : X ⟶ Y) (g : Y ⟶ Z) : (f ≫ g : X → Z) = g ∘ f

(CategoryTheory.forget UniformSpaceCat).map (f ≫ g) =
  (CategoryTheory.forget UniformSpaceCat).map g ∘ (CategoryTheory.forget UniformSpaceCat).map f


theorem continuousWithinAt_iff_continuousAt {f : α → β} {s : Set α} {x : α} (h : s ∈ 𝓝 x) :
    ContinuousWithinAt f s x ↔ ContinuousAt f x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{s : Set α}
{x : α}
(h : s ∈ 𝓝 x)


/-- A reversed version of `Fin.cast_eq_cast` that is easier to rewrite with. -/
theorem Fin.cast_eq_cast' {n m : ℕ} (h : Fin n = Fin m) :
    _root_.cast h = Fin.cast (fin_injective h)


theorem negSucc_zsmul {G} [SubNegMonoid G] (a : G) (n : ℕ) :
    Int.negSucc n • a = -((n + 1) • a)

{G : Type u_2}
[SubNegMonoid G]
(a : G)
(n : ℕ)


@[elab_as_elim]
lemma adjoin_induction' {s : Set A} {p : ∀ x, x ∈ adjoin R s → Prop} {a : A}
    (ha : a ∈ adjoin R s) (mem : ∀ (x : A) (hx : x ∈ s), p x (subset_adjoin R s hx))
    (add : ∀ x hx y hy, p x hx → p y hy → p (x + y) (add_mem hx hy))
    (zero : p 0 (zero_mem _)) (mul : ∀ x hx y hy, p x hx → p y hy → p (x * y) (mul_mem hx hy))
    (smul : ∀ (r : R) x hx, p x hx → p (r • x) (SMulMemClass.smul_mem r hx))
    (star : ∀ x hx, p x hx → p (star x) (star_mem hx)) : p a ha

{p : (x : A) → x ∈ NonUnitalStarAlgebra.adjoin R s → Prop}

(ha : a ∈ NonUnitalStarAlgebra.adjoin R s)

(add :
  ∀ (x : A) (hx : x ∈ NonUnitalStarAlgebra.adjoin R s) (y : A) (hy : y ∈ NonUnitalStarAlgebra.adjoin R s),
    p x hx → p y hy → p (x + y) ⋯)

(mul :
  ∀ (x : A) (hx : x ∈ NonUnitalStarAlgebra.adjoin R s) (y : A) (hy : y ∈ NonUnitalStarAlgebra.adjoin R s),
    p x hx → p y hy → p (x * y) ⋯)

(smul : ∀ (r : R) (x : A) (hx : x ∈ NonUnitalStarAlgebra.adjoin R s), p x hx → p (r • x) ⋯)

(star : ∀ (x : A) (hx : x ∈ NonUnitalStarAlgebra.adjoin R s), p x hx → p (star x) ⋯)


theorem eq_zero_of_not_dvd {z : ℤ} (h : ¬(p : ℤ) ∣ z) : padicValInt p z = 0


@[simp]
theorem toNonUnitalRingHom_trans (e₁ : R ≃+* S) (e₂ : S ≃+* S') :
    (e₁.trans e₂).toNonUnitalRingHom = e₂.toNonUnitalRingHom.comp e₁.toNonUnitalRingHom

{R : Type u_4}
{S : Type u_5}
{S' : Type u_6}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
[NonUnitalNonAssocSemiring S']
(e₁ : R ≃+* S)
(e₂ : S ≃+* S')


lemma _root_.isBigO_riemannZeta_sub_one_div {F : Type*} [Norm F] [One F] [NormOneClass F] :
    (fun s : ℂ ↦ riemannZeta s - 1 / (s - 1)) =O[𝓝 1] (fun _ ↦ 1 : ℂ → F)

{F : Type u_1}
[Norm F]
[One F]
[NormOneClass F]

(fun s => riemannZeta s - 1 / (s - 1)) =O[𝓝 1] fun x => 1


theorem Associated.gcd_eq_left [NormalizedGCDMonoid α] {m n : α} (h : Associated m n) (k : α) :
    gcd m k = gcd n k

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{m n : α}
(h : Associated m n)
(k : α)


theorem smeval_mul_X_pow : ∀ (n : ℕ), (p * X^n).smeval x = p.smeval x * x^n

(R : Type u_1)
[Semiring R]
(p : Polynomial R)
{S : Type u_2}
[NonAssocSemiring S]
[Module R S]
[IsScalarTower R S S]
[Pow S ℕ]
[NatPowAssoc S]
(x : S)
(n : ℕ)

(p * Polynomial.X ^ n).smeval x = p.smeval x * x ^ n


@[norm_cast]
theorem coe_zero' : ⇑(0 : M₁ →SL[σ₁₂] M₂) = 0

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]


@[simp] lemma Iic_le : Iic a ≤ s ↔ a ∈ s

{α : Type u_1}
[Preorder α]
{s : LowerSet α}
{a : α}


@[simp] theorem symm_symm (e : X ≃ᵈ Y) : e.symm.symm = e

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


theorem comm' (s : Setoid α) {x y} : s.Rel x y ↔ s.Rel y x


@[simp]
lemma homologyMap'_zero (h₁ : S₁.HomologyData) (h₂ : S₂.HomologyData) :
    homologyMap' 0 h₁ h₂ = 0

CategoryTheory.ShortComplex.homologyMap' 0 h₁ h₂ = 0


/-- A continuous function with compact support has a global minimum. -/
@[to_additive "A continuous function with compact support has a global minimum."]
theorem Continuous.exists_forall_le_of_hasCompactMulSupport [ClosedIicTopology α] [Nonempty β]
    [One α] {f : β → α} (hf : Continuous f) (h : HasCompactMulSupport f) :
    ∃ x : β, ∀ y : β, f x ≤ f y

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
[TopologicalSpace α]
[TopologicalSpace β]
[ClosedIicTopology α]
[Nonempty β]
[Zero α]
{f : β → α}
(hf : Continuous f)
(h : HasCompactSupport f)


@[to_additive] -- Porting note (#10618): `simp` can prove this.
theorem out_eq' (a : α ⧸ s) : mk a.out' = a

{α : Type u_1}
[AddGroup α]
{s : AddSubgroup α}
(a : α ⧸ s)


/-- The derivative of a function on a measurable set is almost everywhere measurable on this set
with respect to Lebesgue measure. Note that, in general, it is not genuinely measurable there,
as `f'` is not unique (but only on a set of measure `0`, as the argument shows). -/
theorem aemeasurable_fderivWithin (hs : MeasurableSet s)
    (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) : AEMeasurable f' (μ.restrict s)


theorem moveRight_nim_hEq (o : Ordinal) :
    have : IsWellOrder (Quotient.out o).α (· < ·) := inferInstance
    HEq (nim o).moveRight fun i : o.out.α => nim (typein (· < ·) i)

let_fun this := ⋯;
HEq (SetTheory.PGame.nim o).moveRight fun i => SetTheory.PGame.nim (Ordinal.typein (fun x x_1 => x < x_1) i)


theorem liminf_ae_eq_of_forall_ae_eq (s : ℕ → Set α) {t : Set α}
    (h : ∀ n, s n =ᵐ[μ] t) : liminf (α := Set α) s atTop =ᵐ[μ] t

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(s : ℕ → Set α)
{t : Set α}
(h : ∀ (n : ℕ), s n =ᵐ[μ] t)


theorem StarConvex.prod {y : F} {s : Set E} {t : Set F} (hs : StarConvex 𝕜 x s)
    (ht : StarConvex 𝕜 y t) : StarConvex 𝕜 (x, y) (s ×ˢ t)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[SMul 𝕜 E]
[SMul 𝕜 F]
{x : E}
{y : F}
{s : Set E}
{t : Set F}
(hs : StarConvex 𝕜 x s)
(ht : StarConvex 𝕜 y t)


theorem isBigO_abs_abs : ((fun x => |u x|) =O[l] fun x => |v x|) ↔ u =O[l] v

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


theorem card_interedges_le_mul (s t : Finset α) : (G.interedges s t).card ≤ s.card * t.card

{α : Type u_4}
(G : SimpleGraph α)
[DecidableRel G.Adj]
(s t : Finset α)


@[simp]
theorem mul_right (a b : N ⋊[φ] G) : (a * b).right = a.right * b.right

{N : Type u_1}
{G : Type u_2}
[Group N]
[Group G]
{φ : G →* MulAut N}
(a b : N ⋊[φ] G)


/-- *Lebesgue differentiation theorem*: for almost every point `x`, the
average of `‖f y - f x‖` on `a` tends to `0` as `a` shrinks to `x` along a Vitali family. -/
theorem ae_tendsto_average_norm_sub {f : α → E} (hf : LocallyIntegrable f μ) :
    ∀ᵐ x ∂μ, Tendsto (fun a => ⨍ y in a, ‖f y - f x‖ ∂μ) (v.filterAt x) (𝓝 0)

(hf : MeasureTheory.LocallyIntegrable f μ)

∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun a => ⨍ (y : α) in a, ‖f y - f x‖ ∂μ) (v.filterAt x) (𝓝 0)


/-- The orthogonal projection is self-adjoint. -/
theorem _root_.orthogonalProjection_isSelfAdjoint (U : Submodule 𝕜 E) [CompleteSpace U] :
    IsSelfAdjoint (U.subtypeL ∘L orthogonalProjection U)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[CompleteSpace E]
(U : Submodule 𝕜 E)
[CompleteSpace ↥U]

IsSelfAdjoint (U.subtypeL.comp (orthogonalProjection U))


@[simp]
theorem _root_.Prod.fst_exp [CompleteSpace 𝔹] (x : 𝔸 × 𝔹) : (exp 𝕂 x).fst = exp 𝕂 x.fst

(𝕂 : Type u_1)
{𝔸 : Type u_2}
{𝔹 : Type u_3}
[RCLike 𝕂]
[NormedRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[NormedRing 𝔹]
[NormedAlgebra 𝕂 𝔹]
[CompleteSpace 𝔸]
[CompleteSpace 𝔹]
(x : 𝔸 × 𝔹)

(NormedSpace.exp 𝕂 x).1 = NormedSpace.exp 𝕂 x.1


theorem map_monotone (d : ℕ) : Monotone (map d : (Fin n → ℕ) → ℕ)


theorem IsTensorProduct.lift_eq (h : IsTensorProduct f) (f' : M₁ →ₗ[R] M₂ →ₗ[R] M') (x₁ : M₁)
    (x₂ : M₂) : h.lift f' (f x₁ x₂) = f' x₁ x₂

{R : Type u_1}
[CommSemiring R]
{M₁ : Type u_2}
{M₂ : Type u_3}
{M : Type u_4}
{M' : Type u_5}
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid M]
[AddCommMonoid M']
[Module R M₁]
[Module R M₂]
[Module R M]
[Module R M']
{f : M₁ →ₗ[R] M₂ →ₗ[R] M}
(h : IsTensorProduct f)
(f' : M₁ →ₗ[R] M₂ →ₗ[R] M')
(x₁ : M₁)
(x₂ : M₂)


@[simp]
lemma baseChange_span (s : Set M) :
    (span R s).baseChange A = span A (TensorProduct.mk R A M 1 '' s)

{R : Type u_1}
{M : Type u_2}
(A : Type u_3)
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]
(s : Set M)

Submodule.baseChange A (Submodule.span R s) = Submodule.span A (⇑((TensorProduct.mk R A M) 1) '' s)


@[to_additive (attr := simp)]
theorem mk_of_inl (x : M) : (mk (of (.inl x)) : M ∗ N) = inl x

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
(x : M)

AddMonoid.Coprod.mk (FreeAddMonoid.of (Sum.inl x)) = AddMonoid.Coprod.inl x


lemma Fintype.sum_smul_sum [Fintype α] [Fintype β] (f : α → R) (g : β → M) :
    (∑ i, f i) • ∑ j, g j = ∑ i, ∑ j, f i • g j

{α : Type u_3}
{β : Type u_4}
{R : Type u_5}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Fintype α]
[Fintype β]
(f : α → R)
(g : β → M)

(∑ i : α, f i) • ∑ j : β, g j = ∑ i : α, ∑ j : β, f i • g j


theorem Perm.inter_append {l t₁ t₂ : List α} (h : Disjoint t₁ t₂) :
    l ∩ (t₁ ++ t₂) ~ l ∩ t₁ ++ l ∩ t₂

{α : Type u_1}
[DecidableEq α]
{l t₁ t₂ : List α}
(h : t₁.Disjoint t₂)

(l ∩ (t₁ ++ t₂)).Perm (l ∩ t₁ ++ l ∩ t₂)


theorem IsLittleO.eventuallyLE (h : f =o[l] g) : ∀ᶠ x in l, ‖f x‖ ≤ ‖g x‖

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{f : α → E}
{g : α → F}
{l : Filter α}
(h : f =o[l] g)


theorem map_injOn : {x : Fin n → ℕ | ∀ i, x i < d}.InjOn (map d)

Set.InjOn ⇑(Behrend.map d) {x | ∀ (i : Fin n), x i < d}


@[simp]
theorem arg_coe_angle_eq_iff {x y : ℂ} : (arg x : Real.Angle) = arg y ↔ arg x = arg y


theorem lt_three {p q r : ℕ+} (hpq : p ≤ q) (hqr : q ≤ r) (H : 1 < sumInv {p, q, r}) : p < 3

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


theorem normSq_div_sub_div_lt_one (x y : ℤ[i]) :
    Complex.normSq ((x / y : ℂ) - ((x / y : ℤ[i]) : ℂ)) < 1

Complex.normSq (GaussianInt.toComplex x / GaussianInt.toComplex y - GaussianInt.toComplex (x / y)) < 1


theorem le_castSucc_pred_iff {a b : Fin (n + 1)} (ha : a ≠ 0) :
    b ≤ castSucc (a.pred ha) ↔ b < a


/-- Analogue of `iSup_prod` for sets. -/
lemma iUnion_prod' (f : β × γ → Set α) : ⋃ x : β × γ, f x = ⋃ (i : β) (j : γ), f (i, j)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : β × γ → Set α)


theorem forall_zipWith {f : α → β → γ} {p : γ → Prop} :
    ∀ {l₁ : List α} {l₂ : List β}, length l₁ = length l₂ →
      (Forall p (zipWith f l₁ l₂) ↔ Forall₂ (fun x y => p (f x y)) l₁ l₂)

{α : Type u}
{β : Type u_1}
{γ : Type u_2}
{f : α → β → γ}
{p : γ → Prop}
{l₁ : List α}
{l₂ : List β}

l₁.length = l₂.length → (List.Forall p (List.zipWith f l₁ l₂) ↔ List.Forall₂ (fun x y => p (f x y)) l₁ l₂)


/-- The **Banach-Alaoglu theorem**: the polar set of a neighborhood `s` of the origin in a
normed space `E` is a compact subset of `WeakDual 𝕜 E`. -/
theorem isCompact_polar [ProperSpace 𝕜] {s : Set E} (s_nhd : s ∈ 𝓝 (0 : E)) :
    IsCompact (polar 𝕜 s)

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
[ProperSpace 𝕜]
{s : Set E}
(s_nhd : s ∈ 𝓝 0)


@[to_additive]
lemma _root_.Equiv.prod_comp (e : ι ≃ κ) (g : κ → α) : ∏ i, g (e i) = ∏ i, g i

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[Fintype ι]
[Fintype κ]
[AddCommMonoid α]
(e : ι ≃ κ)
(g : κ → α)


lemma eventually_b_le_r : ∀ᶠ (n : ℕ) in atTop, ∀ i, (b i : ℝ) * n - (n / log n ^ 2) ≤ r i n

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(R : AkraBazziRecurrence T g a b r)

∀ᶠ (n : ℕ) in Filter.atTop, ∀ (i : α), b i * ↑n - ↑n / Real.log ↑n ^ 2 ≤ ↑(r i n)


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

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

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


/-- In a Dedekind domain, the (nonzero) prime elements of the monoid with zero `Ideal A`
are exactly the prime ideals. -/
theorem Ideal.prime_iff_isPrime {P : Ideal A} (hP : P ≠ ⊥) : Prime P ↔ IsPrime P

{A : Type u_2}
[CommRing A]
[IsDedekindDomain A]
{P : Ideal A}
(hP : P ≠ ⊥)


@[simp]
theorem image.map_comp [HasImageMap (sq ≫ sq')] :
    image.map (sq ≫ sq') = image.map sq ≫ image.map sq'

[CategoryTheory.Limits.HasImageMap (sq ≫ sq')]

CategoryTheory.Limits.image.map (sq ≫ sq') = CategoryTheory.Limits.image.map sq ≫ CategoryTheory.Limits.image.map sq'


/-- The abscissa of (absolute) convergence of the constant sequence `1` is `1`. -/
lemma LSeries.abscissaOfAbsConv_one : abscissaOfAbsConv 1 = 1


theorem cos_periodic : Function.Periodic cos (2 * π)

Function.Periodic Complex.cos (2 * ↑Real.pi)


/-- Non-unital algebra homomorphisms from `A` into a unital `R`-algebra `C` lift uniquely to
`Unitization R A →ₐ[R] C`. This is the universal property of the unitization. -/
@[simps! apply symm_apply apply_apply]
def lift : (A →ₙₐ[R] C) ≃ (Unitization R A →ₐ[R] C)

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
{C : Type u_5}
[Semiring C]
[Algebra R C]
(φ : A →ₙₐ[R] C)
(x : Unitization R A)

(Unitization.lift φ) x = (algebraMap R C) x.fst + φ x.snd


theorem fromBlocks_conjTranspose [Star α] (A : Matrix n l α) (B : Matrix n m α) (C : Matrix o l α)
    (D : Matrix o m α) : (fromBlocks A B C D)ᴴ = fromBlocks Aᴴ Cᴴ Bᴴ Dᴴ

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

(Matrix.fromBlocks A B C D)ᴴ = Matrix.fromBlocks Aᴴ Cᴴ Bᴴ Dᴴ


/-- Given an orthonormal set `v` of vectors in `E`, there exists a maximal orthonormal set
containing it. -/
theorem exists_maximal_orthonormal {s : Set E} (hs : Orthonormal 𝕜 (Subtype.val : s → E)) :
    ∃ w ⊇ s, Orthonormal 𝕜 (Subtype.val : w → E) ∧
      ∀ u ⊇ w, Orthonormal 𝕜 (Subtype.val : u → E) → u = w

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{s : Set E}
(hs : Orthonormal 𝕜 Subtype.val)

∃ w ⊇ s, Orthonormal 𝕜 Subtype.val ∧ ∀ u ⊇ w, Orthonormal 𝕜 Subtype.val → u = w


theorem topologicalClosure_toSubalgebra_comm (s : StarSubalgebra R A) :
    s.topologicalClosure.toSubalgebra = s.toSubalgebra.topologicalClosure

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[StarRing R]
[TopologicalSpace A]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
[TopologicalSemiring A]
[ContinuousStar A]
(s : StarSubalgebra R A)


@[simp]
theorem biUnion_preimage_singleton (f : α → β) (s : Set β) : ⋃ y ∈ s, f ⁻¹' {y} = f ⁻¹' s

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


/-- The Schnirelmann density is increasing with the set. -/
lemma schnirelmannDensity_le_of_subset {B : Set ℕ} [DecidablePred (· ∈ B)] (h : A ⊆ B) :
    schnirelmannDensity A ≤ schnirelmannDensity B

{A : Set ℕ}
[DecidablePred fun x => x ∈ A]
{B : Set ℕ}
[DecidablePred fun x => x ∈ B]
(h : A ⊆ B)


/-- A lift of a monotone degree one map `S¹ → S¹`. -/
structure CircleDeg1Lift extends ℝ →o ℝ : Type where
  map_add_one' : ∀ x, toFun (x + 1) = toFun x + 1


theorem ordConnected_setOf_closedBall_subset (x : α) (s : Set α) :
    OrdConnected { r | closedBall x r ⊆ s }

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

{r | EMetric.closedBall x r ⊆ s}.OrdConnected


/-- The natural equivalence between linear maps from `M` to `N`
and `1`-multilinear alternating maps from `M` to `N`. -/
@[simps!]
def ofSubsingleton [Subsingleton ι] (i : ι) : (M →ₗ[R] N) ≃ (M [⋀^ι]→ₗ[R] N)

(R : Type u_1)
[Semiring R]
(M : Type u_2)
[AddCommMonoid M]
[Module R M]
(N : Type u_3)
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
[Subsingleton ι]
(i : ι)
(f : M →ₗ[R] N)
(x : ι → M)

((AlternatingMap.ofSubsingleton R M N i) f) x = f (x i)


@[simp]
theorem psub_zero {m : ℕ} : psub m 0 = some m


protected theorem dichotomy (p : ℝ≥0∞) [Fact (1 ≤ p)] : p = ∞ ∨ 1 ≤ p.toReal


theorem IsSuffix.length_le (h : l₁ <:+ l₂) : l₁.length ≤ l₂.length

∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <:+ l₂ → l₁.length ≤ l₂.length


theorem isConj_iff_cycleType_eq {σ τ : Perm α} : IsConj σ τ ↔ σ.cycleType = τ.cycleType

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{σ τ : Equiv.Perm α}


@[simp]
theorem eventually_smallSets_forall {p : α → Prop} :
    (∀ᶠ s in l.smallSets, ∀ x ∈ s, p x) ↔ ∀ᶠ x in l, p x

{α : Type u_1}
{l : Filter α}
{p : α → Prop}

(∀ᶠ (s : Set α) in l.smallSets, ∀ x ∈ s, p x) ↔ ∀ᶠ (x : α) in l, p x


@[simp]
theorem eval_lsingle (r : R) (i : ℕ) (m : M) : eval r (lsingle R i m) = r ^ i • m

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(r : R)
(i : ℕ)
(m : M)

(PolynomialModule.eval r) ((PolynomialModule.lsingle R i) m) = r ^ i • m


/-- For any infinite place `w'`, the regulator is equal to the absolute value of the determinant
of the matrix `(mult w * log w (fundSystem K i)))_i, {w ≠ w'}`. -/
theorem regulator_eq_det (w' : InfinitePlace K) (e : {w // w ≠ w'} ≃ Fin (rank K)) :
    regulator K =
      |(Matrix.of fun i w : {w // w ≠ w'} ↦ (mult w.val : ℝ) *
        Real.log (w.val (fundSystem K (e i) : K))).det|

(e : { w // w ≠ w' } ≃ Fin (NumberField.Units.rank K))

NumberField.Units.regulator K =
  |(Matrix.of fun i w => ↑(↑w).mult * Real.log (↑w ((algebraMap (𝓞 K) K) ↑(NumberField.Units.fundSystem K (e i))))).det|


theorem hasBasis_cocompact : (cocompact X).HasBasis IsCompact compl

(Filter.cocompact X).HasBasis IsCompact compl


/-- The canonical isomorphism `Triangle.shiftFunctor C 0 ≅ 𝟭 (Triangle C)`. -/
@[simps!]
noncomputable def Triangle.shiftFunctorZero : Triangle.shiftFunctor C 0 ≅ 𝟭 _

(X : CategoryTheory.Pretriangulated.Triangle C)

((CategoryTheory.Pretriangulated.Triangle.shiftFunctorZero C).hom.app X).hom₃ =
  (CategoryTheory.shiftFunctorZero C ℤ).hom.app X.obj₃


/-- The categories of cones over `F` and `G` are equivalent if `F` and `G` are naturally isomorphic
(possibly after changing the indexing category by an equivalence).
-/
@[simps! functor inverse unitIso counitIso]
def equivalenceOfReindexing {G : K ⥤ C} (e : K ≌ J) (α : e.functor ⋙ F ≅ G) : Cone F ≌ Cone G

{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}
{G : K ⥤ C}
(e : K ≌ J)
(α : e.functor ⋙ F ≅ G)

(CategoryTheory.Limits.Cones.equivalenceOfReindexing e α).inverse =
  CategoryTheory.Limits.Cones.postcompose α.inv ⋙
    CategoryTheory.Limits.Cones.whiskering e.inverse ⋙ CategoryTheory.Limits.Cones.postcompose (e.invFunIdAssoc F).hom


theorem mem_map_of_mem (f : M →[L] N) {S : L.Substructure M} {x : M} (hx : x ∈ S) : f x ∈ S.map f

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
(f : L.Hom M N)
{S : L.Substructure M}
{x : M}
(hx : x ∈ S)

f x ∈ FirstOrder.Language.Substructure.map f S


@[to_additive]
theorem leftInverse_inv : LeftInverse (fun a : G ↦ a⁻¹) fun a ↦ a⁻¹

Function.LeftInverse (fun a => -a) fun a => -a


theorem vsub_self_mono (h : s ⊆ t) : s -ᵥ s ⊆ t -ᵥ t

{α : Type u_2}
{β : Type u_3}
[VSub α β]
{s t : Set β}
(h : s ⊆ t)


/-- The functor `w.CostructuredArrowDownwards g ⥤ w.CostructuredArrowDownwards g'` induced
by a morphism `γ` such that `R.map γ ≫ g = g'`. -/
@[simps]
def costructuredArrowDownwardsPrecomp
    {X₂ X₂' : C₂} {X₃ : C₃} (g : R.obj X₂ ⟶ B.obj X₃) (g' : R.obj X₂' ⟶ B.obj X₃)
    (γ : X₂' ⟶ X₂) (hγ : R.map γ ≫ g = g') :
    w.CostructuredArrowDownwards g ⥤ w.CostructuredArrowDownwards g'

(hγ : CategoryTheory.CategoryStruct.comp (R.map γ) g = g')

(w.costructuredArrowDownwardsPrecomp g g' γ hγ).obj A =
  CategoryTheory.TwoSquare.CostructuredArrowDownwards.mk w g' A.left.right
    (CategoryTheory.CategoryStruct.comp γ A.left.hom) A.hom.right ⋯


@[simp]
theorem commute_lmul_rmul (a : A) : Commute (L a) (R a)

{A : Type u_1}
[NonUnitalNonAssocRing A]
[IsJordan A]
(a : A)


@[simp, norm_cast]
theorem coe_lt_coe : (a : WithTop α) < b ↔ a < b


@[simp, norm_cast]
theorem cast_bit1 [One α] [Add α] (n : PosNum) : (n.bit1 : α) = ((n : α) + n) + 1

{α : Type u_1}
[One α]
[Add α]
(n : PosNum)


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

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

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


theorem HasDerivAt.clm_apply (hc : HasDerivAt c c' x) (hu : HasDerivAt u u' x) :
    HasDerivAt (fun y => (c y) (u y)) (c' (u x) + c x u') x

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

HasDerivAt (fun y => (c y) (u y)) (c' (u x) + (c x) u') x


/-- A graded version of `Ring`. -/
class GRing [AddMonoid ι] [∀ i, AddCommGroup (A i)] extends GSemiring A where
  /-- The canonical map from ℤ to the zeroth component of a graded ring. -/
  intCast : ℤ → A 0
  /-- The canonical map from ℤ to a graded ring extends the canonical map from ℕ to the underlying
  graded semiring. -/
  intCast_ofNat : ∀ n : ℕ, intCast n = natCast n
  /-- On negative integers, the canonical map from ℤ to a graded ring is the negative extension of
  the canonical map from ℕ to the underlying graded semiring. -/
  -- Porting note: -(n+1) -> Int.negSucc
  intCast_negSucc_ofNat : ∀ n : ℕ, intCast (Int.negSucc n) = -natCast (n + 1 : ℕ)

{ι : Type u_1}
{A : ι → Type u_2}
[AddMonoid ι]
[(i : ι) → AddCommGroup (A i)]
[self : DirectSum.GRing A]
(n : ℕ)

DirectSum.GRing.intCast ↑n = DirectSum.GSemiring.natCast n


theorem iSup_add_iSup_of_monotone {ι : Type*} [Preorder ι] [IsDirected ι (· ≤ ·)]
    {f g : ι → ℝ≥0∞} (hf : Monotone f) (hg : Monotone g) : iSup f + iSup g = ⨆ a, f a + g a

{ι : Type u_4}
[Preorder ι]
[IsDirected ι fun x x_1 => x ≤ x_1]
{f g : ι → ℝ≥0∞}
(hf : Monotone f)
(hg : Monotone g)


@[simp]
theorem to_affine_map_contLinear (f : V →L[R] W) : f.toContinuousAffineMap.contLinear = f

{R : Type u_2}
{V : Type u_3}
{W : Type u_4}
[NormedAddCommGroup V]
[NormedAddCommGroup W]
[NormedField R]
[NormedSpace R V]
[NormedSpace R W]
(f : V →L[R] W)


/-- A multiplicative isomorphism of monoids sends `1` to `1` (and is hence a monoid isomorphism). -/
@[to_additive
  "An additive isomorphism of additive monoids sends `0` to `0`
  (and is hence an additive monoid isomorphism)."]
protected theorem map_one (h : M ≃* N) : h 1 = 1

{M : Type u_6}
{N : Type u_7}
[MulOneClass M]
[MulOneClass N]
(h : M ≃* N)


@[simp]
theorem eraseNone_empty : eraseNone (∅ : Finset (Option α)) = ∅


@[to_additive]
theorem preimage_smul_inv (a : α) (t : Set β) : (fun x ↦ a⁻¹ • x) ⁻¹' t = a • t

{α : Type u_2}
{β : Type u_3}
[AddGroup α]
[AddAction α β]
(a : α)
(t : Set β)


theorem _root_.IsFractional.sup {I J : Submodule R P} :
    IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{I J : Submodule R P}


@[to_additive (attr := simp)]
theorem principal_one : 𝓟 1 = (1 : Filter α)


/-- A weight of a Lie module, bundled as a linear map. -/
@[simps]
def toLinear : L →ₗ[R] R

(R : Type u_1)
(L : Type u_2)
(M : Type u_3)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieAlgebra.IsNilpotent R L]
[LieModule.LinearWeights R L M]
(χ : LieModule.Weight R L M)
(a : L)

(LieModule.Weight.toLinear R L M χ) a = χ a


theorem le_rpow_inv_iff {x y : ℝ≥0} {z : ℝ} (hz : 0 < z) : x ≤ y ^ z⁻¹ ↔ x ^ z ≤ y


theorem sInf_image2_eq_sSup_sSup (h₁ : ∀ b, GaloisConnection (toDual ∘ l₁ b) (swap u b ∘ ofDual))
    (h₂ : ∀ a, GaloisConnection (toDual ∘ l₂ a) (u a ∘ ofDual)) :
    sInf (image2 u s t) = u (sSup s) (sSup t)

{u : α → β → γ}

{l₁ : β → γ → α}

{l₂ : α → γ → β}

(h₁ : ∀ (b : β), GaloisConnection (⇑OrderDual.toDual ∘ l₁ b) (Function.swap u b ∘ ⇑OrderDual.ofDual))

(h₂ : ∀ (a : α), GaloisConnection (⇑OrderDual.toDual ∘ l₂ a) (u a ∘ ⇑OrderDual.ofDual))

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


protected theorem deriv.star : deriv (fun y => star (f y)) x = star (deriv f x)

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


lemma threeAPFree_sphere {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [StrictConvexSpace ℝ E] (x : E) (r : ℝ) : ThreeAPFree (sphere x r)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[StrictConvexSpace ℝ E]
(x : E)
(r : ℝ)


@[simp]
lemma tail_cons {t u v} (p : G.Walk u v) (h : G.Adj t u) :
    (p.cons h).tail not_nil_cons = p

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


/-- In a locally compact space, for every containment `K ⊆ U` of a compact set `K` in an open
  set `U`, there is a compact neighborhood `L` such that `K ⊆ L ⊆ U`: equivalently, there is a
  compact `L` such that `K ⊆ interior L` and `L ⊆ U`.
  See also `exists_compact_closed_between`, in which one guarantees additionally that `L` is closed
  if the space is regular. -/
theorem exists_compact_between [LocallyCompactSpace X] {K U : Set X} (hK : IsCompact K)
    (hU : IsOpen U) (h_KU : K ⊆ U) : ∃ L, IsCompact L ∧ K ⊆ interior L ∧ L ⊆ U

{X : Type u_1}
[TopologicalSpace X]
[LocallyCompactSpace X]
{K U : Set X}
(hK : IsCompact K)
(hU : IsOpen U)
(h_KU : K ⊆ U)


theorem AddSubmonoid.fg_iff_mul_fg (P : AddSubmonoid N) : P.FG ↔ P.toSubmonoid.FG

{N : Type u_2}
[AddMonoid N]
(P : AddSubmonoid N)


@[to_additive (attr := continuity, fun_prop)]
theorem continuous_finset_prod {f : ι → X → M} (s : Finset ι) :
    (∀ i ∈ s, Continuous (f i)) → Continuous fun a => ∏ i ∈ s, f i a

{ι : Type u_1}
{M : Type u_3}
{X : Type u_5}
[TopologicalSpace X]
[TopologicalSpace M]
[CommMonoid M]
[ContinuousMul M]
{f : ι → X → M}
(s : Finset ι)


theorem ContMDiffAt.fst {f : N → M × M'} {x : N} (hf : ContMDiffAt J (I.prod I') n f x) :
    ContMDiffAt J I n (fun x => (f x).1) 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 : 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'}
{x : N}
(hf : ContMDiffAt J (I.prod I') n f x)


{α : Sort u}
{r : α → α → Prop}
[IsStrictWeakOrder α r]
(a : α)


@[simp]
theorem liftHom_root : liftHom f a hfx (root f) = a

{R : Type u}
{S : Type v}
[CommRing R]
(f : R[X])
[CommRing S]
{a : S}
[Algebra R S]
(hfx : (Polynomial.aeval a) f = 0)

(AdjoinRoot.liftHom f a hfx) (AdjoinRoot.root f) = a


@[simp]
lemma shiftFunctorAdd_hom_app_obj_of_induced (a b : A) (X : C) :
    letI := HasShift.induced F A s i
    (shiftFunctorAdd D a b).hom.app (F.obj X) =
      (i (a + b)).hom.app X ≫
        F.map ((shiftFunctorAdd C a b).hom.app X) ≫
        (i b).inv.app ((shiftFunctor C a).obj X) ≫
        (s b).map ((i a).inv.app X)

(i : (a : A) → F.comp (s a) ≅ (CategoryTheory.shiftFunctor C a).comp F)

[((CategoryTheory.whiskeringLeft C D D).obj F).Full]

[((CategoryTheory.whiskeringLeft C D D).obj F).Faithful]

(CategoryTheory.shiftFunctorAdd D a b).hom.app (F.obj X) =
  CategoryTheory.CategoryStruct.comp ((i (a + b)).hom.app X)
    (CategoryTheory.CategoryStruct.comp (F.map ((CategoryTheory.shiftFunctorAdd C a b).hom.app X))
      (CategoryTheory.CategoryStruct.comp ((i b).inv.app ((CategoryTheory.shiftFunctor C a).obj X))
        ((s b).map ((i a).inv.app X))))


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

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


@[simp 1100]
theorem ofHom_apply {R : Type u} [Ring R] {X Y : Type v} [AddCommGroup X] [Module R X]
    [AddCommGroup Y] [Module R Y] (f : X →ₗ[R] Y) (x : X) : ofHom f x = f x


/-- makes a `NonUnitalRingHom` from the bijective inverse of a `NonUnitalRingHom` -/
@[simps] def NonUnitalRingHom.inverse
    [NonUnitalNonAssocSemiring R] [NonUnitalNonAssocSemiring S]
    (f : R →ₙ+* S) (g : S → R)
    (h₁ : Function.LeftInverse g f) (h₂ : Function.RightInverse g f) : S →ₙ+* R

{R : Type u_4}
{S : Type u_5}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
(f : R →ₙ+* S)
(g : S → R)
(h₁ : Function.LeftInverse g ⇑f)
(h₂ : Function.RightInverse g ⇑f)


/-- Typeclass for expressing that the `0` of a type is less or equal to its `1`. -/
class ZeroLEOneClass (α : Type*) [Zero α] [One α] [LE α] : Prop where
  /-- Zero is less than or equal to one. -/
  zero_le_one : (0 : α) ≤ 1

{α : Type u_2}
[Zero α]
[One α]
[LE α]
[self : ZeroLEOneClass α]


@[simp]
theorem getElem_enumFrom (l : List α) (n) (i : Nat) (h : i < (l.enumFrom n).length) :
    (l.enumFrom n)[i] = (n + i, l[i]'(by simpa [enumFrom_length] using h))

{α : Type u_1}
(l : List α)
(n i : ℕ)
(h : i < (List.enumFrom n l).length)


@[simp, reassoc]
theorem braiding_tensor_left (X Y Z : C) :
    (β_ (X ⊗ Y) Z).hom  =
      (α_ X Y Z).hom ≫ X ◁ (β_ Y Z).hom ≫ (α_ X Z Y).inv ≫
        (β_ X Z).hom ▷ Y ≫ (α_ Z X Y).hom

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


theorem nonempty_iff_univ_nonempty : Nonempty α ↔ (univ : Set α).Nonempty


protected theorem map_prod {ι : Type*} (g : ι → R[X]) (s : Finset ι) :
    (∏ i ∈ s, g i).map f = ∏ i ∈ s, (g i).map f

{R : Type u}
{S : Type v}
[CommSemiring R]
[CommSemiring S]
(f : R →+* S)
{ι : Type u_1}
(g : ι → R[X])
(s : Finset ι)

Polynomial.map f (∏ i ∈ s, g i) = ∏ i ∈ s, Polynomial.map f (g i)


theorem erase_same {i : ι} {f : Π₀ i, β i} : (f.erase i) i = 0

{ι : Type u}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → Zero (β i)]
{i : ι}
{f : Π₀ (i : ι), β i}


@[to_additive]
lemma BddBelow.range_mul {α : Type*} {f g : α → M} (hf : BddBelow (range f))
    (hg : BddBelow (range g)) : BddBelow (range (fun x => f x * g x))

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

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


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

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


theorem ascPochhammer_eval_neg_eq_descPochhammer (r : R) : ∀ (k : ℕ),
    (ascPochhammer R k).eval (-r) = (-1)^k * (descPochhammer R k).eval r

Polynomial.eval (-r) (ascPochhammer R k) = (-1) ^ k * Polynomial.eval r (descPochhammer R k)


theorem pi_congr (h : s₁ = s₂) (h' : ∀ i ∈ s₁, t₁ i = t₂ i) : s₁.pi t₁ = s₂.pi t₂

{ι : Type u_1}
{α : ι → Type u_2}
{s₁ s₂ : Set ι}
{t₁ t₂ : (i : ι) → Set (α i)}
(h : s₁ = s₂)
(h' : ∀ i ∈ s₁, t₁ i = t₂ i)


theorem eventually_atTop_curry [SemilatticeSup α] [SemilatticeSup β] {p : α × β → Prop}
    (hp : ∀ᶠ x : α × β in Filter.atTop, p x) : ∀ᶠ k in atTop, ∀ᶠ l in atTop, p (k, l)

(hp : ∀ᶠ (x : α × β) in Filter.atTop, p x)

∀ᶠ (k : α) in Filter.atTop, ∀ᶠ (l : β) in Filter.atTop, p (k, l)


@[to_additive (attr := simp)]
theorem injective_zpow_iff_not_isOfFinOrder : (Injective fun n : ℤ => x ^ n) ↔ ¬IsOfFinOrder x

(Function.Injective fun n => n • x) ↔ ¬IsOfFinAddOrder x


@[simp]
theorem measure_mul_laverage [IsFiniteMeasure μ] (f : α → ℝ≥0∞) :
    μ univ * ⨍⁻ x, f x ∂μ = ∫⁻ x, f x ∂μ

{α : Type u_1}
{m0 : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[MeasureTheory.IsFiniteMeasure μ]
(f : α → ℝ≥0∞)

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


theorem Sylow.exists_comap_eq_of_ker_isPGroup {H : Type*} [Group H] (P : Sylow p H) {f : H →* G}
    (hf : IsPGroup p f.ker) : ∃ Q : Sylow p G, (Q : Subgroup G).comap f = P

{p : ℕ}
{G : Type u_1}
[Group G]
{H : Type u_2}
[Group H]
(P : Sylow p H)
{f : H →* G}
(hf : IsPGroup p ↥f.ker)


protected theorem nonempty (K : ConvexBody V) : (K : Set V).Nonempty

{V : Type u_1}
[TopologicalSpace V]
[AddCommGroup V]
[Module ℝ V]
(K : ConvexBody V)


/-- If a function is polynomial on a set `s`, so are its successive Fréchet derivative. -/
theorem CPolynomialOn.iteratedFDeriv (h : CPolynomialOn 𝕜 f s) (n : ℕ) :
    CPolynomialOn 𝕜 (iteratedFDeriv 𝕜 n f) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set E}
(h : CPolynomialOn 𝕜 f s)
(n : ℕ)


theorem of_one_div (h : Irrational (1 / x)) : Irrational x


theorem closure_mono {s t : Set F} (H : s ⊆ t) : closure s ⊆ closure t

{F : Type u_1}
[Field F]
{s t : Set F}
(H : s ⊆ t)


@[simp] lemma op_associator (X Y Z : C) :
    (α_ X Y Z).op = (α_ (op X) (op Y) (op Z)).symm

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

(CategoryTheory.MonoidalCategory.associator X Y Z).op =
  (CategoryTheory.MonoidalCategory.associator (Opposite.op X) (Opposite.op Y) (Opposite.op Z)).symm


theorem zpow_of_gcd_eq_one (h : IsPrimitiveRoot ζ k) (i : ℤ) (hi : i.gcd k = 1) :
    IsPrimitiveRoot (ζ ^ i) k

{G : Type u_3}
[DivisionCommMonoid G]
{k : ℕ}
{ζ : G}
(h : IsPrimitiveRoot ζ k)
(i : ℤ)
(hi : i.gcd ↑k = 1)


theorem IsRelPrime.mul_right (H1 : IsRelPrime x y) (H2 : IsRelPrime x z) :
    IsRelPrime x (y * z)

{α : Type u_1}
[CommMonoid α]
{x y z : α}
[DecompositionMonoid α]
(H1 : IsRelPrime x y)
(H2 : IsRelPrime x z)


/-- Vertical composition of strong natural transformations. -/
@[simps!]
def vcomp (η : StrongOplaxNatTrans F G) (θ : StrongOplaxNatTrans G H) : StrongOplaxNatTrans F H

{F G H : CategoryTheory.OplaxFunctor B C}

(η : CategoryTheory.StrongOplaxNatTrans F G)

(θ : CategoryTheory.StrongOplaxNatTrans G H)

∀ {a b : B} (f : a ⟶ b),
  ((η.vcomp θ).naturality f).hom =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator (F.map f) (η.app b) (θ.app b)).inv
      (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (η.naturality f).hom (θ.app b))
        (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator (η.app a) (G.map f) (θ.app b)).hom
          (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft (η.app a) (θ.naturality f).hom)
            (CategoryTheory.Bicategory.associator (η.app a) (θ.app a) (H.map f)).inv)))


/-- One can reformulate smoothness on a set as continuity on this set, and smoothness in any
extended chart in the target. -/
theorem contMDiffOn_iff_target :
    ContMDiffOn I I' n f s ↔
      ContinuousOn f s ∧
        ∀ y : M',
          ContMDiffOn I 𝓘(𝕜, E') n (extChartAt I' y ∘ f) (s ∩ f ⁻¹' (extChartAt I' y).source)

{𝕜 : 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']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
[SmoothManifoldWithCorners I' M']
{f : M → M'}
{s : Set M}
{n : ℕ∞}

ContMDiffOn I I' n f s ↔
  ContinuousOn f s ∧ ∀ (y : M'), ContMDiffOn I 𝓘(𝕜, E') n (↑(extChartAt I' y) ∘ f) (s ∩ f ⁻¹' (extChartAt I' y).source)


@[simp]
theorem totalDegree_X {R} [CommSemiring R] [Nontrivial R] (s : σ) :
    (X s : MvPolynomial σ R).totalDegree = 1

{σ : Type u_1}
{R : Type u_3}
[CommSemiring R]
[Nontrivial R]
(s : σ)


theorem Reaches₀.tail {σ} {f : σ → Option σ} {a b c : σ} (h₁ : Reaches₀ f a b) (h : c ∈ f b) :
    Reaches₀ f a c

{σ : Type u_1}
{f : σ → Option σ}
{a b c : σ}
(h₁ : Turing.Reaches₀ f a b)
(h : c ∈ f b)


theorem equiv_iff :
    ∀ {x y : PSet},
      Equiv x y ↔ (∀ i, ∃ j, Equiv (x.Func i) (y.Func j)) ∧ ∀ j, ∃ i, Equiv (x.Func i) (y.Func j)

x.Equiv y ↔ (∀ (i : x.Type), ∃ j, (x.Func i).Equiv (y.Func j)) ∧ ∀ (j : y.Type), ∃ i, (x.Func i).Equiv (y.Func j)


@[simp]
theorem natSepDegree_C (x : F) : (C x).natSepDegree = 0


@[reassoc (attr := simp)]
theorem imageToKernel_arrow (w : f ≫ g = 0) :
    imageToKernel f g w ≫ (kernelSubobject g).arrow = (imageSubobject f).arrow

imageToKernel f g w ≫ (CategoryTheory.Limits.kernelSubobject g).arrow = (CategoryTheory.Limits.imageSubobject f).arrow


@[simp]
theorem sum_left {ι : Type*} [Countable ι] {μ : ι → Measure α} : sum μ ⟂ₘ ν ↔ ∀ i, μ i ⟂ₘ ν

{α : Type u_1}
{m0 : MeasurableSpace α}
{ν : MeasureTheory.Measure α}
{ι : Type u_2}
[Countable ι]
{μ : ι → MeasureTheory.Measure α}

MeasureTheory.Measure.sum μ ⟂ₘ ν ↔ ∀ (i : ι), μ i ⟂ₘ ν


theorem ack_add_one_sq_lt_ack_add_four (m n : ℕ) : ack m ((n + 1) ^ 2) < ack (m + 4) n


theorem geom_sum_succ' {x : α} {n : ℕ} :
    ∑ i ∈ range (n + 1), x ^ i = x ^ n + ∑ i ∈ range n, x ^ i

{α : Type u}
[Semiring α]
{x : α}
{n : ℕ}

∑ i ∈ Finset.range (n + 1), x ^ i = x ^ n + ∑ i ∈ Finset.range n, x ^ i


@[to_additive Ioi_add_Ici_subset]
theorem Ioi_mul_Ici_subset' (a b : α) : Ioi a * Ici b ⊆ Ioi (a * b)

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

[CovariantClass α α (Function.swap HAdd.hAdd) LT.lt]


@[simp] theorem foldl_nil : [].foldl f b = b

∀ {α : Type u_1} {β : Type u_2} {f : α → β → α} {b : α}, List.foldl f b List.nil = b


/-- The L-series of the arithmetic function `ζ` does not vanish on the right half-plane
`re s > 1`. -/
lemma LSeries_zeta_ne_zero_of_one_lt_re {s : ℂ} (hs : 1 < s.re) : L ↗ζ s ≠ 0

L (fun n => ↑(ArithmeticFunction.zeta n)) s ≠ 0


/-- Embedding `Type` into `Cat` as discrete categories.

This ought to be modelled as a 2-functor!
-/
@[simps]
def typeToCat : Type u ⥤ Cat

CategoryTheory.typeToCat.map f = id (CategoryTheory.Discrete.functor (CategoryTheory.Discrete.mk ∘ f))


theorem norm_add_eq_max_of_ne {q r : ℤ_[p]} : ‖q‖ ≠ ‖r‖ → ‖q + r‖ = max ‖q‖ ‖r‖

{p : ℕ}
[Fact (Nat.Prime p)]
{q r : ℤ_[p]}

‖q‖ ≠ ‖r‖ → ‖q + r‖ = max ‖q‖ ‖r‖


/-- Angle at center of a circle equals twice angle at circumference, oriented angle version. -/
theorem oangle_center_eq_two_zsmul_oangle {s : Sphere P} {p₁ p₂ p₃ : P} (hp₁ : p₁ ∈ s)
    (hp₂ : p₂ ∈ s) (hp₃ : p₃ ∈ s) (hp₂p₁ : p₂ ≠ p₁) (hp₂p₃ : p₂ ≠ p₃) :
    ∡ p₁ s.center p₃ = (2 : ℤ) • ∡ p₁ p₂ p₃

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


@[simp]
theorem toBasicOpen_to_map (s f : R) :
    toBasicOpen R s (algebraMap R (Localization.Away s) f) =
      const R f 1 (PrimeSpectrum.basicOpen s) fun _ _ => Submonoid.one_mem _

(AlgebraicGeometry.StructureSheaf.toBasicOpen R s) ((algebraMap R (Localization.Away s)) f) =
  AlgebraicGeometry.StructureSheaf.const R f 1 (PrimeSpectrum.basicOpen s) ⋯


theorem tendsto_approx_atTop (c : CU P) (x : X) :
    Tendsto (fun n => c.approx n x) atTop (𝓝 <| c.lim x)

{X : Type u_1}
[TopologicalSpace X]
{P : Set X → Prop}
(c : Urysohns.CU P)
(x : X)

Filter.Tendsto (fun n => Urysohns.CU.approx n c x) Filter.atTop (𝓝 (c.lim x))


protected theorem le_tsub_iff_le_tsub (ha : AddLECancellable a) (hc : AddLECancellable c)
    (h₁ : a ≤ b) (h₂ : c ≤ b) : a ≤ b - c ↔ c ≤ b - a

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


theorem range_coe' : range ofNNReal = Iio ∞


@[to_additive]
theorem cauchySeq_finset_iff_prod_vanishing :
    (CauchySeq fun s : Finset β ↦ ∏ b ∈ s, f b) ↔
      ∀ e ∈ 𝓝 (1 : α), ∃ s : Finset β, ∀ t, Disjoint t s → (∏ b ∈ t, f b) ∈ e

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[UniformSpace α]
[UniformAddGroup α]
{f : β → α}

(CauchySeq fun s => ∑ b ∈ s, f b) ↔ ∀ e ∈ 𝓝 0, ∃ s, ∀ (t : Finset β), Disjoint t s → ∑ b ∈ t, f b ∈ e


/-- If `f` is antitone both on `s` and `t`, with `s` to the left of `t` and the center
point belonging to both `s` and `t`, then `f` is antitone on `s ∪ t` -/
protected theorem AntitoneOn.union_right {s t : Set α} {c : α} (h₁ : AntitoneOn f s)
    (h₂ : AntitoneOn f t) (hs : IsGreatest s c) (ht : IsLeast t c) : AntitoneOn f (s ∪ t)

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[Preorder β]
{f : α → β}
{s t : Set α}
{c : α}
(h₁ : AntitoneOn f s)
(h₂ : AntitoneOn f t)
(hs : IsGreatest s c)
(ht : IsLeast t c)


theorem Nat.rel_of_forall_rel_succ_of_le_of_lt (r : β → β → Prop) [IsTrans β r] {f : ℕ → β} {a : ℕ}
    (h : ∀ n, a ≤ n → r (f n) (f (n + 1))) ⦃b c : ℕ⦄ (hab : a ≤ b) (hbc : b < c) :
    r (f b) (f c)


@[simp]
theorem trop_nsmul [AddMonoid R] (x : R) (n : ℕ) : trop (n • x) = trop x ^ n

{R : Type u}
[AddMonoid R]
(x : R)
(n : ℕ)

Tropical.trop (n • x) = Tropical.trop x ^ n


theorem congr_congr (e : M' ≃ₗ[R] M'') (f : M ≃ₗ[R] M') (B : BilinForm R M) :
    congr e (congr f B) = congr (f.trans e) B

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{M' : Type u_7}
{M'' : Type u_8}
[AddCommMonoid M']
[AddCommMonoid M'']
[Module R M']
[Module R M'']
(e : M' ≃ₗ[R] M'')
(f : M ≃ₗ[R] M')
(B : LinearMap.BilinForm R M)

(LinearMap.BilinForm.congr e) ((LinearMap.BilinForm.congr f) B) = (LinearMap.BilinForm.congr (f ≪≫ₗ e)) B


lemma mul_eq_one_iff_eq_one_or_neg_one : u * v = 1 ↔ u = 1 ∧ v = 1 ∨ u = -1 ∧ v = -1


@[simp]
theorem ofIsComplProd_apply {p q : Submodule R₁ E} (h : IsCompl p q)
    (φ : (p →ₗ[R₁] F) × (q →ₗ[R₁] F)) : ofIsComplProd h φ = ofIsCompl h φ.1 φ.2

{E : Type u_2}
[AddCommGroup E]
{F : Type u_3}
[AddCommGroup F]
{R₁ : Type u_7}
[CommRing R₁]
[Module R₁ E]
[Module R₁ F]
{p q : Submodule R₁ E}
(h : IsCompl p q)
(φ : (↥p →ₗ[R₁] F) × (↥q →ₗ[R₁] F))

(LinearMap.ofIsComplProd h) φ = LinearMap.ofIsCompl h φ.1 φ.2


theorem iInf_subtype : ∀ {p : ι → Prop} {f : Subtype p → α}, iInf f = ⨅ (i) (h : p i), f ⟨i, h⟩

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


/-- Given a functor `F : J ⥤ K ⥤ C`, with all needed limits,
we can construct a diagram consisting of the limit cone over each functor `F.obj j`,
and the universal cone morphisms between these.
-/
@[simps]
noncomputable def DiagramOfCones.mkOfHasLimits : DiagramOfCones F

(CategoryTheory.Limits.DiagramOfCones.mkOfHasLimits F).obj j = CategoryTheory.Limits.limit.cone (F.obj j)


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

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[SetLike S R]
[hSR : SubsemiringClass S R]
(s : S)

⇑(SubsemiringClass.subtype s) = Subtype.val


theorem norm_abs_sub_abs (a b : α) : ‖|a| - |b|‖ ≤ ‖a - b‖

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


theorem nfp_le {a b} : (∀ n, f^[n] a ≤ b) → nfp f a ≤ b

{f : Ordinal.{u} → Ordinal.{u}}
{a b : Ordinal.{u}}

(∀ (n : ℕ), f^[n] a ≤ b) → Ordinal.nfp f a ≤ b


/-- A manifold decomposes into interior and boundary. -/
lemma interior_union_boundary_eq_univ : (I.interior M) ∪ (I.boundary M) = (univ : Set M)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]


lemma even_pow' {n : ℕ} (h : n ≠ 0) : Even (m ^ n) ↔ Even m


theorem comap_injective {f : F} (hf : range f = ⊤) : Injective (comap f)

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_6}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
{F : Type u_11}
[FunLike F M M₂]
[SemilinearMapClass F τ₁₂ M M₂]
[RingHomSurjective τ₁₂]
{f : F}
(hf : LinearMap.range f = ⊤)


theorem gcd_eq_gcd_image [DecidableEq α] : s.gcd f = (s.image f).gcd id

{α : Type u_2}
{β : Type u_3}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{s : Finset β}
{f : β → α}
[DecidableEq α]


@[to_additive]
theorem card_quotient_dvd_card (s : Subgroup α) : Nat.card (α ⧸ s) ∣ Nat.card α

{α : Type u_1}
[Group α]
(s : Subgroup α)


@[to_additive exists_idempotent_ultrafilter_le_FS]
theorem exists_idempotent_ultrafilter_le_FP {M} [Semigroup M] (a : Stream' M) :
    ∃ U : Ultrafilter M, U * U = U ∧ ∀ᶠ m in U, m ∈ FP a

{M : Type u_1}
[AddSemigroup M]
(a : Stream' M)

∃ U, U + U = U ∧ ∀ᶠ (m : M) in ↑U, m ∈ Hindman.FS a


@[simp]
theorem comp_factorThru {J X Y : C} [Injective J] (g : X ⟶ J) (f : X ⟶ Y) [Mono f] :
    f ≫ factorThru g f = g

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

f ≫ CategoryTheory.Injective.factorThru g f = g


@[reassoc]
theorem cokernel_map_comp_cokernelComparison {X' Y' : C} [HasCokernel f] [HasCokernel (G.map f)]
    (g : X' ⟶ Y') [HasCokernel g] [HasCokernel (G.map g)] (p : X ⟶ X') (q : Y ⟶ Y')
    (hpq : f ≫ q = p ≫ g) :
    cokernel.map (G.map f) (G.map g) (G.map p) (G.map q) (by rw [← G.map_comp, hpq, G.map_comp]) ≫
        cokernelComparison _ G =
      cokernelComparison _ G ≫ G.map (cokernel.map f g p q hpq)

CategoryTheory.Limits.cokernel.map (G.map f) (G.map g) (G.map p) (G.map q) ⋯ ≫
    CategoryTheory.Limits.cokernelComparison g G =
  CategoryTheory.Limits.cokernelComparison f G ≫ G.map (CategoryTheory.Limits.cokernel.map f g p q hpq)


theorem smul_ball_zero {p : Seminorm 𝕜 E} {k : 𝕜} {r : ℝ} (hk : k ≠ 0) :
    k • p.ball 0 r = p.ball 0 (‖k‖ * r)

{𝕜 : Type u_3}
{E : Type u_7}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{p : Seminorm 𝕜 E}
{k : 𝕜}
{r : ℝ}
(hk : k ≠ 0)


theorem smul_im (r : R) (z : ℂ) : (r • z).im = r • z.im

{R : Type u_1}
[SMul R ℝ]
(r : R)
(z : ℂ)


/-- If `f` is antitone both on `(-∞, a]` and `[a, ∞)`, then it is antitone on the whole line. -/
protected theorem AntitoneOn.Iic_union_Ici (h₁ : AntitoneOn f (Iic a)) (h₂ : AntitoneOn f (Ici a)) :
    Antitone f

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[Preorder β]
{a : α}
{f : α → β}
(h₁ : AntitoneOn f (Set.Iic a))
(h₂ : AntitoneOn f (Set.Ici a))


@[simp, norm_cast]
protected theorem coe_mul (r₁ r₂ : ℝ≥0) : ((r₁ * r₂ : ℝ≥0) : ℝ) = r₁ * r₂


@[to_additive (attr := simp)]
theorem smul_set_univ : a • (univ : Set β) = univ

{α : Type u_2}
{β : Type u_3}
[Group α]
[MulAction α β]
{a : α}


theorem one_pos' [NeZero n] : (0 : Fin (n + 1)) < 1


theorem gcd_one_left' [GCDMonoid α] (a : α) : Associated (gcd 1 a) 1

{α : Type u_1}
[CancelCommMonoidWithZero α]
[GCDMonoid α]
(a : α)


theorem Nat.frequently_atTop_iff_infinite {p : ℕ → Prop} :
    (∃ᶠ n in atTop, p n) ↔ Set.Infinite { n | p n }

(∃ᶠ (n : ℕ) in Filter.atTop, p n) ↔ {n | p n}.Infinite


theorem eq_symm_comp {α β γ} (e : α ≃ β) (f : γ → α) (g : γ → β) : f = e.symm ∘ g ↔ e ∘ f = g

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
(e : α ≃ β)
(f : γ → α)
(g : γ → β)


@[simp]
theorem top_toSubring {R A : Type*} [CommRing R] [Ring A] [Algebra R A] :
    (⊤ : Subalgebra R A).toSubring = ⊤

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[Ring A]
[Algebra R A]


@[simp]
theorem coe_prodMap : ⇑(prodMap f g) = Prod.map f g

{R : Type u_3}
{R' : Type u_4}
{S : Type u_5}
{S' : Type u_6}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
[NonUnitalNonAssocSemiring R']
[NonUnitalNonAssocSemiring S']
(f : R →ₙ+* R')
(g : S →ₙ+* S')


theorem iUnion_pi_of_monotone {ι ι' : Type*} [LinearOrder ι'] [Nonempty ι'] {α : ι → Type*}
    {I : Set ι} {s : ∀ i, ι' → Set (α i)} (hI : I.Finite) (hs : ∀ i ∈ I, Monotone (s i)) :
    ⋃ j : ι', I.pi (fun i => s i j) = I.pi fun i => ⋃ j, s i j

{ι : Type u_1}
{ι' : Type u_2}
[LinearOrder ι']
[Nonempty ι']
{α : ι → Type u_3}
{I : Set ι}
{s : (i : ι) → ι' → Set (α i)}
(hI : I.Finite)
(hs : ∀ i ∈ I, Monotone (s i))

(⋃ j, I.pi fun i => s i j) = I.pi fun i => ⋃ j, s i j


@[simp, norm_cast]
theorem ofReal_cos (x : ℝ) : (Real.cos x : ℂ) = cos x


@[simp]
theorem smul_eval (x) (p : MvPolynomial σ R) (s) : eval x (s • p) = s * eval x p

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(x : σ → R)
(p : MvPolynomial σ R)
(s : R)

(MvPolynomial.eval x) (s • p) = s * (MvPolynomial.eval x) p


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


@[simp]
theorem comp_assoc (f : BotHom γ δ) (g : BotHom β γ) (h : BotHom α β) :
    (f.comp g).comp h = f.comp (g.comp h)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
{δ : Type u_5}
[Bot α]
[Bot β]
[Bot γ]
[Bot δ]
(f : BotHom γ δ)
(g : BotHom β γ)
(h : BotHom α β)


@[simp] lemma op_hom_rightUnitor (X : C) : (ρ_ X).hom.op = (ρ_ (op X)).inv

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

(CategoryTheory.MonoidalCategory.rightUnitor X).hom.op =
  (CategoryTheory.MonoidalCategory.rightUnitor (Opposite.op X)).inv


private lemma int_div_nonneg_of_pos_of_nonneg {a b : ℤ} (ha : 0 < a) (hb : 0 ≤ b) : 0 ≤ a / b


@[simp] lemma toMonoidHom_apply (ψ : AddChar A M) (a : Multiplicative A) :
  ψ.toMonoidHom a = ψ (Multiplicative.toAdd a)

{A : Type u_1}
{M : Type u_3}
[AddMonoid A]
[Monoid M]
(ψ : AddChar A M)
(a : Multiplicative A)


theorem Decidable.not_imp_symm [Decidable a] (h : ¬a → b) (hb : ¬b) : a

{a b : Prop}
[Decidable a]
(h : ¬a → b)
(hb : ¬b)


@[to_additive]
theorem prod_set [Monoid α] (v : Vector α n) (i : Fin n) (a : α) :
    (v.set i a).toList.prod = (v.take i).toList.prod * a * (v.drop (i + 1)).toList.prod

{n : ℕ}
{α : Type u_1}
[Monoid α]
(v : Mathlib.Vector α n)
(i : Fin n)
(a : α)

(v.set i a).toList.prod = (Mathlib.Vector.take (↑i) v).toList.prod * a * (Mathlib.Vector.drop (↑i + 1) v).toList.prod


theorem IsCycle.ne_one (h : IsCycle f) : f ≠ 1

{α : Type u_2}
{f : Equiv.Perm α}
(h : f.IsCycle)


/-- The `vectorSpan` of a single point is `⊥`. -/
@[simp]
theorem vectorSpan_singleton (p : P) : vectorSpan k ({p} : Set P) = ⊥

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(p : P)


theorem getElem?_eq_getElem (a : Array α) (i : Nat) (h : i < a.size) : a[i]? = a[i]

{α : Type u_1}
(a : Array α)
(i : Nat)
(h : i < a.size)


theorem ContDiff.arctan (h : ContDiff ℝ n f) : ContDiff ℝ n fun x => arctan (f x)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{n : ℕ∞}
(h : ContDiff ℝ n f)