/-- In a bicategory, we can compose the 1-morphisms `f : a ⟶ b` and `g : b ⟶ c` to obtain
a 1-morphism `f ≫ g : a ⟶ c`. This composition does not need to be strictly associative,
but there is a specified associator, `α_ f g h : (f ≫ g) ≫ h ≅ f ≫ (g ≫ h)`.
There is an identity 1-morphism `𝟙 a : a ⟶ a`, with specified left and right unitor
isomorphisms `λ_ f : 𝟙 a ≫ f ≅ f` and `ρ_ f : f ≫ 𝟙 a ≅ f`.
These associators and unitors satisfy the pentagon and triangle equations.

See https://ncatlab.org/nlab/show/bicategory.
-/
@[nolint checkUnivs]
class Bicategory (B : Type u) extends CategoryStruct.{v} B where
  -- category structure on the collection of 1-morphisms:
  homCategory : ∀ a b : B, Category.{w} (a ⟶ b) := by infer_instance
  -- left whiskering:
  whiskerLeft {a b c : B} (f : a ⟶ b) {g h : b ⟶ c} (η : g ⟶ h) : f ≫ g ⟶ f ≫ h
  -- right whiskering:
  whiskerRight {a b c : B} {f g : a ⟶ b} (η : f ⟶ g) (h : b ⟶ c) : f ≫ h ⟶ g ≫ h
  -- associator:
  associator {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) : (f ≫ g) ≫ h ≅ f ≫ g ≫ h
  -- left unitor:
  leftUnitor {a b : B} (f : a ⟶ b) : 𝟙 a ≫ f ≅ f
  -- right unitor:
  rightUnitor {a b : B} (f : a ⟶ b) : f ≫ 𝟙 b ≅ f
  -- axioms for left whiskering:
  whiskerLeft_id : ∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), whiskerLeft f (𝟙 g) = 𝟙 (f ≫ g) := by
    aesop_cat
  whiskerLeft_comp :
    ∀ {a b c} (f : a ⟶ b) {g h i : b ⟶ c} (η : g ⟶ h) (θ : h ⟶ i),
      whiskerLeft f (η ≫ θ) = whiskerLeft f η ≫ whiskerLeft f θ := by
    aesop_cat
  id_whiskerLeft :
    ∀ {a b} {f g : a ⟶ b} (η : f ⟶ g),
      whiskerLeft (𝟙 a) η = (leftUnitor f).hom ≫ η ≫ (leftUnitor g).inv := by
    aesop_cat
  comp_whiskerLeft :
    ∀ {a b c d} (f : a ⟶ b) (g : b ⟶ c) {h h' : c ⟶ d} (η : h ⟶ h'),
      whiskerLeft (f ≫ g) η =
        (associator f g h).hom ≫ whiskerLeft f (whiskerLeft g η) ≫ (associator f g h').inv := by
    aesop_cat
  -- axioms for right whiskering:
  id_whiskerRight : ∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), whiskerRight (𝟙 f) g = 𝟙 (f ≫ g) := by
    aesop_cat
  comp_whiskerRight :
    ∀ {a b c} {f g h : a ⟶ b} (η : f ⟶ g) (θ : g ⟶ h) (i : b ⟶ c),
      whiskerRight (η ≫ θ) i = whiskerRight η i ≫ whiskerRight θ i := by
    aesop_cat
  whiskerRight_id :
    ∀ {a b} {f g : a ⟶ b} (η : f ⟶ g),
      whiskerRight η (𝟙 b) = (rightUnitor f).hom ≫ η ≫ (rightUnitor g).inv := by
    aesop_cat
  whiskerRight_comp :
    ∀ {a b c d} {f f' : a ⟶ b} (η : f ⟶ f') (g : b ⟶ c) (h : c ⟶ d),
      whiskerRight η (g ≫ h) =
        (associator f g h).inv ≫ whiskerRight (whiskerRight η g) h ≫ (associator f' g h).hom := by
    aesop_cat
  -- associativity of whiskerings:
  whisker_assoc :
    ∀ {a b c d} (f : a ⟶ b) {g g' : b ⟶ c} (η : g ⟶ g') (h : c ⟶ d),
      whiskerRight (whiskerLeft f η) h =
        (associator f g h).hom ≫ whiskerLeft f (whiskerRight η h) ≫ (associator f g' h).inv := by
    aesop_cat
  -- exchange law of left and right whiskerings:
  whisker_exchange :
    ∀ {a b c} {f g : a ⟶ b} {h i : b ⟶ c} (η : f ⟶ g) (θ : h ⟶ i),
      whiskerLeft f θ ≫ whiskerRight η i = whiskerRight η h ≫ whiskerLeft g θ := by
    aesop_cat
  -- pentagon identity:
  pentagon :
    ∀ {a b c d e} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) (i : d ⟶ e),
      whiskerRight (associator f g h).hom i ≫
          (associator f (g ≫ h) i).hom ≫ whiskerLeft f (associator g h i).hom =
        (associator (f ≫ g) h i).hom ≫ (associator f g (h ≫ i)).hom := by
    aesop_cat
  -- triangle identity:
  triangle :
    ∀ {a b c} (f : a ⟶ b) (g : b ⟶ c),
      (associator f (𝟙 b) g).hom ≫ whiskerLeft f (leftUnitor g).hom
      = whiskerRight (rightUnitor f).hom g := by
    aesop_cat

{B : Type u}
[self : CategoryTheory.Bicategory B]
{a b c d e : B}
(f : a ⟶ b)
(g : b ⟶ c)
(h : c ⟶ d)
(i : d ⟶ e)

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.associator f g h).hom i)
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Bicategory.associator f (CategoryTheory.CategoryStruct.comp g h) i).hom
      (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.associator g h i).hom)) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.associator (CategoryTheory.CategoryStruct.comp f g) h i).hom
    (CategoryTheory.Bicategory.associator f g (CategoryTheory.CategoryStruct.comp h i)).hom


private theorem toJordanDecomposition_smul_real_nonneg (s : SignedMeasure α) (r : ℝ)
    (hr : 0 ≤ r) : (r • s).toJordanDecomposition = r • s.toJordanDecomposition

{α : Type u_1}
[MeasurableSpace α]
(s : MeasureTheory.SignedMeasure α)
(r : ℝ)
(hr : 0 ≤ r)


@[to_additive]
theorem op_smul_finset_mul_eq_mul_smul_finset (a : α) (s : Finset α) (t : Finset α) :
    op a • s * t = s * a • t

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

AddOpposite.op a +ᵥ s + t = s + (a +ᵥ t)


/-- If `IsPrimePow (n : ℕ)`, `n ≠ 2` and `Irreducible (cyclotomic n K)` (in particular for
`K = ℚ`), then the norm of `zeta n K L - 1` is `(n : ℕ).minFac`. -/
theorem norm_zeta_sub_one_of_isPrimePow (hn : IsPrimePow (n : ℕ)) [IsCyclotomicExtension {n} K L]
    (hirr : Irreducible (cyclotomic (n : ℕ) K)) (h : n ≠ 2) :
    norm K (zeta n K L - 1) = (n : ℕ).minFac

(hirr : Irreducible (Polynomial.cyclotomic (↑n) K))

(Algebra.norm K) (IsCyclotomicExtension.zeta n K L - 1) = ↑(↑n).minFac


lemma le_truncatedSup : a ≤ truncatedSup s a

{α : Type u_1}
[SemilatticeSup α]
[OrderTop α]
[DecidableRel fun x x_1 => x ≤ x_1]
{s : Finset α}
{a : α}


@[simps]
instance BoolRing.hasForgetToBoolAlg : HasForget₂ BoolRing BoolAlg

CategoryTheory.HasForget₂.forget₂.obj X = BoolAlg.of (AsBoolAlg ↑X)


@[simp]
theorem liftAux.smul (r : R) (x) : liftAux f (r • x) = r • liftAux f x

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

(TensorProduct.liftAux f) (r • x) = r • (TensorProduct.liftAux f) x


lemma BddAbove.range_comp {γ : Type*} [Preorder β] [Preorder γ] {f : α → β} {g : β → γ}
    (hf : BddAbove (range f)) (hg : Monotone g) : BddAbove (range (fun x => g (f x)))

{α : Type u}
{β : Type v}
{γ : Type u_1}
[Preorder β]
[Preorder γ]
{f : α → β}
{g : β → γ}
(hf : BddAbove (Set.range f))
(hg : Monotone g)


theorem Subperm.length_le {l₁ l₂ : List α} : l₁ <+~ l₂ → length l₁ ≤ length l₂


/-- Formula for `Λ₀ 1`, where `Λ₀` is the entire function satisfying
`Λ₀ s = π ^ (-s / 2) Γ(s / 2) ζ(s) + 1 / s + 1 / (1 - s)` away from `s = 0, 1`.

Note that `s = 1` is _not_ a pole of `Λ₀`, so this statement (unlike `riemannZeta_one`) is
a mathematically meaningful statement and is not dependent on Mathlib's particular conventions for
division by zero. -/
lemma _root_.completedRiemannZeta₀_one :
    completedRiemannZeta₀ 1 = (γ - Complex.log (4 * ↑π)) / 2 + 1

completedRiemannZeta₀ 1 = (↑γ - Complex.log (4 * ↑π)) / 2 + 1


@[simp] theorem norm_inl (r : R) : ‖(inl r : tsze R M)‖ = ‖r‖

{R : Type u_3}
{M : Type u_4}
[SeminormedRing R]
[SeminormedAddCommGroup M]
(r : R)


@[simp]
lemma sections_property {M : PresheafOfModules.{v} R} (s : M.sections)
    {X Y : Cᵒᵖ} (f : X ⟶ Y) : M.map f (s.1 X) = s.1 Y

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


lemma exists_set_linearIndependent_of_lt_rank {n : Cardinal} (hn : n < Module.rank R M) :
    ∃ s : Set M, #s = n ∧ LinearIndependent R ((↑) : s → M)

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
{n : Cardinal.{v}}
(hn : n < Module.rank R M)

∃ s, #↑s = n ∧ LinearIndependent (ι := { x // x ∈ s }) R Subtype.val


@[mono]
theorem toAddSubgroup_mono : Monotone (toAddSubgroup : Subring R → AddSubgroup R)


theorem measure_Icc_lt_top (μ : Measure (ι → ℝ)) [IsLocallyFiniteMeasure μ] : μ (Box.Icc I) < ∞


@[to_additive (attr := simp) zero_le]
theorem one_le (a : α) : 1 ≤ a

{α : Type u}
[CanonicallyOrderedAddCommMonoid α]
(a : α)


@[to_additive]
theorem controlled_prod_of_mem_closure {s : Subgroup E} (hg : a ∈ closure (s : Set E)) {b : ℕ → ℝ}
    (b_pos : ∀ n, 0 < b n) :
    ∃ v : ℕ → E,
      Tendsto (fun n => ∏ i ∈ range (n + 1), v i) atTop (𝓝 a) ∧
        (∀ n, v n ∈ s) ∧ ‖v 0 / a‖ < b 0 ∧ ∀ n, 0 < n → ‖v n‖ < b n

{E : Type u_6}
[SeminormedAddCommGroup E]
{a : E}
{s : AddSubgroup E}
(hg : a ∈ closure ↑s)
{b : ℕ → ℝ}
(b_pos : ∀ (n : ℕ), 0 < b n)

∃ v,
  Filter.Tendsto (fun n => ∑ i ∈ Finset.range (n + 1), v i) Filter.atTop (𝓝 a) ∧
    (∀ (n : ℕ), v n ∈ s) ∧ ‖v 0 - a‖ < b 0 ∧ ∀ (n : ℕ), 0 < n → ‖v n‖ < b n


lemma IndepSet_iff_Indep (s t : Set Ω) (μ : Measure Ω) :
    IndepSet s t μ ↔ Indep (generateFrom {s}) (generateFrom {t}) μ

∀ {x : MeasurableSpace Ω} (s t : Set Ω) (μ : MeasureTheory.Measure Ω),
  ProbabilityTheory.IndepSet s t μ ↔
    ProbabilityTheory.Indep (MeasurableSpace.generateFrom {s}) (MeasurableSpace.generateFrom {t}) μ


/-- `rev` commutes with `succAbove`. -/
lemma rev_succAbove (p : Fin (n + 1)) (i : Fin n) :
    rev (succAbove p i) = succAbove (rev p) (rev i)

(p.succAbove i).rev = p.rev.succAbove i.rev


theorem d_of_eq (h : P.toPoly = Q.toPoly) : P.d = Q.d

{R : Type u_1}
{P Q : Cubic R}
[Semiring R]
(h : P.toPoly = Q.toPoly)


theorem subset_right_C (c : CU P) : c.C ⊆ c.right.C

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


theorem isUnit_norm [CharZero K] {x : 𝓞 F} : IsUnit (norm K x) ↔ IsUnit x

(K : Type u_2)
[Field K]
{F : Type u_3}
[Field F]
[Algebra K F]
[Algebra.IsSeparable K F]
[FiniteDimensional K F]
[CharZero K]
{x : 𝓞 F}

IsUnit ((RingOfIntegers.norm K) x) ↔ IsUnit x


protected theorem add_left_cancel {a b c : Int} (h : a + b = a + c) : b = c


@[simp, norm_cast]
theorem coe_zero : ((0 : MvPolynomial σ R) : MvPowerSeries σ R) = 0

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


theorem map_iSup_comap_of_surjective (K : ι → Ideal S) : (⨆ i, (K i).comap f).map f = iSup K

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)
{ι : Sort u_3}
(hf : Function.Surjective ⇑f)
(K : ι → Ideal S)

Ideal.map f (⨆ i, Ideal.comap f (K i)) = iSup K


private theorem sum_filter_pairs_eq_sum_filter_antidiagonal_powersetCard_sum (k : ℕ)
    (f : Finset σ × σ → MvPolynomial σ R) :
    ∑ t ∈ (pairs σ k).filter fun t ↦ card t.fst < k, f t =
      ∑ a ∈ (antidiagonal k).filter fun a ↦ a.fst < k,
        ∑ A ∈ powersetCard a.fst univ, ∑ j, f (A, j)

(σ : Type u_1)
[Fintype σ]
[DecidableEq σ]
(R : Type u_2)
[CommRing R]
(k : ℕ)
(f : Finset σ × σ → MvPolynomial σ R)

∑ t ∈ Finset.filter (fun t => t.1.card < k) (MvPolynomial.NewtonIdentities.pairs σ k), f t =
  ∑ a ∈ Finset.filter (fun a => a.1 < k) (Finset.antidiagonal k),
    ∑ A ∈ Finset.powersetCard a.1 Finset.univ, ∑ j : σ, f (A, j)


@[simp]
theorem subperm_nil : List.Subperm l [] ↔ l = []


theorem inf_product_left (s : Finset β) (t : Finset γ) (f : β × γ → α) :
    (s ×ˢ t).inf f = s.inf fun i => t.inf fun i' => f ⟨i, i'⟩

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[SemilatticeInf α]
[OrderTop α]
(s : Finset β)
(t : Finset γ)
(f : β × γ → α)

(s ×ˢ t).inf f = s.inf fun i => t.inf fun i' => f (i, i')


@[to_additive]
theorem mul_def (x y : S') : x * y = ⟨x * y, mul_mem x.2 y.2⟩

{M : Type u_1}
{A : Type u_5}
[Add M]
[SetLike A M]
[hA : AddMemClass A M]
(S' : A)
(x y : ↥S')


/-- If a function `f : α → β` is continuous on a nonempty interval `s`, its restriction to `s`
tends to `Filter.atTop : Filter β` along `Filter.atBot : Filter ↥s` and tends to
`Filter.atBot : Filter β` along `Filter.atTop : Filter ↥s`, then the restriction of `f` to `s` is
surjective. We formulate the conclusion as `Function.surjOn f s Set.univ`. -/
theorem ContinuousOn.surjOn_of_tendsto' {f : α → δ} {s : Set α} [OrdConnected s] (hs : s.Nonempty)
    (hf : ContinuousOn f s) (hbot : Tendsto (fun x : s => f x) atBot atTop)
    (htop : Tendsto (fun x : s => f x) atTop atBot) : SurjOn f s univ

(hbot : Filter.Tendsto (fun x => f ↑x) Filter.atBot Filter.atTop)

(htop : Filter.Tendsto (fun x => f ↑x) Filter.atTop Filter.atBot)


/-- If `f : R ≃+* S` is a ring isomorphism and `I : Ideal R`, then `map f.symm I = comap f I`. -/
@[simp]
theorem map_symm (I : Ideal S) (f : R ≃+* S) : I.map f.symm = I.comap f

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(I : Ideal S)
(f : R ≃+* S)


@[to_additive (attr := simp)]
theorem mulIndicator_self_mul_compl_apply (s : Set α) (f : α → M) (a : α) :
    mulIndicator s f a * mulIndicator sᶜ f a = f a

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

s.indicator f a + sᶜ.indicator f a = f a


@[ext]
lemma Hom.ext' (X Y : Algebra T) (f g : X ⟶ Y) (h : f.f = g.f) : f = g

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{T : CategoryTheory.Monad C}
(X Y : T.Algebra)
(f g : X ⟶ Y)
(h : f.f = g.f)


@[simp]
theorem iInter_iInter_eq' {f : ι → α} {g : α → Set β} :
    ⋂ (x) (y) (_ : f y = x), g x = ⋂ y, g (f y)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{f : ι → α}
{g : α → Set β}

⋂ x, ⋂ y, ⋂ (_ : f y = x), g x = ⋂ y, g (f y)


theorem zero_apply (a : A) : (0 : A →ₛₙₐ[φ] B) a = 0

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


theorem psum_isSymmetric (n : ℕ) : IsSymmetric (psum σ R n)

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


lemma abs_sub_addNSMul_le (hδ : 0 ≤ δ) {t : Icc a b} (n : ℕ)
    (ht : t ∈ Icc (addNSMul h δ n) (addNSMul h δ (n+1))) :
    (|t - addNSMul h δ n| : α) ≤ δ

(ht : t ∈ Set.Icc (Set.Icc.addNSMul h δ n) (Set.Icc.addNSMul h δ (n + 1)))


/-- A functor `G : C ⥤ D` sends cocones over `F` to cocones over `F ⋙ G` functorially. -/
@[simps]
def functoriality : Cocone F ⥤ Cocone (F ⋙ G)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
(F : J ⥤ C)
(G : C ⥤ D)
(A : CategoryTheory.Limits.Cocone F)

((CategoryTheory.Limits.Cocones.functoriality F G).obj A).pt = G.obj A.pt


theorem coindep_iff_subset_compl_base : M.Coindep X ↔ ∃ B, M.Base B ∧ X ⊆ M.E \ B

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


/-- The unit isomorphism of the Dold-Kan equivalence. -/
@[simps! inv]
def Γ₂N₂ : 𝟭 _ ≅ (N₂ : Karoubi (SimplicialObject C) ⥤ _) ⋙ Γ₂


lemma integral_densityProcess (hκν : fst κ ≤ ν) [IsFiniteKernel ν]
    (n : ℕ) (a : α) {s : Set β} (hs : MeasurableSet s) :
    ∫ x, densityProcess κ ν n a x s ∂(ν a) = (κ a (univ ×ˢ s)).toReal

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

∫ (x : γ), κ.densityProcess ν n a x s ∂ν a = ((κ a) (Set.univ ×ˢ s)).toReal


@[to_additive] lemma pow_mul_pow_eq_one : ∀ n, a * b = 1 → a ^ n * b ^ n = 1

{M : Type u_4}
[Monoid M]
{a b : M}
(n : ℕ)


theorem getLast_congr {l₁ l₂ : List α} (h₁ : l₁ ≠ []) (h₂ : l₂ ≠ []) (h₃ : l₁ = l₂) :
    getLast l₁ h₁ = getLast l₂ h₂

{α : Type u}
{l₁ l₂ : List α}
(h₁ : l₁ ≠ [])
(h₂ : l₂ ≠ [])
(h₃ : l₁ = l₂)


theorem exponent : Monoid.exponent (QuaternionGroup n) = 2 * lcm n 2


@[simp]
theorem toL1_eq_toL1_iff (f g : α → β) (hf : Integrable f μ) (hg : Integrable g μ) :
    toL1 f hf = toL1 g hg ↔ f =ᵐ[μ] g

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
(f g : α → β)
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)

MeasureTheory.Integrable.toL1 f hf = MeasureTheory.Integrable.toL1 g hg ↔ f =ᵐ[μ] g


theorem min_comm (a b : α) : min a b = min b a


@[to_additive]
theorem smul_fixedBy (g h : G) :
    h • fixedBy α g = fixedBy α (h * g * h⁻¹)

(α : Type u_1)
{G : Type u_2}
[AddGroup G]
[AddAction G α]
(g h : G)

h +ᵥ AddAction.fixedBy α g = AddAction.fixedBy α (h + g + -h)


theorem iCondIndep.condIndep {m : ι → MeasurableSpace Ω}
    (h_indep : iCondIndep m' hm' m μ) {i j : ι} (hij : i ≠ j) :
      CondIndep m' (m i) (m j) hm' μ

(h_indep : ProbabilityTheory.iCondIndep m' hm' m μ)

ProbabilityTheory.CondIndep m' (m i) (m j) hm' μ


@[simp]
theorem neg_right_iff : Commute a (-b) ↔ Commute a b

{R : Type x}
[Mul R]
[HasDistribNeg R]
{a b : R}


theorem Convex.mem_extremePoints_iff_convex_diff (hA : Convex 𝕜 A) :
    x ∈ A.extremePoints 𝕜 ↔ x ∈ A ∧ Convex 𝕜 (A \ {x})

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[DenselyOrdered 𝕜]
[NoZeroSMulDivisors 𝕜 E]
{A : Set E}
{x : E}
(hA : Convex 𝕜 A)

x ∈ Set.extremePoints 𝕜 A ↔ x ∈ A ∧ Convex 𝕜 (A \ {x})


/--
Equivalent precoherent categories give equivalent coherent toposes.
-/
@[simps!]
def sheafCongrPrecoherent : haveI := e.precoherent
    Sheaf (coherentTopology C) A ≌ Sheaf (coherentTopology D) A

(F : CategoryTheory.Sheaf (CategoryTheory.coherentTopology C) A)

∀ {X Y : Dᵒᵖ} (f : X ⟶ Y), ((e.sheafCongrPrecoherent A).functor.obj F).val.map f = F.val.map (e.inverse.map f.unop).op


/-- A family of gluing data consists of
1. An index type `J`
2. A sheafed space `U i` for each `i : J`.
3. A sheafed space `V i j` for each `i j : J`.
  (Note that this is `J × J → SheafedSpace C` rather than `J → J → SheafedSpace C` to
  connect to the limits library easier.)
4. An open immersion `f i j : V i j ⟶ U i` for each `i j : ι`.
5. A transition map `t i j : V i j ⟶ V j i` for each `i j : ι`.
such that
6. `f i i` is an isomorphism.
7. `t i i` is the identity.
8. `V i j ×[U i] V i k ⟶ V i j ⟶ V j i` factors through `V j k ×[U j] V j i ⟶ V j i` via some
    `t' : V i j ×[U i] V i k ⟶ V j k ×[U j] V j i`.
9. `t' i j k ≫ t' j k i ≫ t' k i j = 𝟙 _`.

We can then glue the spaces `U i` together by identifying `V i j` with `V j i`, such
that the `U i`'s are open subspaces of the glued space.
-/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure GlueData extends CategoryTheory.GlueData (SheafedSpace.{u, v, v} C) where
  f_open : ∀ i j, SheafedSpace.IsOpenImmersion (f i j)

(self : AlgebraicGeometry.SheafedSpace.GlueData C)

AlgebraicGeometry.SheafedSpace.IsOpenImmersion (self.f i j)


theorem isRelPrime_mul_unit_left_left : IsRelPrime (x * y) z ↔ IsRelPrime y z

{α : Type u_1}
[CommMonoid α]
{x y z : α}
(hu : IsUnit x)


@[simp] lemma ofMul_uzpow (u : ℤˣ) (r : R) : Additive.ofMul (u ^ r) = r • Additive.ofMul u

{R : Type u_1}
[CommSemiring R]
[Module R (Additive ℤˣ)]
(u : ℤˣ)
(r : R)


/-- This is a weaker version of `sSup_inf_eq` -/
theorem iSup_inf_le_sSup_inf : ⨆ b ∈ s, b ⊓ a ≤ sSup s ⊓ a

{α : Type u_1}
[CompleteLattice α]
{a : α}
{s : Set α}


@[fun_prop]
theorem DifferentiableOn.sub_const (hf : DifferentiableOn 𝕜 f s) (c : F) :
    DifferentiableOn 𝕜 (fun y => f y - c) s

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


@[simp 1100]
theorem prevD_succ_cochainComplex (f : ∀ i j, P.X i ⟶ Q.X j) (i : ℕ) :
    prevD (i + 1) f = f (i + 1) _ ≫ Q.d i (i + 1)

{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{P Q : CochainComplex V ℕ}
(f : (i j : ℕ) → P.X i ⟶ Q.X j)
(i : ℕ)


theorem map_injective [MonoidHomClass F R[X] S[X]] (φ : F) (hφ : R[X]⁰ ≤ S[X]⁰.comap φ)
    (hf : Function.Injective φ) : Function.Injective (map φ hφ)

{R : Type u_3}
{S : Type u_4}
{F : Type u_5}
[CommRing R]
[CommRing S]
[FunLike F R[X] S[X]]
[MonoidHomClass F R[X] S[X]]
(φ : F)
(hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰)
(hf : Function.Injective ⇑φ)


@[simp] theorem pushforwardFamily_def {X} (x : ℱ.obj (op X)) :
    pushforwardFamily α x = fun _ _ hf =>
  ℱ'.val.map hf.some.lift.op <| α.app (op _) (ℱ.map hf.some.map.op x : _)

{K : CategoryTheory.GrothendieckTopology D}

{ℱ : CategoryTheory.Functor Dᵒᵖ (Type v)}

CategoryTheory.Functor.IsCoverDense.Types.pushforwardFamily α x = fun x_1 x_2 hf =>
  ℱ'.val.map (Nonempty.some hf).lift.op (α.app (Opposite.op (Nonempty.some hf).1) (ℱ.map (Nonempty.some hf).map.op x))


/-- A groupoid `G` is free when we have the following data:
 - a quiver on `IsFreeGroupoid.Generators G` (a type synonym for `G`)
 - a function `of` taking a generating arrow to a morphism in `G`
 - such that a functor from `G` to any group `X` is uniquely determined
   by assigning labels in `X` to the generating arrows.

   This definition is nonstandard. Normally one would require that functors `G ⥤ X`
   to any _groupoid_ `X` are given by graph homomorphisms from `generators`. -/
class IsFreeGroupoid (G) [Groupoid.{v} G] where
  quiverGenerators : Quiver.{v + 1} (IsFreeGroupoid.Generators G)
  of : ∀ {a b : IsFreeGroupoid.Generators G}, (a ⟶ b) → ((show G from a) ⟶ b)
  unique_lift :
    ∀ {X : Type v} [Group X] (f : Labelling (IsFreeGroupoid.Generators G) X),
      ∃! F : G ⥤ CategoryTheory.SingleObj X, ∀ (a b) (g : a ⟶ b), F.map (of g) = f g

(f : Quiver.Labelling (IsFreeGroupoid.Generators G) X)

∃! F, ∀ (a b : IsFreeGroupoid.Generators G) (g : a ⟶ b), F.map (IsFreeGroupoid.of g) = f g


theorem hasBasis_cocardinal : HasBasis (cocardinal α hreg) {s : Set α | #s < c} compl

{α : Type u}
{c : Cardinal.{u}}
{hreg : c.IsRegular}

(Filter.cocardinal α hreg).HasBasis {s | #↑s < c} compl


theorem IsOrtho.zero_left (x : M) : IsOrtho Q (0 : M) x

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


@[to_additive]
theorem prod_hom₂ (l : List ι) (f : M → N → P) (hf : ∀ a b c d, f (a * b) (c * d) = f a c * f b d)
    (hf' : f 1 1 = 1) (f₁ : ι → M) (f₂ : ι → N) :
    (l.map fun i => f (f₁ i) (f₂ i)).prod = f (l.map f₁).prod (l.map f₂).prod

(hf : ∀ (a b : M) (c d : N), f (a * b) (c * d) = f a c * f b d)

(List.map (fun i => f (f₁ i) (f₂ i)) l).prod = f (List.map f₁ l).prod (List.map f₂ l).prod


@[simp]
lemma mk_smul (a) (ha) (x : 𝕜') : (⟨a, ha⟩ : 𝕜≥0) • x = a • x

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[OrderedSemiring 𝕜]
[SMul 𝕜 𝕜']
(a : 𝕜)
(ha : 0 ≤ a)
(x : 𝕜')


/-- `castSucc i` is positive when `i` is positive.

The `Fin.castSucc_pos` in `Lean` only applies in `Fin (n+1)`.
This one instead uses a `NeZero n` typeclass hypothesis. -/
theorem castSucc_pos' [NeZero n] {i : Fin n} (h : 0 < i) : 0 < castSucc i

{n : ℕ}
[NeZero n]
{i : Fin n}
(h : 0 < i)


@[to_additive (attr := simp)]
lemma univ_div_univ [Fintype α] : (univ / univ : Finset α) = univ

{α : Type u_2}
[DecidableEq α]
[SubtractionMonoid α]
[Fintype α]


theorem im_sq_le_normSq (z : K) : im z * im z ≤ normSq z

RCLike.im z * RCLike.im z ≤ RCLike.normSq z


theorem norm_integral_le_integral_norm (f : α →ₛ E) (hf : Integrable f μ) :
    ‖f.integral μ‖ ≤ (f.map norm).integral μ

{α : Type u_1}
{E : Type u_2}
[NormedAddCommGroup E]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedSpace ℝ E]
(f : MeasureTheory.SimpleFunc α E)
(hf : MeasureTheory.Integrable (↑f) μ)

‖MeasureTheory.SimpleFunc.integral μ f‖ ≤ MeasureTheory.SimpleFunc.integral μ (MeasureTheory.SimpleFunc.map norm f)


@[simp] lemma mem_ker : a ∈ f.ker ↔ ∀ s ∈ f, a ∈ s


@[to_additive]
theorem map_iInf_comap_of_surjective (S : ι → Submonoid N) : (⨅ i, (S i).comap f).map f = iInf S

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_4}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
{ι : Type u_5}
{f : F}
(hf : Function.Surjective ⇑f)
(S : ι → AddSubmonoid N)

AddSubmonoid.map f (⨅ i, AddSubmonoid.comap f (S i)) = iInf S


@[simp]
protected theorem inv_le_one : a⁻¹ ≤ 1 ↔ 1 ≤ a

a⁻¹ ≤ 1 ↔ 1 ≤ a


/-- A cotrident on `f : J → (X ⟶ Y)` is determined by the morphism `π : Y ⟶ P` satisfying
`∀ j₁ j₂, f j₁ ≫ π = f j₂ ≫ π`.
-/
@[simps]
def Cotrident.ofπ [Nonempty J] {P : C} (π : Y ⟶ P) (w : ∀ j₁ j₂, f j₁ ≫ π = f j₂ ≫ π) :
    Cotrident f

(w : ∀ (j₁ j₂ : J), CategoryTheory.CategoryStruct.comp (f j₁) π = CategoryTheory.CategoryStruct.comp (f j₂) π)

(CategoryTheory.Limits.Cotrident.ofπ π w).pt = P


lemma IsIntegralCurveOn.mono (h : IsIntegralCurveOn γ v s) (hs : s' ⊆ s) :
    IsIntegralCurveOn γ v s'

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type u_2}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type u_3}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{γ : ℝ → M}
{v : (x : M) → TangentSpace I x}
{s s' : Set ℝ}
(h : IsIntegralCurveOn γ v s)
(hs : s' ⊆ s)


@[simp]
theorem FiniteField.Matrix.charpoly_pow_card {K : Type*} [Field K] [Fintype K] (M : Matrix n n K) :
    (M ^ Fintype.card K).charpoly = M.charpoly

{n : Type u_1}
[DecidableEq n]
[Fintype n]
{K : Type u_2}
[Field K]
[Fintype K]
(M : Matrix n n K)


theorem mul_braiding {X Y : Mon_ C} :
    (X ⊗ Y).mul ≫ (β_ X.X Y.X).hom = ((β_ X.X Y.X).hom ⊗ (β_ X.X Y.X).hom) ≫ (Y ⊗ X).mul

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.SymmetricCategory C]
{X Y : Mon_ C}


/-- If a function vanishes on `t \ s` with `s ⊆ t`, then its integrals on `s`
and `t` coincide if `t` is measurable. -/
theorem setIntegral_eq_of_subset_of_forall_diff_eq_zero (ht : MeasurableSet t) (hts : s ⊆ t)
    (h't : ∀ x ∈ t \ s, f x = 0) : ∫ x in t, f x ∂μ = ∫ x in s, f x ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → E}
{s t : Set X}
{μ : MeasureTheory.Measure X}
(ht : MeasurableSet t)
(hts : s ⊆ t)
(h't : ∀ x ∈ t \ s, f x = 0)

∫ (x : X) in t, f x ∂μ = ∫ (x : X) in s, f x ∂μ


/-- This lemma is weaker than `MeasureTheory.Memℒp.integral_indicator_norm_ge_nonneg_le`
as the latter provides `0 ≤ M` and does not require the measurability of `f`. -/
theorem Memℒp.integral_indicator_norm_ge_le (hf : Memℒp f 1 μ) (hmeas : StronglyMeasurable f)
    {ε : ℝ} (hε : 0 < ε) :
    ∃ M : ℝ, (∫⁻ x, ‖{ x | M ≤ ‖f x‖₊ }.indicator f x‖₊ ∂μ) ≤ ENNReal.ofReal ε

(hmeas : MeasureTheory.StronglyMeasurable f)

∃ M, ∫⁻ (x : α), ↑‖{x | M ≤ ↑‖f x‖₊}.indicator f x‖₊ ∂μ ≤ ENNReal.ofReal ε


theorem isClique_map_iff {f : α ↪ β} {t : Set β} :
    (G.map f).IsClique t ↔ t.Subsingleton ∨ ∃ (s : Set α), G.IsClique s ∧ f '' s = t

{α : Type u_1}
{β : Type u_2}
{G : SimpleGraph α}
{f : α ↪ β}
{t : Set β}

(SimpleGraph.map f G).IsClique t ↔ t.Subsingleton ∨ ∃ s, G.IsClique s ∧ ⇑f '' s = t


@[simp] theorem getD_map (f : α → β) (x : α) (o : Option α) :
  (o.map f).getD (f x) = f (getD o x)

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(x : α)
(o : Option α)

(Option.map f o).getD (f x) = f (o.getD x)


/-- The angle between a nonzero vector and itself. -/
@[simp]
theorem angle_self {x : V} (hx : x ≠ 0) : angle x x = 0

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x : V}
(hx : x ≠ 0)


theorem exists_eq_pow_of_mul_eq_pow_of_coprime {R : Type*} [CommSemiring R] [IsDomain R]
    [GCDMonoid R] [Unique Rˣ] {a b c : R} {n : ℕ} (cp : IsCoprime a b) (h : a * b = c ^ n) :
    ∃ d : R, a = d ^ n

{R : Type u_2}
[CommSemiring R]
[IsDomain R]
[GCDMonoid R]
[Unique Rˣ]
{a b c : R}
{n : ℕ}
(cp : IsCoprime a b)
(h : a * b = c ^ n)


theorem monic_prod_multiset_X_sub_C : Monic (p.roots.map fun a => X - C a).prod

{R : Type u}
[CommRing R]
[IsDomain R]
{p : Polynomial R}

(Multiset.map (fun a => Polynomial.X - Polynomial.C a) p.roots).prod.Monic


/-- An uncurried version of `Finset.prod_prod_type_right`. -/
@[to_additive Fintype.sum_prod_type_right' "An uncurried version of `Finset.sum_prod_type_right`"]
theorem Fintype.prod_prod_type_right' [CommMonoid γ] {f : α₁ → α₂ → γ} :
    ∏ x : α₁ × α₂, f x.1 x.2 = ∏ y, ∏ x, f x y

{γ : Type u_3}
{α₁ : Type u_4}
{α₂ : Type u_5}
[Fintype α₁]
[Fintype α₂]
[AddCommMonoid γ]
{f : α₁ → α₂ → γ}

∑ x : α₁ × α₂, f x.1 x.2 = ∑ y : α₂, ∑ x : α₁, f x y


/-- Construct limit data for a product in `ModuleCat R`, using `ModuleCat.of R (∀ j, F.obj j)`.
-/
@[simps]
def productLimitCone : Limits.LimitCone (Discrete.functor f)

{R : Type u}
[Ring R]
{J : Type w}
(f : J → ModuleCat R)

(ModuleCat.HasLimit.productLimitCone f).cone.π = CategoryTheory.Discrete.natTrans fun j => LinearMap.proj j.as


theorem min_le (h : WellFounded ((· < ·) : β → β → Prop)) {x : β} {s : Set β} (hx : x ∈ s)
    (hne : s.Nonempty := ⟨x, hx⟩) : h.min s hne ≤ x

{β : Type u_2}
[LinearOrder β]
(h : WellFounded fun x x_1 => x < x_1)
{x : β}
{s : Set β}
(hx : x ∈ s)
(hne : s.Nonempty := ⋯)


@[simp] theorem coe_subNat (i : Fin (n + m)) (h : m ≤ i) : (i.subNat m h : Nat) = i - m

{n m : Nat}
(i : Fin (n + m))
(h : m ≤ ↑i)


theorem IsRotated.reverse (h : l ~r l') : l.reverse ~r l'.reverse

{α : Type u}
{l l' : List α}
(h : l ~r l')


theorem IsIrreducible.isConnected {s : Set α} (H : IsIrreducible s) : IsConnected s

{α : Type u}
[TopologicalSpace α]
{s : Set α}
(H : IsIrreducible s)


theorem dom_bool (f : Bool → α) : Primrec f

{α : Type u_1}
[Primcodable α]
(f : Bool → α)


/-- The `G`-set `G`, acting on itself by left multiplication. -/
@[simps!]
def leftRegular (G : Type u) [Monoid G] : Action (Type u) (MonCat.of G)


@[to_additive (attr := simp)]
theorem smul_set_ae_eq (c : G) {s t : Set α} : c • s =ᵐ[μ] c • t ↔ s =ᵐ[μ] t

[MeasureTheory.SMulInvariantMeasure G α μ]


@[qify_simps] lemma intCast_lt (a b : ℤ) : a < b ↔ (a : ℚ) < (b : ℚ)


{α : Type u}
[PartialOrder α]
[OrderBot α]
{a : α}
(h : ⊥ ≠ a)


lemma truncatedInf_le : truncatedInf s a ≤ a

{α : Type u_1}
[SemilatticeInf α]
[BoundedOrder α]
[DecidableRel fun x x_1 => x ≤ x_1]
{s : Finset α}
{a : α}


/-- If `f(K) ≤ i(K)`, then `LinearMap.iterateMapComap` is not decreasing. -/
theorem iterateMapComap_le_succ (K : Submodule R N) (h : K.map f ≤ K.map i) (n : ℕ) :
    f.iterateMapComap i n K ≤ f.iterateMapComap i (n + 1) K

(h : Submodule.map f K ≤ Submodule.map i K)


/-- The Weierstrass curve over `R` induced by an admissible linear change of variables
$(X, Y) \mapsto (u^2X + r, u^3Y + u^2sX + t)$ for some $u \in R^\times$ and some $r, s, t \in R$. -/
@[simps]
def variableChange : WeierstrassCurve R

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

(W.variableChange C).a₃ = ↑C.u⁻¹ ^ 3 * (W.a₃ + C.r * W.a₁ + 2 * C.t)


@[simp]
theorem ListBlank.head_cons {Γ} [Inhabited Γ] (a : Γ) : ∀ l : ListBlank Γ, (l.cons a).head = a

{Γ : Type u_1}
[Inhabited Γ]
(a : Γ)
(l : Turing.ListBlank Γ)


protected theorem tsum_prod {f : α → β → ℝ≥0∞} : ∑' p : α × β, f p.1 p.2 = ∑' (a) (b), f a b

{α : Type u_1}
{β : Type u_2}
{f : α → β → ℝ≥0∞}


theorem lintegral_singleton [MeasurableSingletonClass α] (f : α → ℝ≥0∞) (a : α) :
    ∫⁻ x in {a}, f x ∂μ = f a * μ {a}

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


theorem sigma_sum [AddCommMonoid N] (f : (Σi : ι, αs i) → M → N) :
    l.sum f = ∑ i ∈ splitSupport l, (split l i).sum fun (a : αs i) b => f ⟨i, a⟩ b

{ι : Type u_4}
{M : Type u_5}
{N : Type u_7}
{αs : ι → Type u_13}
[Zero M]
(l : (i : ι) × αs i →₀ M)
[AddCommMonoid N]
(f : (i : ι) × αs i → M → N)

l.sum f = ∑ i ∈ l.splitSupport, (l.split i).sum fun a b => f ⟨i, a⟩ b


theorem KaehlerDifferential.kerTotal_mkQ_single_algebraMap_one (x) : (x𝖣1) = 0

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

(KaehlerDifferential.kerTotal R S).mkQ (Finsupp.single 1 x) = 0


theorem card_eq_one_iff : card α = 1 ↔ ∃ x : α, ∀ y, y = x

Fintype.card α = 1 ↔ ∃ x, ∀ (y : α), y = x


@[simp]
theorem one_le_iff {a : SignType} : 1 ≤ a ↔ a = 1


theorem continuous_eval : Continuous fun p : Path x y × I => p.1 p.2

{X : Type u_1}
[TopologicalSpace X]
{x y : X}


theorem map_sub_eq_of_lt_right {x y : R} (hx : v y < v x) :
    v (x - y) = v y

{R : Type u_3}
{Γ₀ : Type u_4}
[LinearOrderedAddCommGroupWithTop Γ₀]
[Ring R]
(v : AddValuation R Γ₀)
{x y : R}
(hx : v y < v x)


theorem sublist_replicate_iff {l : List α} {a : α} {n : ℕ} :
    l <+ replicate n a ↔ ∃ k ≤ n, l = replicate k a

{α : Type u}
{l : List α}
{a : α}
{n : ℕ}

l.Sublist (List.replicate n a) ↔ ∃ k, k ≤ n ∧ l = List.replicate k a


@[to_additive]
theorem div_union : s / (t₁ ∪ t₂) = s / t₁ ∪ s / t₂

{α : Type u_2}
[Div α]
{s t₁ t₂ : Set α}


@[simp]
theorem inf_sdiff_inf (x y : α) : x \ y ⊓ (x ⊓ y) = ⊥

{α : Type u}
[GeneralizedBooleanAlgebra α]
(x y : α)


@[simp]
theorem divisorsAntidiagonal_zero : divisorsAntidiagonal 0 = ∅


theorem prev : ∀ {it}, Valid it → Valid it.prev


@[to_additive]
theorem setIntegral_eq_tsum (h : IsFundamentalDomain G s μ) {f : α → E} {t : Set α}
    (hf : IntegrableOn f t μ) : ∫ x in t, f x ∂μ = ∑' g : G, ∫ x in t ∩ g • s, f x ∂μ

(h : MeasureTheory.IsFundamentalDomain G s μ)

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


@[simp]
theorem _root_.DomMulAct.mk_smul_linearMap_apply (a : S') (f : M →ₛₗ[σ₁₂] M₂) (x : M) :
    (DomMulAct.mk a • f) x = f (a • x)

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_9}
{M₂ : Type u_11}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{S' : Type u_17}
[Monoid S']
[DistribMulAction S' M]
[SMulCommClass R S' M]
(a : S')
(f : M →ₛₗ[σ₁₂] M₂)
(x : M)


/-- If a function is differentiable, and has two derivatives at `x`, then the second
derivative is symmetric. -/
theorem second_derivative_symmetric {f : E → F} {f' : E → E →L[ℝ] F} {f'' : E →L[ℝ] E →L[ℝ] F}
    (hf : ∀ y, HasFDerivAt f (f' y) y) (hx : HasFDerivAt f' f'' x) (v w : E) : f'' v w = f'' w v

(hf : ∀ (y : E), HasFDerivAt f (f' y) y)


/-- Sum of elements in a `Subfield` indexed by a `Finset` is in the `Subfield`. -/
protected theorem sum_mem {ι : Type*} {t : Finset ι} {f : ι → K} (h : ∀ c ∈ t, f c ∈ s) :
    (∑ i ∈ t, f i) ∈ s

{K : Type u}
[DivisionRing K]
(s : Subfield K)
{ι : Type u_1}
{t : Finset ι}
{f : ι → K}
(h : ∀ c ∈ t, f c ∈ s)


@[fun_prop]
theorem continuous_rpow_const {y : ℝ} (h : 0 ≤ y) : Continuous fun x : ℝ≥0 => x ^ y


@[to_additive (attr := simp)]
theorem preimage_mul_left_one : preimage 1 (a * ·) (mul_right_injective _).injOn = {a⁻¹}

Finset.preimage 0 (fun x => a + x) ⋯ = {-a}


/-- **Uniqueness of left-invariant measures**:
Two Haar measures coincide up to a multiplicative constant in a second countable group. -/
@[to_additive isAddLeftInvariant_eq_smul]
lemma isMulLeftInvariant_eq_smul [LocallyCompactSpace G] [SecondCountableTopology G]
    (μ' μ : Measure G) [IsHaarMeasure μ] [IsFiniteMeasureOnCompacts μ'] [IsMulLeftInvariant μ'] :
    μ' = haarScalarFactor μ' μ • μ


@[to_additive]
theorem smul_of_comm {G' : Type*} [Group G'] [MulAction G' α] [MeasurableSpace G']
    [MeasurableSMul G' α] [SMulInvariantMeasure G' α μ] [SMulCommClass G' G α]
    (h : IsFundamentalDomain G s μ) (g : G') : IsFundamentalDomain G (g • s) μ

[MeasureTheory.SMulInvariantMeasure G' α μ]

MeasureTheory.IsFundamentalDomain G (g • s) μ


@[simp]
lemma coe_aeval_mk_apply {S : Subalgebra R A} (h : x ∈ S) :
    (aeval (⟨x, h⟩ : S) p : A) = aeval x p

{R : Type u}
{A : Type z}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{p : R[X]}
(x : A)
{S : Subalgebra R A}
(h : x ∈ S)

↑((Polynomial.aeval ⟨x, h⟩) p) = (Polynomial.aeval x) p


theorem splits_id_iff_splits {f : K[X]} : (f.map i).Splits (RingHom.id L) ↔ f.Splits i

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

Polynomial.Splits (RingHom.id L) (Polynomial.map i f) ↔ Polynomial.Splits i f


/-- See also `finprod_eq_of_bijective`, `Fintype.prod_bijective` and `Finset.prod_bij`. -/
@[to_additive "See also `finsum_eq_of_bijective`, `Fintype.sum_bijective` and `Finset.sum_bij`."]
theorem finprod_comp {g : β → M} (e : α → β) (he₀ : Function.Bijective e) :
    (∏ᶠ i, g (e i)) = ∏ᶠ j, g j

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[CommMonoid M]
{g : β → M}
(e : α → β)
(he₀ : Function.Bijective e)


@[simp]
theorem lt_min_iff : a < min b c ↔ a < b ∧ a < c

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


lemma OpenEmbedding.generalizingMap (hf : OpenEmbedding f) : GeneralizingMap f

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(hf : OpenEmbedding f)


theorem cast_descFactorial {n p : ℕ} (h : n ≤ p) :
    (descFactorial (p - 1) n : ZMod p) = (-1) ^ n * n !

↑((p - 1).descFactorial n) = (-1) ^ n * ↑n !


@[simp]
theorem support_neg [AddGroup G] (f : α →₀ G) : support (-f) = support f

{α : Type u_1}
{G : Type u_9}
[AddGroup G]
(f : α →₀ G)


@[simp]
theorem openSegment_eq_Ioo (h : x < y) : openSegment 𝕜 x y = Ioo x y

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
{x y : 𝕜}
(h : x < y)


@[simp]
theorem smul_apply (n : ℕ) (r : R) (f : AdicCauchySequence I M) : (r • f) n = r • f n

(f : AdicCompletion.AdicCauchySequence I M)


@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P)

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


/-- An expression for the inverse of a lower block-triangular matrix, when either both elements of
diagonal are invertible, or both are not. -/
theorem inv_fromBlocks_zero₁₂_of_isUnit_iff (A : Matrix m m α) (C : Matrix n m α) (D : Matrix n n α)
    (hAD : IsUnit A ↔ IsUnit D) :
    (fromBlocks A 0 C D)⁻¹ = fromBlocks A⁻¹ 0 (-(D⁻¹ * C * A⁻¹)) D⁻¹

{m : Type u_2}
{n : Type u_3}
{α : Type u_4}
[Fintype m]
[Fintype n]
[DecidableEq m]
[DecidableEq n]
[CommRing α]
(A : Matrix m m α)
(C : Matrix n m α)
(D : Matrix n n α)
(hAD : IsUnit A ↔ IsUnit D)

(Matrix.fromBlocks A 0 C D)⁻¹ = Matrix.fromBlocks A⁻¹ 0 (-(D⁻¹ * C * A⁻¹)) D⁻¹


theorem add_def {n} (x y : BitVec n) : x + y = .ofNat n (x.toNat + y.toNat)

x + y = BitVec.ofNat n (x.toNat + y.toNat)


theorem mem_union_right {x : α} {b : Set α} (a : Set α) : x ∈ b → x ∈ a ∪ b

{α : Type u}
{x : α}
{b : Set α}
(a : Set α)


theorem submodule_closure_single :
    AddSubmonoid.closure (⋃ i, single R i '' (F.N i : Set M)) = F.submodule.toAddSubmonoid

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
{I : Ideal R}
(F : I.Filtration M)

AddSubmonoid.closure (⋃ i, ⇑(PolynomialModule.single R i) '' ↑(F.N i)) = F.submodule.toAddSubmonoid


theorem zip_of_prod {l : List α} {l' : List β} {lp : List (α × β)} (hl : lp.map Prod.fst = l)
    (hr : lp.map Prod.snd = l') : lp = l.zip l'

{α : Type u}
{β : Type u_1}
{l : List α}
{l' : List β}
{lp : List (α × β)}
(hl : List.map Prod.fst lp = l)
(hr : List.map Prod.snd lp = l')


theorem orthogonalComplement_iSup_eigenspaces_eq_bot' :
    (⨆ μ : Eigenvalues T, eigenspace T μ)ᗮ = ⊥

{𝕜 : Type u_1}
[RCLike 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{T : E →ₗ[𝕜] E}
(hT : T.IsSymmetric)
[FiniteDimensional 𝕜 E]

(⨆ μ, Module.End.eigenspace T (↑T μ))ᗮ = ⊥


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

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

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


/-- In a real vector space of dimension `> 1`, any sphere of nonnegative radius is
path connected. -/
theorem isPathConnected_sphere (h : 1 < Module.rank ℝ E) (x : E) {r : ℝ} (hr : 0 ≤ r) :
    IsPathConnected (sphere x r)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(h : 1 < Module.rank ℝ E)
(x : E)
{r : ℝ}
(hr : 0 ≤ r)


theorem liftOrGet_eq_or_eq {f : α → α → α} (h : ∀ a b, f a b = a ∨ f a b = b) :
    ∀ o₁ o₂, liftOrGet f o₁ o₂ = o₁ ∨ liftOrGet f o₁ o₂ = o₂

{f : α → α → α}

(h : ∀ (a b : α), f a b = a ∨ f a b = b)

Option.liftOrGet f o₁ o₂ = o₁ ∨ Option.liftOrGet f o₁ o₂ = o₂


theorem UniformContinuous.comp_cauchySeq {γ} [UniformSpace β] [Preorder γ] {f : α → β}
    (hf : UniformContinuous f) {u : γ → α} (hu : CauchySeq u) : CauchySeq (f ∘ u)

{α : Type u}
{β : Type v}
[uniformSpace : UniformSpace α]
{γ : Type u_1}
[UniformSpace β]
[Preorder γ]
{f : α → β}
(hf : UniformContinuous f)
{u : γ → α}
(hu : CauchySeq u)


@[refl]
lemma Derives.refl (w : List (Symbol T g.NT)) : g.Derives w w

{T : Type uT}
{g : ContextFreeGrammar T}
(w : List (Symbol T g.NT))


/-- A fraction `(a : S) / (b : S)` can be reduced to `(c : S) / (d : R)`,
if `S` is the integral closure of `R` in an algebraic extension `L` of `R`. -/
theorem IsIntegralClosure.exists_smul_eq_mul {L : Type*} [Field L] [Algebra R S] [Algebra S L]
    [Algebra R L] [IsScalarTower R S L] [IsIntegralClosure S R L] [Algebra.IsAlgebraic R L]
    (inj : Function.Injective (algebraMap R L)) (a : S) {b : S} (hb : b ≠ 0) :
    ∃ᵉ (c : S) (d ≠ (0 : R)), d • a = b * c

(inj : Function.Injective ⇑(algebraMap R L))


theorem integralClosure_eq_bot_iff : integralClosure R K = ⊥ ↔ IsIntegrallyClosed R

{R : Type u_1}
[CommRing R]
(K : Type u_3)
[CommRing K]
[Algebra R K]
[ifr : IsFractionRing R K]


theorem coe_ideal_span_singleton_inv_mul {x : R₁} (hx : x ≠ 0) :
    (Ideal.span ({x} : Set R₁) : FractionalIdeal R₁⁰ K)⁻¹ * Ideal.span ({x} : Set R₁) = 1

(K : Type u_3)
[Field K]
{R₁ : Type u_4}
[CommRing R₁]
[IsDomain R₁]
[Algebra R₁ K]
[IsFractionRing R₁ K]
{x : R₁}
(hx : x ≠ 0)

(↑(Ideal.span {x}))⁻¹ * ↑(Ideal.span {x}) = 1


@[simp]
theorem symmDiff_eq_right : a ∆ b = b ↔ a = ⊥

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


theorem HasMFDerivWithinAt.mul' (hp : HasMFDerivWithinAt I 𝓘(𝕜, F') p s z p')
    (hq : HasMFDerivWithinAt I 𝓘(𝕜, F') q s z q') :
    HasMFDerivWithinAt I 𝓘(𝕜, F') (p * q) s z (p z • q' + p'.smulRight (q z) : E →L[𝕜] F')

HasMFDerivWithinAt I 𝓘(𝕜, F') (p * q) s z (p z • q' + p'.smulRight (q z))


@[ext]
theorem ext (h : ∀ x, e x = e' x) : e = e'

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
{e e' : A ≃ₐc[R] B}
(h : ∀ (x : A), e x = e' x)


theorem adjoin_attach_biUnion [DecidableEq A] {α : Type*} {s : Finset α} (f : s → Finset A) :
    adjoin R (s.attach.biUnion f : Set A) = ⨆ x, adjoin R (f x)

{R : Type uR}
{A : Type uA}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[DecidableEq A]
{α : Type u_1}
{s : Finset α}
(f : { x // x ∈ s } → Finset A)

Algebra.adjoin R ↑(s.attach.biUnion f) = ⨆ x, Algebra.adjoin R ↑(f x)


theorem CovBy.eq_or_eq (h : a ⋖ b) (h2 : a ≤ c) (h3 : c ≤ b) : c = a ∨ c = b

{α : Type u_1}
[PartialOrder α]
{a b c : α}
(h : a ⋖ b)
(h2 : a ≤ c)
(h3 : c ≤ b)


@[simp]
theorem tensorObj_mul (X Y : Mon_ C) :
    (X ⊗ Y).mul = tensor_μ C (X.X, Y.X) (X.X, Y.X) ≫ (X.mul ⊗ Y.mul)

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

(X ⊗ Y).mul = CategoryTheory.tensor_μ C (X.X, Y.X) (X.X, Y.X) ≫ (X.mul ⊗ Y.mul)


@[simp]
theorem preimage_ceil_zero : (Nat.ceil : α → ℕ) ⁻¹' {0} = Iic 0

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]


@[simp]
theorem map_id (P : PresheafOfModules R) (X : Cᵒᵖ) :
    P.map (𝟙 X) = LinearMap.id'

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{R : Cᵒᵖ ⥤ RingCat}
(P : PresheafOfModules R)
(X : Cᵒᵖ)


/-- This is an auxiliary lemma for `measurable_kernel_prod_mk_left`. -/
theorem measurable_kernel_prod_mk_left_of_finite {t : Set (α × β)} (ht : MeasurableSet t)
    (hκs : ∀ a, IsFiniteMeasure (κ a)) : Measurable fun a => κ a (Prod.mk a ⁻¹' t)

(hκs : ∀ (a : α), MeasureTheory.IsFiniteMeasure (κ a))

Measurable fun a => (κ a) (Prod.mk a ⁻¹' t)


lemma eq_zero_of_dvd_of_div_eq_zero (hab : a ∣ b) (h : b / a = 0) : b = 0


theorem isAlgebraic_rat (R : Type u) {A : Type v} [DivisionRing A] [Field R] [Algebra R A] (n : ℚ) :
    IsAlgebraic R (n : A)


theorem map_iSup {ι : Sort*} (f : P₁ →ᵃ[k] P₂) (s : ι → AffineSubspace k P₁) :
    (iSup s).map f = ⨆ i, (s i).map f

{k : Type u_1}
{V₁ : Type u_2}
{P₁ : Type u_3}
{V₂ : Type u_4}
{P₂ : Type u_5}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
{ι : Sort u_8}
(f : P₁ →ᵃ[k] P₂)
(s : ι → AffineSubspace k P₁)

AffineSubspace.map f (iSup s) = ⨆ i, AffineSubspace.map f (s i)


@[simp]
theorem divInt_eq_zero {a b : ℤ} (b0 : b ≠ 0) : a /. b = 0 ↔ a = 0


/-- An auxiliary definition in order to fix the choice of the preimages between various definitions.
-/
structure FunctorPushforwardStructure (S : Presieve X) {Y} (f : Y ⟶ F.obj X) where
  /-- an object in the source category -/
  preobj : C
  /-- a map in the source category which has to be in the presieve -/
  premap : preobj ⟶ X
  /-- the morphism which appear in the factorisation -/
  lift : Y ⟶ F.obj preobj
  /-- the condition that `premap` is in the presieve -/
  cover : S premap
  /-- the factorisation of the morphism -/
  fac : f = lift ≫ F.map premap

(self : CategoryTheory.Presieve.FunctorPushforwardStructure F S f)

f = CategoryTheory.CategoryStruct.comp self.lift (F.map self.premap)


/--
A complete Boolean algebra is a Boolean algebra that is also a complete distributive lattice.

It is only completely distributive if it is also atomic.
-/
-- We do not directly extend `CompleteDistribLattice` to avoid having the `hnot` field
class CompleteBooleanAlgebra (α) extends CompleteLattice α, BooleanAlgebra α where
  /-- `⊓` distributes over `⨆`. -/
  inf_sSup_le_iSup_inf (a : α) (s : Set α) : a ⊓ sSup s ≤ ⨆ b ∈ s, a ⊓ b
  /-- `⊔` distributes over `⨅`. -/
  iInf_sup_le_sup_sInf (a : α) (s : Set α) : ⨅ b ∈ s, a ⊔ b ≤ a ⊔ sInf s

{α : Type u_1}
[self : CompleteBooleanAlgebra α]
(a : α)
(s : Set α)


theorem pair_comm (x y : α) : ({x, y} : Multiset α) = {y, x}


theorem im_tsum {f : α → 𝕜} (h : Summable f) : im (∑' a, f a) = ∑' a, im (f a)

{α : Type u_1}
(𝕜 : Type u_2)
[RCLike 𝕜]
{f : α → 𝕜}
(h : Summable f)

RCLike.im (∑' (a : α), f a) = ∑' (a : α), RCLike.im (f a)


/-- A sum is finite iff all terms are finite. -/
lemma bot_lt_sum_iff : ⊥ < ∑ i ∈ s, f i ↔ ∀ i ∈ s, ⊥ < f i

{ι : Type u_1}
{α : Type u_2}
[AddCommMonoid α]
[LT α]
{s : Finset ι}
{f : ι → WithBot α}


@[simp]
theorem next_singleton (x y : α) (h : x ∈ [y]) : next [y] x h = y

{α : Type u_1}
[DecidableEq α]
(x y : α)
(h : x ∈ [y])


theorem Nonempty.star [InvolutiveStar α] {s : Set α} (h : s.Nonempty) : s⋆.Nonempty

{α : Type u_1}
[InvolutiveStar α]
{s : Set α}
(h : s.Nonempty)


theorem map_smulₛₗ₂ (f : M →SL[ρ₁₂] F →SL[σ₁₂] G') (c : R) (x : M) (y : F) :
    f (c • x) y = ρ₁₂ c • f x y

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{R : Type u_5}
{𝕜₂ : Type u_6}
{𝕜' : Type u_7}
[NontriviallyNormedField 𝕜']
[NontriviallyNormedField 𝕜₂]
{M : Type u_8}
[TopologicalSpace M]
{σ₁₂ : 𝕜 →+* 𝕜₂}
{G' : Type u_9}
[NormedAddCommGroup G']
[NormedSpace 𝕜₂ G']
[NormedSpace 𝕜' G']
[SMulCommClass 𝕜₂ 𝕜' G']
[Semiring R]
[AddCommMonoid M]
[Module R M]
{ρ₁₂ : R →+* 𝕜'}
(f : M →SL[ρ₁₂] F →SL[σ₁₂] G')
(c : R)
(x : M)
(y : F)


theorem _root_.isAntichain_insert :
    IsAntichain r (insert a s) ↔ IsAntichain r s ∧ ∀ ⦃b⦄, b ∈ s → a ≠ b → ¬r a b ∧ ¬r b a

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

IsAntichain r (insert a s) ↔ IsAntichain r s ∧ ∀ ⦃b : α⦄, b ∈ s → a ≠ b → ¬r a b ∧ ¬r b a


theorem exp_units_conj' (U : (Matrix m m 𝔸)ˣ) (A : Matrix m m 𝔸) :
    exp 𝕂 ((U⁻¹).val * A * U.val) = (U⁻¹).val * exp 𝕂 A * U.val

(𝕂 : Type u_1)
{m : Type u_2}
{𝔸 : Type u_6}
[RCLike 𝕂]
[Fintype m]
[DecidableEq m]
[NormedRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]
(U : (Matrix m m 𝔸)ˣ)
(A : Matrix m m 𝔸)

NormedSpace.exp 𝕂 (↑U⁻¹ * A * ↑U) = ↑U⁻¹ * NormedSpace.exp 𝕂 A * ↑U


theorem floor_le (ha : 0 ≤ a) : (⌊a⌋₊ : α) ≤ a

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a : α}
(ha : 0 ≤ a)


theorem isLittleO_const_id_atBot (c : E'') : (fun _x : ℝ => c) =o[atBot] id

{E'' : Type u_9}
[NormedAddCommGroup E'']
(c : E'')


theorem chineseRemainderOfList_perm {l l' : List ι} (hl : l.Perm l')
    (hs : ∀ i ∈ l, s i ≠ 0) (co : l.Pairwise (Coprime on s)) :
    (chineseRemainderOfList a s l co : ℕ) =
    chineseRemainderOfList a s l' (co.perm hl coprime_comm.mpr)

(co : List.Pairwise (Nat.Coprime on s) l)

↑(Nat.chineseRemainderOfList a s l co) = ↑(Nat.chineseRemainderOfList a s l' ⋯)


theorem WSameSide.nonempty {s : AffineSubspace R P} {x y : P} (h : s.WSameSide x y) :
    (s : Set P).Nonempty

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[StrictOrderedCommRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y : P}
(h : s.WSameSide x y)


theorem inclusion_top_functor (X : TopCat) :
    (@Opens.openEmbedding X ⊤).isOpenMap.functor = map (inclusionTopIso X).inv

⋯.functor = TopologicalSpace.Opens.map (TopologicalSpace.Opens.inclusionTopIso X).inv


@[simp]
theorem mk_add_moveLeft_inl {xl xr yl yr} {xL xR yL yR} {i} :
    (mk xl xr xL xR + mk yl yr yL yR).moveLeft (Sum.inl i) =
      (mk xl xr xL xR).moveLeft i + mk yl yr yL yR

{xl xr yl yr : Type u_1}
{xL : xl → SetTheory.PGame}
{xR : xr → SetTheory.PGame}
{yL : yl → SetTheory.PGame}
{yR : yr → SetTheory.PGame}
{i : xl}

(SetTheory.PGame.mk xl xr xL xR + SetTheory.PGame.mk yl yr yL yR).moveLeft (Sum.inl i) =
  (SetTheory.PGame.mk xl xr xL xR).moveLeft i + SetTheory.PGame.mk yl yr yL yR


theorem int_cyclotomic_spec (n : ℕ) :
    map (Int.castRingHom ℂ) (cyclotomic n ℤ) = cyclotomic' n ℂ ∧
      (cyclotomic n ℤ).degree = (cyclotomic' n ℂ).degree ∧ (cyclotomic n ℤ).Monic

Polynomial.map (Int.castRingHom ℂ) (Polynomial.cyclotomic n ℤ) = Polynomial.cyclotomic' n ℂ ∧
  (Polynomial.cyclotomic n ℤ).degree = (Polynomial.cyclotomic' n ℂ).degree ∧ (Polynomial.cyclotomic n ℤ).Monic


theorem IsPreconnected.intermediate_value₂_eventually₁ {s : Set X} (hs : IsPreconnected s) {a : X}
    {l : Filter X} (ha : a ∈ s) [NeBot l] (hl : l ≤ 𝓟 s) {f g : X → α} (hf : ContinuousOn f s)
    (hg : ContinuousOn g s) (ha' : f a ≤ g a) (he : g ≤ᶠ[l] f) : ∃ x ∈ s, f x = g x

{X : Type u}
{α : Type v}
[TopologicalSpace X]
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{s : Set X}
(hs : IsPreconnected s)
{a : X}
{l : Filter X}
(ha : a ∈ s)
[l.NeBot]
(hl : l ≤ 𝓟 s)
{f g : X → α}
(hf : ContinuousOn f s)
(hg : ContinuousOn g s)
(ha' : f a ≤ g a)
(he : g ≤ᶠ[l] f)


@[to_additive (attr := simp)]
theorem toProd_apply_inr (x : N) : toProd (inr x : M ∗ N) = (1, x)

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

Monoid.Coprod.toProd (Monoid.Coprod.inr x) = (1, x)


/-- Conditional expectation of a function. It is defined as 0 if any one of the following conditions
is true:
- `m` is not a sub-σ-algebra of `m0`,
- `μ` is not σ-finite with respect to `m`,
- `f` is not integrable. -/
noncomputable irreducible_def condexp (m : MeasurableSpace α) {m0 : MeasurableSpace α}
    (μ : Measure α) (f : α → F') : α → F'

{α : Type u_5}
{F' : Type u_6}
[NormedAddCommGroup F']
[NormedSpace ℝ F']
[CompleteSpace F']
(m : MeasurableSpace α)
{m0 : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
(f : α → F')

μ[f|m] =
  if hm : m ≤ m0 then
    if h : MeasureTheory.SigmaFinite (μ.trim hm) ∧ MeasureTheory.Integrable f μ then
      if MeasureTheory.StronglyMeasurable f then f
      else MeasureTheory.AEStronglyMeasurable'.mk ↑↑(MeasureTheory.condexpL1 hm μ f) ⋯
    else 0
  else 0


lemma setIntegral_toReal_rnDeriv_eq_withDensity [SigmaFinite μ] [SFinite ν] (s : Set α) :
    ∫ x in s, (μ.rnDeriv ν x).toReal ∂ν = (ν.withDensity (μ.rnDeriv ν) s).toReal

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
[MeasureTheory.SigmaFinite μ]
[MeasureTheory.SFinite ν]
(s : Set α)

∫ (x : α) in s, (μ.rnDeriv ν x).toReal ∂ν = ((ν.withDensity (μ.rnDeriv ν)) s).toReal


@[to_additive]
theorem mul_mem_cancel_left {x y : G} (h : x ∈ H) : x * y ∈ H ↔ y ∈ H

{G : Type u_1}
[Group G]
{S : Type u_6}
{H : S}
[SetLike S G]
[SubgroupClass S G]
{x y : G}
(h : x ∈ H)


@[to_additive (attr := simp, norm_cast)]
theorem coe_one : ↑(1 : Finset α) = (1 : Set α)


@[simp]
theorem preimage_inter_codom_eq (s : Set β) : r.preimage (s ∩ r.codom) = r.preimage s

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


@[simp]
theorem toSubsemiring_subtype : S.toSubsemiring.subtype = (S.val : S →+* A)

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)


@[simp]
theorem piFinset_singleton (f : ∀ i, δ i) : piFinset (fun i => {f i} : ∀ i, Finset (δ i)) = {f}

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{δ : α → Type u_3}
(f : (i : α) → δ i)


/-- The induced functor `Sheaf K A ⥤ Sheaf J A` given by `F.op ⋙ _`
if `F` is a continuous functor.
-/
@[simps!]
def sheafPushforwardContinuous : Sheaf K A ⥤ Sheaf J A

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

∀ {X Y : Cᵒᵖ} (f : X ⟶ Y), ((F.sheafPushforwardContinuous A J K).obj ℱ).val.map f = ℱ.val.map (F.map f.unop).op


theorem prod_mem_nhds {s : Set X} {t : Set Y} {x : X} {y : Y} (hx : s ∈ 𝓝 x) (hy : t ∈ 𝓝 y) :
    s ×ˢ t ∈ 𝓝 (x, y)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{s : Set X}
{t : Set Y}
{x : X}
{y : Y}
(hx : s ∈ 𝓝 x)
(hy : t ∈ 𝓝 y)


theorem map'_id {M : ModuleCat.{v} R} : map' f (𝟙 M) = 𝟙 _

{R : Type u₁}
{S : Type u₂}
[CommRing R]
[CommRing S]
(f : R →+* S)
{M : ModuleCat R}

ModuleCat.ExtendScalars.map' f (𝟙 M) = 𝟙 (ModuleCat.ExtendScalars.obj' f M)


@[simp]
theorem card_Icc : (Icc a b).card = b + 1 - a


nonrec theorem Infinitesimal.neg {x : ℝ*} (hx : Infinitesimal x) : Infinitesimal (-x)


theorem isometry_vertical_line (a : ℝ) : Isometry fun y => mk ⟨a, exp y⟩ (exp_pos y)

Isometry fun y => UpperHalfPlane.mk { re := a, im := rexp y } ⋯


theorem symm_eq_on_of_inter_eq_of_eqOn {e' : PartialEquiv α β} (h : e.IsImage s t)
    (hs : e.source ∩ s = e'.source ∩ s) (heq : EqOn e e' (e.source ∩ s)) :
    EqOn e.symm e'.symm (e.target ∩ t)

(heq : Set.EqOn (↑e) (↑e') (e.source ∩ s))

Set.EqOn (↑e.symm) (↑e'.symm) (e.target ∩ t)


@[simp]
theorem one_add_kstar_mul_self_eq_kstar (l : Language α) : 1 + l∗ * l = l∗


protected theorem add_eq_zero_iff : n + m = 0 ↔ n = 0 ∧ m = 0


/-- A locally compact space is compactly generated. -/
theorem compactlyGenerated_of_weaklyLocallyCompactSpace [T2Space X] [WeaklyLocallyCompactSpace X]
    {s : Set X} : IsClosed s ↔ ∀ ⦃K⦄, IsCompact K → IsClosed (s ∩ K)

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]
[WeaklyLocallyCompactSpace X]
{s : Set X}

IsClosed s ↔ ∀ ⦃K : Set X⦄, IsCompact K → IsClosed (s ∩ K)


/-- The top-right evaluation `Square C ⥤ C`. -/
@[simps]
def evaluation₂ : Square C ⥤ C

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

CategoryTheory.Square.evaluation₂.obj sq = sq.X₂


@[simp, norm_cast]
theorem hausdorffDist_coe : Metric.hausdorffDist (K : Set V) L = dist K L

{V : Type u_1}
[SeminormedAddCommGroup V]
[NormedSpace ℝ V]
(K L : ConvexBody V)


theorem succ_add : ∀ (n m : Nat), (succ n) + m = succ (n + m)


/-- There are strictly fewer than `q^2` units, since `0` is not a unit. -/
nonrec theorem card_units_lt (w : 1 < q) : Fintype.card (X q)ˣ < q ^ 2

Fintype.card (LucasLehmer.X q)ˣ < ↑q ^ 2


theorem mapₗ_apply_of_measurable {f : α → β} (hf : Measurable f) (μ : Measure α) :
    mapₗ f μ = map f μ

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

(MeasureTheory.Measure.mapₗ f) μ = MeasureTheory.Measure.map f μ


theorem Ioi_eq_Ioc (a : α) : Ioi a = Ioc a ⊤

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


/-- If a symmetric operator preserves a submodule, its restriction to that submodule is
symmetric. -/
theorem IsSymmetric.restrict_invariant {T : E →ₗ[𝕜] E} (hT : IsSymmetric T) {V : Submodule 𝕜 E}
    (hV : ∀ v ∈ V, T v ∈ V) : IsSymmetric (T.restrict hV)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{T : E →ₗ[𝕜] E}
(hT : T.IsSymmetric)
{V : Submodule 𝕜 E}
(hV : ∀ v ∈ V, T v ∈ V)


/-- The morphism `K.restriction e ⟶ L.restriction e` induced by a morphism `φ : K ⟶ L`. -/
@[simps]
def restrictionMap : K.restriction e ⟶ L.restriction e

(HomologicalComplex.restrictionMap φ e).f i = φ.f (e.f i)


theorem set_compr_eq_eq_singleton {a : α} : { b | b = a } = {a}


theorem sinh_sub : sinh (x - y) = sinh x * cosh y - cosh x * sinh y

Complex.sinh (x - y) = Complex.sinh x * Complex.cosh y - Complex.cosh x * Complex.sinh y


@[simp, norm_cast]
theorem cast_zero [Zero α] [One α] [Add α] : ((0 : Num) : α) = 0


@[simp]
theorem nhds_bind_nhdsWithin {a : α} {s : Set α} : ((𝓝 a).bind fun x => 𝓝[s] x) = 𝓝[s] a

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


@[simp]
theorem sum_add_distrib' {ι} (f g : ι → Cardinal) :
    (Cardinal.sum fun i => f i + g i) = sum f + sum g

{ι : Type u_1}
(f g : ι → Cardinal.{u_2})

(Cardinal.sum fun i => f i + g i) = Cardinal.sum f + Cardinal.sum g


lemma IsPointwiseLeftKanExtension.isLeftKanExtension :
    E.right.IsLeftKanExtension E.hom

{C : Type u_1}
{D : Type u_2}
{H : Type u_3}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_6, u_2} D]
[CategoryTheory.Category.{u_5, u_3} H]
{L : CategoryTheory.Functor C D}
{F : CategoryTheory.Functor C H}
{E : L.LeftExtension F}
(h : E.IsPointwiseLeftKanExtension)


theorem mul_lt_mul_of_lt_of_le₀ (hab : a ≤ b) (hb : b ≠ 0) (hcd : c < d) : a * c < b * d

{α : Type u_1}
[LinearOrderedCommGroupWithZero α]
{a b c d : α}
(hab : a ≤ b)
(hb : b ≠ 0)
(hcd : c < d)


lemma nsmul (hxy : x ≡ y [SMOD U]) (n : ℕ) : n • x ≡ n • y [SMOD U]

{R : Type u_1}
[Ring R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{U : Submodule R M}
{x y : M}
(hxy : x ≡ y [SMOD U])
(n : ℕ)


@[to_additive]
theorem MonoidHom.cancel_right [MulOneClass M] [MulOneClass N] [MulOneClass P]
    {g₁ g₂ : N →* P} {f : M →* N} (hf : Function.Surjective f) :
    g₁.comp f = g₂.comp f ↔ g₁ = g₂

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass P]
{g₁ g₂ : N →+ P}
{f : M →+ N}
(hf : Function.Surjective ⇑f)


theorem forall_of_forall_insert {P : α → Prop} {a : α} {s : Set α} (H : ∀ x, x ∈ insert a s → P x)
    (x) (h : x ∈ s) : P x

{α : Type u}
{P : α → Prop}
{a : α}
{s : Set α}
(H : ∀ x ∈ insert a s, P x)
(x : α)
(h : x ∈ s)


/-- The cardinality of the complex numbers, as a type. -/
@[simp]
theorem mk_complex : #ℂ = 𝔠


@[simp]
theorem Iic_union_Icc_eq_Iic (h : a ≤ b) : Iic a ∪ Icc a b = Iic b

{α : Type u_1}
[LinearOrder α]
{a b : α}
(h : a ≤ b)


/-- Lower bound on the edge densities between non-uniform parts of `SzemerediRegularity.increment`.
-/
theorem edgeDensity_chunk_not_uniform [Nonempty α] (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α)
    (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5) (hε₁ : ε ≤ 1) {hU : U ∈ P.parts} {hV : V ∈ P.parts}
    (hUVne : U ≠ V) (hUV : ¬G.IsUniform ε U V) :
    (G.edgeDensity U V : ℝ) ^ 2 - ε ^ 5 / ↑25 + ε ^ 4 / ↑3 ≤
    (∑ ab ∈ (chunk hP G ε hU).parts.product (chunk hP G ε hV).parts,
      (G.edgeDensity ab.1 ab.2 : ℝ) ^ 2) / ↑16 ^ P.parts.card

(hPα : P.parts.card * 16 ^ P.parts.card ≤ Fintype.card α)

↑(G.edgeDensity U V) ^ 2 - ε ^ 5 / 25 + ε ^ 4 / 3 ≤
  (∑ ab ∈ (SzemerediRegularity.chunk hP G ε hU).parts.product (SzemerediRegularity.chunk hP G ε hV).parts,
      ↑(G.edgeDensity ab.1 ab.2) ^ 2) /
    16 ^ P.parts.card


@[to_additive (attr := simp, norm_cast)]
theorem toOpens_inf : (↑(U ⊓ V) : Opens G) = ↑U ⊓ ↑V

{G : Type u_1}
[Group G]
[TopologicalSpace G]
{U V : OpenSubgroup G}


@[simp]
theorem head_empty : head (empty α) = none


@[simp]
lemma num_zero : IsFractionRing.num A (0 : K) = 0

{A : Type u_4}
[CommRing A]
[IsDomain A]
[UniqueFactorizationMonoid A]
{K : Type u_5}
[Field K]
[Algebra A K]
[IsFractionRing A K]


@[simp]
theorem map_onFunction {M : Type*} [L.Structure M] [L'.Structure M] [ϕ.IsExpansionOn M] {n}
    (f : L.Functions n) (x : Fin n → M) : funMap (ϕ.onFunction f) x = funMap f x

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
(ϕ : L →ᴸ L')
{M : Type u_1}
[L.Structure M]
[L'.Structure M]
[ϕ.IsExpansionOn M]
{n : ℕ}
(f : L.Functions n)
(x : Fin n → M)

FirstOrder.Language.Structure.funMap (ϕ.onFunction f) x = FirstOrder.Language.Structure.funMap f x


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

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

Function.support (g ∘ f) = Function.support f


@[to_additive (attr := simp)]
theorem mem_fixedBy {m : M} {a : α} : a ∈ fixedBy α m ↔ m • a = a

{M : Type u}
[AddMonoid M]
{α : Type v}
[AddAction M α]
{m : M}
{a : α}


theorem isOpen_lt' [OrderTopology α] (a : α) : IsOpen { b : α | a < b }

{α : Type u}
[TopologicalSpace α]
[Preorder α]
[OrderTopology α]
(a : α)


theorem op {W : MorphismProperty C} {L : C ⥤ D} (h : W.IsInvertedBy L) : W.op.IsInvertedBy L.op

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u'}
[CategoryTheory.Category.{v', u'} D]
{W : CategoryTheory.MorphismProperty C}
{L : CategoryTheory.Functor C D}
(h : W.IsInvertedBy L)


/--
A *unital shelf* is a shelf equipped with an element `1` such that, for all elements `x`,
we have both `x ◃ 1` and `1 ◃ x` equal `x`.
-/
class UnitalShelf (α : Type u) extends Shelf α, One α :=
(one_act : ∀ a : α, act 1 a = a)
(act_one : ∀ a : α, act a 1 = a)

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


theorem and_assoc (x y z : BitVec w) :
    x &&& y &&& z = x &&& (y &&& z)


/-- Construct an augmented simplicial object from an augmented cosimplicial
object in the opposite category. -/
@[simps!]
def CosimplicialObject.Augmented.leftOp (X : CosimplicialObject.Augmented Cᵒᵖ) :
    SimplicialObject.Augmented C

(X : CategoryTheory.CosimplicialObject.Augmented Cᵒᵖ)

∀ (X_1 : SimplexCategoryᵒᵖ), X.leftOp.left.obj X_1 = Opposite.unop (X.right.obj (Opposite.unop X_1))


@[to_additive]
theorem Group.covariant_swap_iff_contravariant_swap [Group N] :
    Covariant N N (swap (· * ·)) r ↔ Contravariant N N (swap (· * ·)) r

{N : Type u_2}
{r : N → N → Prop}
[AddGroup N]

Covariant N N (Function.swap fun x x_1 => x + x_1) r ↔ Contravariant N N (Function.swap fun x x_1 => x + x_1) r


/-- Assumes right covariance.
The lemma assuming left covariance is `Left.mul_le_one`. -/
@[to_additive "Assumes right covariance.
The lemma assuming left covariance is `Left.add_nonpos`."]
theorem Right.mul_le_one [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a b : α} (ha : a ≤ 1)
    (hb : b ≤ 1) :
    a * b ≤ 1

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


@[to_additive sub_zsmul] lemma zpow_sub (a : G) (m n : ℤ) : a ^ (m - n) = a ^ m * (a ^ n)⁻¹

{G : Type u_3}
[AddGroup G]
(a : G)
(m n : ℤ)


/-- Every solution to **Pell's equation** is recursively obtained from the initial solution
`(1,0)` using the recursion `pell`. -/
theorem eq_pell {x y : ℕ} (hp : x * x - d a1 * y * y = 1) : ∃ n, x = xn a1 n ∧ y = yn a1 n

∃ n, x = Pell.xn a1 n ∧ y = Pell.yn a1 n


theorem StrictMono.maximal_preimage_top [LinearOrder α] [Preorder β] [OrderTop β] {f : α → β}
    (H : StrictMono f) {a} (h_top : f a = ⊤) (x : α) : x ≤ a

{α : Type u}
{β : Type v}
[LinearOrder α]
[Preorder β]
[OrderTop β]
{f : α → β}
(H : StrictMono f)
{a : α}
(h_top : f a = ⊤)
(x : α)


theorem Injective.surjective_comp_right' (hf : Injective f) (g₀ : β → γ) :
    Surjective fun g : β → γ ↦ g ∘ f

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{f : α → β}
(hf : Function.Injective f)
(g₀ : β → γ)


lemma restrictPreimage_bijective (hf : Bijective f) : Bijective (t.restrictPreimage f)

{α : Type u_1}
{β : Type u_2}
(t : Set β)
{f : α → β}
(hf : Function.Bijective f)


theorem hasInitialChangeDiagram (h : HasColimit F₁) : HasColimit F₂

{F₁ : CategoryTheory.Discrete PEmpty.{w + 1} ⥤ C}

{F₂ : CategoryTheory.Discrete PEmpty.{w' + 1} ⥤ C}

(h : CategoryTheory.Limits.HasColimit F₁)


/-- A monoidal natural transformation is a natural transformation between (lax) monoidal functors
additionally satisfying:
`F.μ X Y ≫ app (X ⊗ Y) = (app X ⊗ app Y) ≫ G.μ X Y`
-/
@[ext]
structure MonoidalNatTrans (F G : LaxMonoidalFunctor C D) extends
  NatTrans F.toFunctor G.toFunctor where
  /-- The unit condition for a monoidal natural transformation. -/
  unit : F.ε ≫ app (𝟙_ C) = G.ε := by aesop_cat
  /-- The tensor condition for a monoidal natural transformation. -/
  tensor : ∀ X Y, F.μ _ _ ≫ app (X ⊗ Y) = (app X ⊗ app Y) ≫ G.μ _ _ := by aesop_cat

{F G : CategoryTheory.LaxMonoidalFunctor C D}

(self : CategoryTheory.MonoidalNatTrans F G)


@[to_additive]
theorem closure_mul_le (S T : Set G) : closure (S * T) ≤ closure S ⊔ closure T

Subgroup.closure (S * T) ≤ Subgroup.closure S ⊔ Subgroup.closure T


theorem cyclotomic.roots_eq_primitiveRoots_val [NeZero (n : R)] :
    (cyclotomic n R).roots = (primitiveRoots n R).val

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

(Polynomial.cyclotomic n R).roots = (primitiveRoots n R).val


/-- A version of `IsEmpty` with few instances. It should fail fast. -/
class FastIsEmpty (α : Sort u) : Prop where
  [inst : IsEmpty α]

{α : Sort u}
[self : Lean.Meta.FastIsEmpty α]


theorem iInf [CompleteLattice β] [Countable ι] (hf : ∀ i, AEMeasurable (f i) μ)
    (hp : ∀ᵐ x ∂μ, p x fun n ↦ f n x) : ⨅ n, aeSeq hf p n =ᵐ[μ] ⨅ n, f n

{f : ι → α → β}

(hp : ∀ᵐ (x : α) ∂μ, p x fun n => f n x)


@[symm]
theorem symm ⦃f g : C(X, Y)⦄ (h : Homotopic f g) : Homotopic g f

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
⦃f g : C(X, Y)⦄
(h : f.Homotopic g)


theorem map_isGreatest (hf : LeftOrdContinuous f) {s : Set α} {x : α} (h : IsGreatest s x) :
    IsGreatest (f '' s) (f x)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
(hf : LeftOrdContinuous f)
{s : Set α}
{x : α}
(h : IsGreatest s x)


/-- A cofan over `f : β → C` consists of a collection of maps from every `f b` to an object `P`. -/
@[simps! pt ι_app]
def Cofan.mk {f : β → C} (P : C) (p : ∀ b, f b ⟶ P) : Cofan f

{β : Type w}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{f : β → C}
(P : C)
(p : (b : β) → f b ⟶ P)
(X : CategoryTheory.Discrete β)

(CategoryTheory.Limits.Cofan.mk P p).ι.app X = p X.as


@[simp]
theorem frontier_Ici' {a : α} (ha : (Iio a).Nonempty) : frontier (Ici a) = {a}

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
{a : α}
(ha : (Set.Iio a).Nonempty)


theorem ite_some_none_eq_none [Decidable P] :
    (if P then some x else none) = none ↔ ¬ P

∀ {α : Type u_1} {x : α} [inst : Decidable P], (if P then some x else none) = none ↔ ¬P


theorem genericPoint_spec [QuasiSober α] [IrreducibleSpace α] :
    IsGenericPoint (genericPoint α) ⊤

(α : Type u_1)
[TopologicalSpace α]
[QuasiSober α]
[IrreducibleSpace α]


@[to_additive]
theorem monotone_map {f : M →ₙ* N} : Monotone (map f)

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{f : M →ₙ* N}


@[to_additive]
theorem union_mul_inter_subset_union : (s₁ ∪ s₂) * (t₁ ∩ t₂) ⊆ s₁ * t₁ ∪ s₂ * t₂

{α : Type u_2}
[Add α]
{s₁ s₂ t₁ t₂ : Set α}


@[to_additive]
theorem le_normalizer : H ≤ normalizer H

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


/-- Since a hom gives a loop, any homomorphism from the vertex group at the root
    extends to a functor on the whole groupoid. -/
@[simps]
def functorOfMonoidHom {X} [Monoid X] (f : End (root' T) →* X) :
    G ⥤ CategoryTheory.SingleObj X

(T : WideSubquiver (Quiver.Symmetrify (IsFreeGroupoid.Generators G)))

[Quiver.Arborescence (WideSubquiver.toType (Quiver.Symmetrify (IsFreeGroupoid.Generators G)) T)]

(f : CategoryTheory.End (IsFreeGroupoid.SpanningTree.root' T) →* X)

∀ (x : G), (IsFreeGroupoid.SpanningTree.functorOfMonoidHom T f).obj x = ()


/-- A function `f : α × β → StieltjesFunction` is called a conditional kernel CDF of `κ` with
respect to `ν` if it is measurable, tends to to 0 at -∞ and to 1 at +∞ for all `p : α × β`,
`fun b ↦ f (a, b) x` is `(ν a)`-integrable for all `a : α` and `x : ℝ` and for all
measurable sets `s : Set β`, `∫ b in s, f (a, b) x ∂(ν a) = (κ a (s ×ˢ Iic x)).toReal`. -/
structure IsCondKernelCDF (f : α × β → StieltjesFunction) (κ : Kernel α (β × ℝ)) (ν : Kernel α β) :
    Prop :=
  measurable (x : ℝ) : Measurable fun p ↦ f p x
  integrable (a : α) (x : ℝ) : Integrable (fun b ↦ f (a, b) x) (ν a)
  tendsto_atTop_one (p : α × β) : Tendsto (f p) atTop (𝓝 1)
  tendsto_atBot_zero (p : α × β) : Tendsto (f p) atBot (𝓝 0)
  setIntegral (a : α) {s : Set β} (_hs : MeasurableSet s) (x : ℝ) :
    ∫ b in s, f (a, b) x ∂(ν a) = (κ a (s ×ˢ Iic x)).toReal

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

(self : ProbabilityTheory.IsCondKernelCDF f κ ν)

MeasureTheory.Integrable (fun b => ↑(f (a, b)) x) (ν a)


theorem zero_cpow_eq_iff {x : ℂ} {a : ℂ} : (0 : ℂ) ^ x = a ↔ x ≠ 0 ∧ a = 0 ∨ x = 0 ∧ a = 1

0 ^ x = a ↔ x ≠ 0 ∧ a = 0 ∨ x = 0 ∧ a = 1


@[to_additive]
theorem Multipliable.multipliable_of_eq_one_or_self (hf : Multipliable f)
    (h : ∀ b, g b = 1 ∨ g b = f b) : Multipliable g

{α : Type u_1}
{β : Type u_2}
[CommGroup α]
[UniformSpace α]
[UniformGroup α]
{f g : β → α}
[CompleteSpace α]
(hf : Multipliable f)
(h : ∀ (b : β), g b = 1 ∨ g b = f b)


theorem IsLocalization.for_id (hW : W ≤ MorphismProperty.isomorphisms C) : (𝟭 C).IsLocalization W

(hW : W ≤ CategoryTheory.MorphismProperty.isomorphisms C)


theorem rank_strictAnti [Preorder α] [WellFoundedGT α] :
    StrictAnti (rank <| @wellFounded_gt α _ _)

{α : Type u}
[Preorder α]
[WellFoundedGT α]


theorem Finset.centroid_mem_convexHull (s : Finset E) (hs : s.Nonempty) :
    s.centroid R id ∈ convexHull R (s : Set E)

{R : Type u_1}
{E : Type u_3}
[LinearOrderedField R]
[AddCommGroup E]
[Module R E]
(s : Finset E)
(hs : s.Nonempty)

Finset.centroid R s id ∈ (convexHull R) ↑s


/-- The embedding of `C` into `Mat_ C` as one-by-one matrices.
(We index the summands by `PUnit`.) -/
@[simps]
def embedding : C ⥤ Mat_ C

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

((CategoryTheory.Mat_.embedding C).obj X).fintype = PUnit.fintype


@[simp]
theorem trans_apply (e₁ : A ≃⋆+* B) (e₂ : B ≃⋆+* C) (x : A) : (e₁.trans e₂) x = e₂ (e₁ x)

{A : Type u_1}
{B : Type u_2}
{C : Type u_3}
[Add A]
[Add B]
[Mul A]
[Mul B]
[Star A]
[Star B]
[Add C]
[Mul C]
[Star C]
(e₁ : A ≃⋆+* B)
(e₂ : B ≃⋆+* C)
(x : A)


theorem leftLim_le (h : x < y) : leftLim f y ≤ f x

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[ConditionallyCompleteLinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
{f : α → β}
(hf : Antitone f)
{x y : α}
(h : x < y)


theorem eq_pure_of_finite [Finite α] (f : Ultrafilter α) : ∃ a, f = pure a

{α : Type u}
[Finite α]
(f : Ultrafilter α)


/-- `AbsoluteValue R S` is the type of absolute values on `R` mapping to `S`:
the maps that preserve `*`, are nonnegative, positive definite and satisfy the triangle equality. -/
structure AbsoluteValue (R S : Type*) [Semiring R] [OrderedSemiring S] extends R →ₙ* S where
  /-- The absolute value is nonnegative -/
  nonneg' : ∀ x, 0 ≤ toFun x
  /-- The absolute value is positive definitive -/
  eq_zero' : ∀ x, toFun x = 0 ↔ x = 0
  /-- The absolute value satisfies the triangle inequality -/
  add_le' : ∀ x y, toFun (x + y) ≤ toFun x + toFun y

{R : Type u_5}
{S : Type u_6}
[Semiring R]
[OrderedSemiring S]
(self : AbsoluteValue R S)
(x y : R)

self.toFun (x + y) ≤ self.toFun x + self.toFun y


/-- Class of composing triples -/
class CompTriple  {M N P : Type*} [Monoid M] [Monoid N] [Monoid P]
  (φ : M →* N) (ψ : N →* P) (χ : outParam (M →* P)) : Prop where
  /-- The maps form a commuting triangle -/
  comp_eq : ψ.comp φ = χ

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[Monoid M]
[Monoid N]
[Monoid P]
{φ : M →* N}
{ψ : N →* P}
{χ : outParam (M →* P)}
[self : φ.CompTriple ψ χ]


theorem lintegral_edist_lt_top {f g : α → β} (hf : Integrable f μ) (hg : Integrable g μ) :
    (∫⁻ a, edist (f a) (g a) ∂μ) < ∞

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{f g : α → β}
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)


@[to_additive]
lemma update_smul [∀ i, SMul M (α i)] [DecidableEq ι] (c : M) (f₁ : ∀ i, α i)
    (i : ι) (x₁ : α i) : update (c • f₁) i (c • x₁) = c • update f₁ i x₁

{ι : Type u_1}
{M : Type u_2}
{α : ι → Type u_4}
[(i : ι) → SMul M (α i)]
[DecidableEq ι]
(c : M)
(f₁ : (i : ι) → α i)
(i : ι)
(x₁ : α i)

Function.update (c • f₁) i (c • x₁) = c • Function.update f₁ i x₁


@[ext]
theorem ext {b₁ b₂ : AffineBasis ι k P} (h : (b₁ : ι → P) = b₂) : b₁ = b₂

{ι : Type u_1}
{k : Type u_3}
{V : Type u_4}
{P : Type u_5}
[AddCommGroup V]
[AffineSpace V P]
[Ring k]
[Module k V]
{b₁ b₂ : AffineBasis ι k P}
(h : ⇑b₁ = ⇑b₂)


@[to_additive]
theorem image_subgroup {f : G → H} (hf : IsGroupHom f) {s : Set G} (hs : IsSubgroup s) :
    IsSubgroup (f '' s)

{G : Type u_1}
{H : Type u_2}
[Group G]
[Group H]
{f : G → H}
(hf : IsGroupHom f)
{s : Set G}
(hs : IsSubgroup s)


theorem uniformity_additive : 𝓤 (Additive α) = (𝓤 α).map (Prod.map ofMul ofMul)

𝓤 (Additive α) = Filter.map (Prod.map ⇑Additive.ofMul ⇑Additive.ofMul) (𝓤 α)


theorem mem_vsub : a ∈ s -ᵥ t ↔ ∃ x ∈ s, ∃ y ∈ t, x -ᵥ y = a

{α : Type u_2}
{β : Type u_3}
[VSub α β]
{s t : Set β}
{a : α}


@[simp]
theorem coe_completion {_ : MeasurableSpace α} (μ : Measure α) : ⇑μ.completion = μ

∀ {x : MeasurableSpace α} (μ : MeasureTheory.Measure α), ⇑μ.completion = ⇑μ


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

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


protected theorem pos_of_neg_neg {a : Int} (h : -a < 0) : 0 < a


/-- If a function is polynomial on a set `s`, so are its successive derivatives. -/
theorem CPolynomialOn.iterated_deriv (h : CPolynomialOn 𝕜 f s) (n : ℕ) :
    CPolynomialOn 𝕜 (deriv^[n] f) s

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


theorem EventuallyEq.inf [Inf β] {l : Filter α} {f f' g g' : α → β} (hf : f =ᶠ[l] f')
    (hg : g =ᶠ[l] g') : (fun x => f x ⊓ g x) =ᶠ[l] fun x => f' x ⊓ g' x

{α : Type u}
{β : Type v}
[Inf β]
{l : Filter α}
{f f' g g' : α → β}
(hf : f =ᶠ[l] f')
(hg : g =ᶠ[l] g')


theorem preimage_closedBall (hf : Isometry f) (x : α) (r : ℝ) :
    f ⁻¹' Metric.closedBall (f x) r = Metric.closedBall x r

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{f : α → β}
(hf : Isometry f)
(x : α)
(r : ℝ)


@[simp]
theorem star_prod [CommMonoid R] [StarMul R] {α : Type*} (s : Finset α) (f : α → R) :
    star (∏ x ∈ s, f x) = ∏ x ∈ s, star (f x)

{R : Type u_1}
[CommMonoid R]
[StarMul R]
{α : Type u_2}
(s : Finset α)
(f : α → R)


@[simp]
lemma preimage_coe_Ico (x y : ℝ) : Real.toEReal ⁻¹' Ico x y = Ico x y

Real.toEReal ⁻¹' Set.Ico ↑x ↑y = Set.Ico x y


@[to_additive] -- `simp` can prove this
theorem mem_sphere_one_iff_norm : a ∈ sphere (1 : E) r ↔ ‖a‖ = r

{E : Type u_6}
[SeminormedGroup E]
{a : E}
{r : ℝ}


/-- If `E / F` is a separable field extension of exponential characteristic `q`, then
`F(S) = F(S ^ q)` for any subset `S` of `E`. -/
theorem adjoin_eq_adjoin_pow_expChar_of_isSeparable' [Algebra.IsSeparable F E] (S : Set E)
    (q : ℕ) [ExpChar F q] : adjoin F S = adjoin F ((· ^ q) '' S)

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
[Algebra.IsSeparable F E]
(S : Set E)
(q : ℕ)
[ExpChar F q]

IntermediateField.adjoin F S = IntermediateField.adjoin F ((fun x => x ^ q) '' S)


protected theorem dvd_mul_left (a b : Nat) : a ∣ b * a


@[simp]
theorem orElse_empty (c : Computation α) : (c <|> empty α) = c

(HOrElse.hOrElse c fun x => Computation.empty α) = c


@[simp] theorem msb_ofBool (b : Bool) : (ofBool b).msb = b


theorem SOppSide.exists_sbtw {s : AffineSubspace R P} {x y : P} (h : s.SOppSide x y) :
    ∃ p ∈ s, Sbtw R x p y

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y : P}
(h : s.SOppSide x y)


/-- The sheafification functor, as a functor taking values in `Sheaf`. -/
@[simps]
noncomputable def plusPlusSheaf : (Cᵒᵖ ⥤ D) ⥤ Sheaf J D

(J : CategoryTheory.GrothendieckTopology C)

[CategoryTheory.Category.{max v u, w} D]

[∀ (P : CategoryTheory.Functor Cᵒᵖ D) (X : C) (S : J.Cover X), CategoryTheory.Limits.HasMultiequalizer (S.index P)]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ D]

[(X : C) → CategoryTheory.Limits.PreservesColimitsOfShape (J.Cover X)ᵒᵖ (CategoryTheory.forget D)]

((CategoryTheory.plusPlusSheaf J D).obj P).val = J.sheafify P


/-- The symbol `J(a | b)` vanishes iff `a` and `b` are not coprime (assuming `b ≠ 0`). -/
theorem eq_zero_iff_not_coprime {a : ℤ} {b : ℕ} [NeZero b] : J(a | b) = 0 ↔ a.gcd b ≠ 1


@[simp]
theorem toDual_apply_bot : WithBot.toDual (⊥ : WithBot α) = ⊤


/-- An `sl₂` triple within a Lie ring `L` is a triple of elements `h`, `e`, `f` obeying relations
which ensure that the Lie subalgebra they generate is equivalent to `sl₂`. -/
structure IsSl2Triple (h e f : L) : Prop where
  h_ne_zero : h ≠ 0
  lie_e_f : ⁅e, f⁆ = h
  lie_h_e_nsmul : ⁅h, e⁆ = 2 • e
  lie_h_f_nsmul : ⁅h, f⁆ = - (2 • f)

{L : Type u_2}
[LieRing L]
{h e f : L}
(self : IsSl2Triple h e f)


theorem uniformEquicontinuousOn_iInf_dom {u : κ → UniformSpace β'} {F : ι → β' → α}
    {S : Set β'} {k : κ} (hk : UniformEquicontinuousOn (uβ := u k) F S) :
    UniformEquicontinuousOn (uβ := ⨅ k, u k) F S

{ι : Type u_1}
{κ : Type u_2}
{α : Type u_7}
{β' : Type u_10}
[uα : UniformSpace α]
{u : κ → UniformSpace β'}
{F : ι → β' → α}
{S : Set β'}
{k : κ}
(hk : UniformEquicontinuousOn F S)


@[simp]
theorem comap_closedPoint {S : Type v} [CommSemiring S] [LocalRing S] (f : R →+* S)
    [IsLocalRingHom f] : PrimeSpectrum.comap f (closedPoint S) = closedPoint R

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

(PrimeSpectrum.comap f) (LocalRing.closedPoint S) = LocalRing.closedPoint R


theorem modifyNthTail_modifyNthTail_same {f g : List α → List α} (n : ℕ) (l : List α) :
    (l.modifyNthTail f n).modifyNthTail g n = l.modifyNthTail (g ∘ f) n

{α : Type u}
{f g : List α → List α}
(n : ℕ)
(l : List α)

List.modifyNthTail g n (List.modifyNthTail f n l) = List.modifyNthTail (g ∘ f) n l


@[fun_prop]
theorem continuousAt_id' (y) : ContinuousAt (fun x : X => x) y

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


/-- Inversion `x ↦ x⁻¹` as an `IsometryEquiv`. -/
@[to_additive (attr := simps! apply toEquiv) "Negation `x ↦ -x` as an `IsometryEquiv`."]
def inv : G ≃ᵢ G

(G : Type v)
[AddGroup G]
[PseudoEMetricSpace G]
[IsometricVAdd G G]
[IsometricVAdd Gᵃᵒᵖ G]

(IsometryEquiv.neg G).toEquiv = Equiv.neg G


theorem nth_lt_nth_of_lt_card (hf : (setOf p).Finite) {m n : ℕ} (h : m < n)
    (hn : n < hf.toFinset.card) : nth p m < nth p n

{p : ℕ → Prop}
(hf : (setOf p).Finite)
{m n : ℕ}
(h : m < n)
(hn : n < hf.toFinset.card)


lemma part_eq_of_mem (ht : t ∈ P.parts) (hat : a ∈ t) : P.part a = t

{α : Type u_1}
[DecidableEq α]
{s t : Finset α}
(P : Finpartition s)
{a : α}
(ht : t ∈ P.parts)
(hat : a ∈ t)


/-- **Church-Rosser theorem** for word reduction: If `w1 w2 w3` are words such that `w1` reduces
to `w2` and `w3` respectively, then there is a word `w4` such that `w2` and `w3` reduce to `w4`
respectively. This is also known as Newman's diamond lemma. -/
@[to_additive
  "**Church-Rosser theorem** for word reduction: If `w1 w2 w3` are words such that `w1` reduces
  to `w2` and `w3` respectively, then there is a word `w4` such that `w2` and `w3` reduce to `w4`
  respectively. This is also known as Newman's diamond lemma."]
theorem church_rosser : Red L₁ L₂ → Red L₁ L₃ → Join Red L₂ L₃

{α : Type u}
{L₁ L₂ L₃ : List (α × Bool)}

FreeAddGroup.Red L₁ L₂ → FreeAddGroup.Red L₁ L₃ → Relation.Join FreeAddGroup.Red L₂ L₃


/-- The equivalence from algebras for the coproduct monad to the under category.
-/
@[simps]
def algebraEquivUnder : Monad.Algebra (coprodMonad X) ≌ Under X

(CategoryTheory.algebraEquivUnder X).counitIso =
  CategoryTheory.NatIso.ofComponents
    (fun f =>
      CategoryTheory.Under.isoMk
        (CategoryTheory.Iso.refl
          (((CategoryTheory.underToAlgebra X).comp (CategoryTheory.algebraToUnder X)).obj f).right)
        ⋯)
    ⋯


lemma ext₃ {f g : ComposableArrows C 3}
    (h₀ : f.obj' 0 = g.obj' 0) (h₁ : f.obj' 1 = g.obj' 1) (h₂ : f.obj' 2 = g.obj' 2)
    (h₃ : f.obj' 3 = g.obj' 3)
    (w₀ : f.map' 0 1 = eqToHom h₀ ≫ g.map' 0 1 ≫ eqToHom h₁.symm)
    (w₁ : f.map' 1 2 = eqToHom h₁ ≫ g.map' 1 2 ≫ eqToHom h₂.symm)
    (w₂ : f.map' 2 3 = eqToHom h₂ ≫ g.map' 2 3 ≫ eqToHom h₃.symm) : f = g

{f g : CategoryTheory.ComposableArrows C 3}

(w₀ :
  f.map' 0 1 ⋯ ⋯ =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom h₀)
      (CategoryTheory.CategoryStruct.comp (g.map' 0 1 ⋯ ⋯) (CategoryTheory.eqToHom ⋯)))

(w₁ :
  f.map' 1 2 ⋯ ⋯ =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom h₁)
      (CategoryTheory.CategoryStruct.comp (g.map' 1 2 ⋯ ⋯) (CategoryTheory.eqToHom ⋯)))

(w₂ :
  f.map' 2 3 ⋯ ⋯ =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom h₂)
      (CategoryTheory.CategoryStruct.comp (g.map' 2 3 ⋯ ⋯) (CategoryTheory.eqToHom ⋯)))


theorem mem_sSup_of_directed {s : Set (Submodule R M)} {z} (hs : s.Nonempty)
    (hdir : DirectedOn (· ≤ ·) s) : z ∈ sSup s ↔ ∃ y ∈ s, z ∈ y

(hdir : DirectedOn (fun x x_1 => x ≤ x_1) s)


theorem tendsto_order [OrderTopology α] {f : β → α} {a : α} {x : Filter β} :
    Tendsto f x (𝓝 a) ↔ (∀ a' < a, ∀ᶠ b in x, a' < f b) ∧ ∀ a' > a, ∀ᶠ b in x, f b < a'

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder α]
[OrderTopology α]
{f : β → α}
{a : α}
{x : Filter β}

Filter.Tendsto f x (𝓝 a) ↔ (∀ a' < a, ∀ᶠ (b : β) in x, a' < f b) ∧ ∀ a' > a, ∀ᶠ (b : β) in x, f b < a'


@[norm_cast]
theorem add_to_nat : ∀ m n, ((m + n : PosNum) : ℕ) = m + n


lemma exists_eq_of_iSup_eq_of_not_isLimit
    {ι : Type u} [hι : Nonempty ι] (f : ι → Cardinal.{v}) (hf : BddAbove (range f))
    (ω : Cardinal.{v}) (hω : ¬ ω.IsLimit)
    (h : ⨆ i : ι, f i = ω) : ∃ i, f i = ω

{ι : Type u}
[hι : Nonempty ι]
(f : ι → Cardinal.{v})
(hf : BddAbove (Set.range f))
(ω : Cardinal.{v})
(hω : ¬ω.IsLimit)
(h : ⨆ i, f i = ω)


lemma iSup_ringCon {ι : Type*} (I : ι → TwoSidedIdeal R) :
    (⨆ i, I i).ringCon = ⨆ i, (I i).ringCon

(R : Type u_1)
[NonUnitalNonAssocRing R]
{ι : Type u_2}
(I : ι → TwoSidedIdeal R)


/-- A normed group is an additive group endowed with a norm for which `dist x y = ‖x - y‖` defines a
metric space structure. -/
class NormedAddCommGroup (E : Type*) extends Norm E, AddCommGroup E, MetricSpace E where
  dist := fun x y => ‖x - y‖
  /-- The distance function is induced by the norm. -/
  dist_eq : ∀ x y, dist x y = ‖x - y‖ := by aesop

{E : Type u_9}
[self : NormedAddCommGroup E]
(x y : E)


/-- # get lemmas -/

theorem getElem?_mem {l : Array α} {i : Fin l.size} : l[i] ∈ l

{α : Type u_1}
{l : Array α}
{i : Fin l.size}


@[to_additive (attr := simp) cmp_add_right]
theorem cmp_mul_right' {α : Type*} [Mul α] [LinearOrder α]
    [CovariantClass α α (swap (· * ·)) (· < ·)] (a b c : α) :
    cmp (a * c) (b * c) = cmp a b

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


/-- Forward direction of Vitali's convergence theorem:
if `f` is a sequence of uniformly integrable, uniformly tight functions that converge in
measure to some function `g` in a finite measure space, then `f` converge in Lp to `g`. -/
theorem tendsto_Lp_of_tendstoInMeasure (hp : 1 ≤ p) (hp' : p ≠ ∞)
    (hf : ∀ n, AEStronglyMeasurable (f n) μ) (hg : Memℒp g p μ)
    (hui : UnifIntegrable f p μ) (hut : UnifTight f p μ)
    (hfg : TendstoInMeasure μ f atTop g) : Tendsto (fun n ↦ eLpNorm (f n - g) p μ) atTop (𝓝 0)

{f : ℕ → α → β}

(hf : ∀ (n : ℕ), MeasureTheory.AEStronglyMeasurable (f n) μ)

(hui : MeasureTheory.UnifIntegrable f p μ)

(hfg : MeasureTheory.TendstoInMeasure μ f Filter.atTop g)

Filter.Tendsto (fun n => MeasureTheory.eLpNorm (f n - g) p μ) Filter.atTop (nhds 0)


theorem ne_none_iff {o : Part α} : o ≠ none ↔ ∃ x, o = some x


theorem UniformSpace.comap_iInf {ι α γ} {u : ι → UniformSpace γ} {f : α → γ} :
    (⨅ i, u i).comap f = ⨅ i, (u i).comap f

{ι : Sort u_2}
{α : Type u_3}
{γ : Type u_4}
{u : ι → UniformSpace γ}
{f : α → γ}

UniformSpace.comap f (⨅ i, u i) = ⨅ i, UniformSpace.comap f (u i)


/-- Note that this is an equality of elements of `ℝ≥0∞`. See also
`MeasureTheory.FiniteMeasure.map_apply` for the corresponding equality as elements of `ℝ≥0`. -/
lemma map_apply' (ν : FiniteMeasure Ω) {f : Ω → Ω'} (f_aemble : AEMeasurable f ν)
    {A : Set Ω'} (A_mble : MeasurableSet A) :
    (ν.map f : Measure Ω') A = (ν : Measure Ω) (f ⁻¹' A)

{Ω : Type u_1}
{Ω' : Type u_2}
[MeasurableSpace Ω]
[MeasurableSpace Ω']
(ν : MeasureTheory.FiniteMeasure Ω)
{f : Ω → Ω'}
(f_aemble : AEMeasurable f ↑ν)
{A : Set Ω'}
(A_mble : MeasurableSet A)


/-- **No wrap-around principle**.

The first `k + 1` elements of `Fin (n + 1)` are `m`-Freiman isomorphic to the first `k + 1` elements
of `ℕ` assuming there is no wrap-around. -/
lemma isAddFreimanIso_Iic (hm : m ≠ 0) (hkmn : m * k ≤ n) :
    IsAddFreimanIso m (Iic (k : Fin (n + 1))) (Iic k) val

{k m n : ℕ}
(hm : m ≠ 0)
(hkmn : m * k ≤ n)

IsAddFreimanIso m (Set.Iic ↑k) (Set.Iic k) Fin.val


theorem last_append1 {α : TypeVec n} {β : Type*} : last (append1 α β) = β

{n : ℕ}
{α : TypeVec.{u_1} n}
{β : Type u_1}


@[simp]
theorem isOpen_interior : IsOpen (interior s)

{X : Type u}
{s : Set X}
[TopologicalSpace X]


/-- Construct limit data for a binary product in `AddCommGrp`, using
`AddCommGrp.of (G × H)`.
-/
@[simps cone_pt isLimit_lift]
def binaryProductLimitCone (G H : AddCommGrp.{u}) : Limits.LimitCone (pair G H)

(G.binaryProductLimitCone H).cone.pt = AddCommGrp.of (↑G × ↑H)


theorem two_lt_ncard_iff (hs : s.Finite := by toFinite_tac) :
    2 < s.ncard ↔ ∃ a b c, a ∈ s ∧ b ∈ s ∧ c ∈ s ∧ a ≠ b ∧ a ≠ c ∧ b ≠ c

{α : Type u_1}
{s : Set α}
(hs : s.Finite := by toFinite_tac)


theorem LinearMap.toMatrixAlgEquiv'_comp (f g : (n → R) →ₗ[R] n → R) :
    LinearMap.toMatrixAlgEquiv' (f.comp g) =
      LinearMap.toMatrixAlgEquiv' f * LinearMap.toMatrixAlgEquiv' g

{R : Type u_1}
[CommSemiring R]
{n : Type u_5}
[DecidableEq n]
[Fintype n]
(f g : (n → R) →ₗ[R] n → R)

LinearMap.toMatrixAlgEquiv' (f ∘ₗ g) = LinearMap.toMatrixAlgEquiv' f * LinearMap.toMatrixAlgEquiv' g


theorem clusterPt_iff_forall_mem_closure {F : Filter X} :
    ClusterPt x F ↔ ∀ s ∈ F, x ∈ closure s

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


theorem submatrix_sub [Sub α] (A B : Matrix m n α) :
    ((A - B).submatrix : (l → m) → (o → n) → Matrix l o α) = A.submatrix - B.submatrix

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[Sub α]
(A B : Matrix m n α)

(A - B).submatrix = A.submatrix - B.submatrix


/-- If `f` is convex on a set `s` in a linearly ordered field, and `f x < f y` for two points
`x < y` in `s`, then `f` is strictly monotone on `s ∩ [y, ∞)`. -/
theorem ConvexOn.strict_mono_of_lt (hf : ConvexOn 𝕜 s f) {x y : 𝕜} (hx : x ∈ s) (hxy : x < y)
    (hxy' : f x < f y) : StrictMonoOn f (s ∩ Set.Ici y)

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


/-- A `V`-functor `F` between `V`-enriched categories
has a `V`-morphism from `X ⟶[V] Y` to `F.obj X ⟶[V] F.obj Y`,
satisfying the usual axioms.
-/
structure EnrichedFunctor (C : Type u₁) [EnrichedCategory V C] (D : Type u₂)
    [EnrichedCategory V D] where
  obj : C → D
  map : ∀ X Y : C, (X ⟶[V] Y) ⟶ obj X ⟶[V] obj Y
  map_id : ∀ X : C, eId V X ≫ map X X = eId V (obj X) := by aesop_cat
  map_comp :
    ∀ X Y Z : C,
      eComp V X Y Z ≫ map X Z = (map X Y ⊗ map Y Z) ≫ eComp V (obj X) (obj Y) (obj Z) := by
    aesop_cat

(self : CategoryTheory.EnrichedFunctor V C D)

CategoryTheory.CategoryStruct.comp (CategoryTheory.eId V X) (self.map X X) = CategoryTheory.eId V (self.obj X)


@[to_additive]
theorem le_ciInf_mul_ciInf [CovariantClass α α (· * ·) (· ≤ ·)]
    [CovariantClass α α (Function.swap (· * ·)) (· ≤ ·)] {a : α} {g : ι → α} {h : ι' → α}
    (H : ∀ i j, a ≤ g i * h j) : a ≤ iInf g * iInf h

[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]


theorem exists_eq_one_ne_zero_of_ne_zero_pair {x y : V} (hx : x ≠ 0) (hy : y ≠ 0) :
    ∃ f : V →L[R] R, f x = 1 ∧ f y ≠ 0

{R : Type u_1}
{V : Type u_2}
[Field R]
[AddCommGroup V]
[TopologicalSpace R]
[TopologicalSpace V]
[TopologicalRing R]
[Module R V]
[SeparatingDual R V]
{x y : V}
(hx : x ≠ 0)
(hy : y ≠ 0)


@[to_additive]
theorem smoothOn_finset_prod (h : ∀ i ∈ t, SmoothOn I' I (f i) s) :
    SmoothOn I' I (fun x => ∏ i ∈ t, f i x) s

{ι : Type u_1}
{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{H : Type u_3}
[TopologicalSpace H]
{E : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_5}
[AddCommMonoid G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothAdd I G]
{E' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_7}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H' M]
{s : Set M}
{t : Finset ι}
{f : ι → M → G}
(h : ∀ i ∈ t, SmoothOn I' I (f i) s)

SmoothOn I' I (fun x => ∑ i ∈ t, f i x) s


protected theorem finite_set [FiniteDimensional k V] {s : Set ι} (b : AffineBasis s k P) :
    s.Finite

{ι : Type u₁}
{k : Type u₂}
{V : Type u₃}
{P : Type u₄}
[AddCommGroup V]
[AffineSpace V P]
[DivisionRing k]
[Module k V]
[FiniteDimensional k V]
{s : Set ι}
(b : AffineBasis (↑s) k P)


protected theorem Finite.wellFoundedOn (hs : s.Finite) : s.WellFoundedOn r

{α : Type u_2}
{r : α → α → Prop}
[IsStrictOrder α r]
{s : Set α}
(hs : s.Finite)


@[to_additive]
theorem measure_eq_tsum (h : IsFundamentalDomain G s μ) (t : Set α) :
    μ t = ∑' g : G, μ (g • t ∩ s)

[MeasureTheory.VAddInvariantMeasure G α μ]

(h : MeasureTheory.IsAddFundamentalDomain G s μ)


/-- The canonical map from the type to the free group is an injection. -/
@[to_additive "The canonical map from the type to the additive free group is an injection."]
theorem of_injective : Function.Injective (@of α)


theorem StrictConvex.mem_smul_of_zero_mem (hs : StrictConvex 𝕜 s) (zero_mem : (0 : E) ∈ s)
    (hx : x ∈ s) (hx₀ : x ≠ 0) {t : 𝕜} (ht : 1 < t) : x ∈ t • interior s

{𝕜 : Type u_1}
{E : Type u_3}
[LinearOrderedField 𝕜]
[TopologicalSpace E]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
{x : E}
(hs : StrictConvex 𝕜 s)
(zero_mem : 0 ∈ s)
(hx : x ∈ s)
(hx₀ : x ≠ 0)
{t : 𝕜}
(ht : 1 < t)


lemma mapHomologicalComplex_commShiftIso_eq (n : ℤ) :
    (F.mapHomologicalComplex (ComplexShape.up ℤ)).commShiftIso n =
      F.mapCochainComplexShiftIso n

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{D : Type u'}
[CategoryTheory.Category.{v', u'} D]
[CategoryTheory.Preadditive D]
(F : C ⥤ D)
[F.Additive]
(n : ℤ)


theorem parallel_congr_lem {S T : WSeq (Computation α)} {a} (H : S.LiftRel Equiv T) :
    (∀ s ∈ S, s ~> a) ↔ ∀ t ∈ T, t ~> a

(H : Stream'.WSeq.LiftRel Computation.Equiv S T)

(∀ (s : Computation α), s ∈ S → s.Promises a) ↔ ∀ (t : Computation α), t ∈ T → t.Promises a


/-- The maximality axiom in 'arrow' form: Any arrow `f` in `S` is covered by `S`. -/
theorem arrow_max (f : Y ⟶ X) (S : Sieve X) (hf : S f) : J.Covers S f

(J : CategoryTheory.GrothendieckTopology C)


@[to_additive (attr := simp, nolint simpNF)]
lemma finEquivZPowers_apply (hx) {n : Fin (orderOf x)} :
    finEquivZPowers x hx n = ⟨x ^ (n : ℕ), n, zpow_natCast x n⟩

{G : Type u_1}
[Group G]
{x : G}
(hx : IsOfFinOrder x)
{n : Fin (orderOf x)}


theorem add_mul_right_left : IsRelPrime (x + z * y) y

{R : Type u_1}
[CommRing R]
{x y : R}
(h : IsRelPrime x y)
(z : R)


@[simp]
theorem lsingle_apply (a : α) (b : M) : (lsingle a : M →ₗ[R] α →₀ M) b = single a b

{α : Type u_1}
{M : Type u_2}
{R : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(a : α)
(b : M)

(Finsupp.lsingle a) b = Finsupp.single a b


@[simp]
theorem toFinset_toMultiset [DecidableEq α] (f : α →₀ ℕ) : f.toMultiset.toFinset = f.support

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

(Finsupp.toMultiset f).toFinset = f.support


/-- Given a normal subgroup `Γ` of a topological group `G` with Haar measure `μ`, which is also
  right-invariant, and a finite volume fundamental domain `𝓕`, the quotient map to `G ⧸ Γ`,
  properly normalized, satisfies `QuotientMeasureEqMeasurePreimage`. -/
@[to_additive "Given a normal
subgroup `Γ` of an additive topological group `G` with Haar measure `μ`, which is also
right-invariant, and a finite volume fundamental domain `𝓕`, the quotient map to `G ⧸ Γ`,
properly normalized, satisfies `AddQuotientMeasureEqMeasurePreimage`."]
theorem IsFundamentalDomain.QuotientMeasureEqMeasurePreimage_HaarMeasure {𝓕 : Set G}
    (h𝓕 : IsFundamentalDomain Γ.op 𝓕 ν) [IsMulLeftInvariant μ] [SigmaFinite μ]
    {V : Set (G ⧸ Γ)} (hV : (interior V).Nonempty) (meas_V : MeasurableSet V)
    (hμK : μ V = ν ((π ⁻¹' V) ∩ 𝓕)) (neTopV : μ V ≠ ⊤) :
    QuotientMeasureEqMeasurePreimage ν μ

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

(hμK : μ V = ν (QuotientGroup.mk ⁻¹' V ∩ 𝓕))


theorem balanced_iff_closedBall_smul : Balanced 𝕜 s ↔ Metric.closedBall (0 : 𝕜) 1 • s ⊆ s

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

Balanced 𝕜 s ↔ Metric.closedBall 0 1 • s ⊆ s


@[to_additive]
theorem comp_mul_le (f g : F →* E) : p.comp (f * g) ≤ p.comp f + p.comp g

{E : Type u_4}
{F : Type u_5}
[AddCommGroup E]
[AddCommGroup F]
(p : AddGroupSeminorm E)
(f g : F →+ E)


theorem drop_drop : ∀ t : HolorIndex (ds₁ ++ ds₂ ++ ds₃), t.assocRight.drop.drop = t.drop

{ds₁ ds₂ ds₃ : List ℕ}
(t : HolorIndex (ds₁ ++ ds₂ ++ ds₃))


/-- The analytic groupoid on a boundaryless charted space modeled on a complete vector space
consists of the partial homeomorphisms which are analytic and have analytic inverse. -/
theorem mem_analyticGroupoid_of_boundaryless [CompleteSpace E] [I.Boundaryless]
    (e : PartialHomeomorph H H) :
    e ∈ analyticGroupoid I ↔ AnalyticOn 𝕜 (I ∘ e ∘ I.symm) (I '' e.source) ∧
    AnalyticOn 𝕜 (I ∘ e.symm ∘ I.symm) (I '' e.target)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
[CompleteSpace E]
[I.Boundaryless]
(e : PartialHomeomorph H H)

e ∈ analyticGroupoid I ↔
  AnalyticOn 𝕜 (↑I ∘ ↑e ∘ ↑I.symm) (↑I '' e.source) ∧ AnalyticOn 𝕜 (↑I ∘ ↑e.symm ∘ ↑I.symm) (↑I '' e.target)


@[to_additive (attr := simp)]
theorem symm_comp_self (e : M ≃* N) : e.symm ∘ e = id

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]
(e : M ≃+ N)


theorem centralMoment_two_eq_variance [IsFiniteMeasure μ] (hX : Memℒp X 2 μ) :
    centralMoment X 2 μ = variance X μ

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{X : Ω → ℝ}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure μ]
(hX : MeasureTheory.Memℒp X 2 μ)

ProbabilityTheory.centralMoment X 2 μ = ProbabilityTheory.variance X μ


theorem USize.ext_iff {x y : USize} : x = y ↔ x.toNat = y.toNat


lemma cosKernel_neg (a : UnitAddCircle) (x : ℝ) : cosKernel (-a) x = cosKernel a x

HurwitzZeta.cosKernel (-a) x = HurwitzZeta.cosKernel a x


theorem of_eq {f g : ℕ →. ℕ} (hf : Partrec f) (H : ∀ n, f n = g n) : Partrec g

{f g : ℕ →. ℕ}
(hf : Nat.Partrec f)
(H : ∀ (n : ℕ), f n = g n)


/-- **Equational criterion for vanishing**
[A. Altman and S. Kleiman, *A term of commutative algebra* (Lemma 8.16)][altman2021term].

Assume that the $m_i$ generate $M$. Then the expression $\sum_i m_i \otimes n_i$ vanishes
trivially if and only if it vanishes. -/
theorem vanishesTrivially_iff_sum_tmul_eq_zero (hm : Submodule.span R (Set.range m) = ⊤) :
    VanishesTrivially R m n ↔ ∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N)

TensorProduct.VanishesTrivially R m n ↔ ∑ i : ι, m i ⊗ₜ[R] n i = 0


theorem iff_def' : (a ↔ b) ↔ (b → a) ∧ (a → b)


@[simp]
lemma units_smul_f_apply (r : Rˣ) (f : X ⟶ Y) (n : ι) : (r • f).f n = r • f.f n

{R : Type u_1}
[Semiring R]
{C : Type u_2}
[CategoryTheory.Category.{u_5, u_2} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.Linear R C]
{ι : Type u_4}
{c : ComplexShape ι}
{X Y : HomologicalComplex C c}
(r : Rˣ)
(f : X ⟶ Y)
(n : ι)


/-- A morphism of snake inputs involve four morphisms of short complexes
which make the obvious diagram commute. -/
@[ext]
structure Hom :=
  /-- a morphism between the zeroth lines -/
  f₀ : S₁.L₀ ⟶ S₂.L₀
  /-- a morphism between the first lines -/
  f₁ : S₁.L₁ ⟶ S₂.L₁
  /-- a morphism between the second lines -/
  f₂ : S₁.L₂ ⟶ S₂.L₂
  /-- a morphism between the third lines -/
  f₃ : S₁.L₃ ⟶ S₂.L₃
  comm₀₁ : f₀ ≫ S₂.v₀₁ = S₁.v₀₁ ≫ f₁ := by aesop_cat
  comm₁₂ : f₁ ≫ S₂.v₁₂ = S₁.v₁₂ ≫ f₂ := by aesop_cat
  comm₂₃ : f₂ ≫ S₂.v₂₃ = S₁.v₂₃ ≫ f₃ := by aesop_cat

{S₁ S₂ : CategoryTheory.ShortComplex.SnakeInput C}

CategoryTheory.CategoryStruct.comp self.f₀ S₂.v₀₁ = CategoryTheory.CategoryStruct.comp S₁.v₀₁ self.f₁


@[to_additive (attr := simp)]
lemma isTorsionFree_of_subsingleton [Subsingleton G] : IsTorsionFree G

{G : Type u_1}
[Monoid G]
[Subsingleton G]


@[to_additive (attr := simp, norm_cast)]
theorem max_val [Monoid α] [LinearOrder α] {a b : αˣ} : (max a b).val = max a.val b.val

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


lemma add_right (h1 : μ ≪ ν) (ν' : Measure α) : μ ≪ ν + ν'

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
(h1 : μ.AbsolutelyContinuous ν)
(ν' : MeasureTheory.Measure α)


@[to_additive]
theorem ite_mul_one {P : Prop} [Decidable P] {a b : M} :
    ite P (a * b) 1 = ite P a 1 * ite P b 1

{M : Type u}
[MulOneClass M]
{P : Prop}
[Decidable P]
{a b : M}

(if P then a * b else 1) = (if P then a else 1) * if P then b else 1


{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f g : 𝕜 → E}
{U : Set 𝕜}
(hf : MeromorphicOn f U)
(hg : MeromorphicOn g U)


/-- A semigroup homomorphism `f : M →ₙ* N` with a left-inverse `g : N → M` defines a multiplicative
equivalence between `M` and `f.srange`.

This is a bidirectional version of `MulHom.srangeRestrict`. -/
@[to_additive (attr := simps (config := { simpRhs := true }))
      "An additive semigroup homomorphism `f : M →+ N` with a left-inverse
      `g : N → M` defines an additive equivalence between `M` and `f.srange`.
      This is a bidirectional version of `AddHom.srangeRestrict`. "]
def ofLeftInverse (f : M →ₙ* N) {g : N → M} (h : Function.LeftInverse g f) : M ≃* f.srange

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
(f : AddHom M N)
{g : N → M}
(h : Function.LeftInverse g ⇑f)

∀ (a : ↥f.srange), (AddEquiv.ofLeftInverse f h).symm a = g ↑a


@[simp]
theorem coord_reindex (i : ι') : (b.reindex e).coord i = b.coord (e.symm i)

{ι : Type u_1}
{ι' : Type u_2}
{k : Type u_3}
{V : Type u_4}
{P : Type u_5}
[AddCommGroup V]
[AffineSpace V P]
[Ring k]
[Module k V]
(b : AffineBasis ι k P)
(e : ι ≃ ι')
(i : ι')


theorem ContDiffAt.cosh {n} (hf : ContDiffAt ℝ n f x) :
    ContDiffAt ℝ n (fun x => Real.cosh (f x)) x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
{n : ℕ∞}
(hf : ContDiffAt ℝ n f x)


@[reassoc]
lemma cyclesMap_comp [HasLeftHomology S₁] [HasLeftHomology S₂] [HasLeftHomology S₃]
    (φ₁ : S₁ ⟶ S₂) (φ₂ : S₂ ⟶ S₃) :
    cyclesMap (φ₁ ≫ φ₂) = cyclesMap φ₁ ≫ cyclesMap φ₂

{S₁ S₂ S₃ : CategoryTheory.ShortComplex C}

(φ₁ : S₁ ⟶ S₂)

(φ₂ : S₂ ⟶ S₃)

CategoryTheory.ShortComplex.cyclesMap (CategoryTheory.CategoryStruct.comp φ₁ φ₂) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.cyclesMap φ₁)
    (CategoryTheory.ShortComplex.cyclesMap φ₂)


protected theorem ne_of_lt : ∀ {x y : Bool}, x < y → x ≠ y


/--
The category of comonoid objects in a cartesian monoidal category is equivalent
to the category itself, via the forgetful functor.
-/
@[simps] def comonEquiv : Comon_ C ≌ C


@[simp]
theorem neg_lf_neg_iff {x y : PGame} : -y ⧏ -x ↔ x ⧏ y