lemma piecewise_piecewise_of_subset_right {s t : Finset ι} [∀ i, Decidable (i ∈ s)]
    [∀ i, Decidable (i ∈ t)] (h : t ⊆ s) (f g₁ g₂ : ∀ a, π a) :
    s.piecewise f (t.piecewise g₁ g₂) = s.piecewise f g₂

{ι : Type u_1}
{π : ι → Sort u_2}
{s t : Finset ι}
[(i : ι) → Decidable (i ∈ s)]
[(i : ι) → Decidable (i ∈ t)]
(h : t ⊆ s)
(f g₁ g₂ : (a : ι) → π a)


lemma llr_def (μ ν : Measure α) : llr μ ν = fun x ↦ log (μ.rnDeriv ν x).toReal

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

MeasureTheory.llr μ ν = fun x => Real.log (μ.rnDeriv ν x).toReal


theorem fundamentalSequenceProp_inl_none (o) :
    FundamentalSequenceProp o (Sum.inl none) ↔ o = 0

o.FundamentalSequenceProp (Sum.inl none) ↔ o = 0


@[to_additive]
lemma _root_.Function.Bijective.prod_comp {e : ι → κ} (he : e.Bijective) (g : κ → α) :
    ∏ i, g (e i) = ∏ i, g i

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[Fintype ι]
[Fintype κ]
[CommMonoid α]
{e : ι → κ}
(he : Function.Bijective e)
(g : κ → α)


theorem range_prod_eq {f : M →L[R] M₂} {g : M →L[R] M₃} (h : ker f ⊔ ker g = ⊤) :
    range (f.prod g) = (range f).prod (range g)

(h : LinearMap.ker f ⊔ LinearMap.ker g = ⊤)

LinearMap.range (f.prod g) = (LinearMap.range f).prod (LinearMap.range g)


@[simp]
lemma shift_units_smul (a : ℤ) (x : Rˣ) :
    (x • γ).shift a = x • (γ.shift a)

(γ : CochainComplex.HomComplex.Cochain K L n)


@[simp] theorem map_eq_nil {f : α → β} {l : List α} : map f l = [] ↔ l = []

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


theorem tr_ret_respects (k v s) : ∃ b₂,
    TrCfg (stepRet k v) b₂ ∧
      Reaches₁ (TM2.step tr)
        ⟨some (Λ'.ret (trCont k)), s, K'.elim (trList v) [] [] (trContStack k)⟩ b₂

(k : Turing.ToPartrec.Cont)
(v : List ℕ)
(s : Option Turing.PartrecToTM2.Γ')

∃ b₂,
  Turing.PartrecToTM2.TrCfg (Turing.ToPartrec.stepRet k v) b₂ ∧
    Turing.Reaches₁ (Turing.TM2.step Turing.PartrecToTM2.tr)
      { l := some (Turing.PartrecToTM2.Λ'.ret (Turing.PartrecToTM2.trCont k)), var := s,
        stk := Turing.PartrecToTM2.K'.elim (Turing.PartrecToTM2.trList v) [] [] (Turing.PartrecToTM2.trContStack k) }
      b₂


@[simp]
theorem biprod.fstKernelFork_ι : Fork.ι (biprod.fstKernelFork X Y) = (biprod.inr : Y ⟶ X ⊞ Y)

CategoryTheory.Limits.Fork.ι (CategoryTheory.Limits.biprod.fstKernelFork X Y) = CategoryTheory.Limits.biprod.inr


/-- A nondegenerate configuration in which every pair of points has a line through them. -/
class HasLines extends Nondegenerate P L where
  mkLine : ∀ {p₁ p₂ : P}, p₁ ≠ p₂ → L
  mkLine_ax : ∀ {p₁ p₂ : P} (h : p₁ ≠ p₂), p₁ ∈ mkLine h ∧ p₂ ∈ mkLine h

{P : Type u_1}
{L : Type u_2}
[Membership P L]
[self : Configuration.HasLines P L]
{p₁ p₂ : P}
(h : p₁ ≠ p₂)

p₁ ∈ Configuration.HasLines.mkLine h ∧ p₂ ∈ Configuration.HasLines.mkLine h


@[to_additive]
theorem IsSubgroup.iInter {ι : Sort*} {s : ι → Set G} (hs : ∀ y : ι, IsSubgroup (s y)) :
    IsSubgroup (Set.iInter s)

{G : Type u_1}
[Group G]
{ι : Sort u_4}
{s : ι → Set G}
(hs : ∀ (y : ι), IsSubgroup (s y))


@[to_additive] theorem mul_eq_mul_iff_eq_and_eq [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (swap (· * ·)) (· < ·)] {a b c d : α} (hac : a ≤ c) (hbd : b ≤ d) :
    a * b = c * d ↔ a = c ∧ b = d

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


@[reassoc (attr := simp), elementwise (attr := simp)]
theorem stalkSpecializes_comp {C : Type*} [Category C] [Limits.HasColimits C] {X : TopCat}
    (F : X.Presheaf C) {x y z : X} (h : x ⤳ y) (h' : y ⤳ z) :
    F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes (h.trans h')

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Limits.HasColimits C]
{X : TopCat}
(F : TopCat.Presheaf C X)
{x y z : ↑X}
(h : x ⤳ y)
(h' : y ⤳ z)

F.stalkSpecializes h' ≫ F.stalkSpecializes h = F.stalkSpecializes ⋯


@[to_additive]
theorem mem_rightTransversals_iff_existsUnique_mul_inv_mem :
    S ∈ rightTransversals T ↔ ∀ g : G, ∃! s : S, g * (s : G)⁻¹ ∈ T

S ∈ Subgroup.rightTransversals T ↔ ∀ (g : G), ∃! s, g * (↑s)⁻¹ ∈ T


@[simp] lemma support_mul (f g : ι → M₀) : support (fun x ↦ f x * g x) = support f ∩ support g

{ι : Type u_1}
{M₀ : Type u_4}
[MulZeroClass M₀]
[NoZeroDivisors M₀]
(f g : ι → M₀)

(Function.support fun x => f x * g x) = Function.support f ∩ Function.support g


@[ext]
lemma Truncated.hom_ext {n : ℕ} {X Y : Truncated n} {f g : X ⟶ Y} (w : ∀ n, f.app n = g.app n) :
    f = g

(w : ∀ (n_1 : (SimplexCategory.Truncated n)ᵒᵖ), f.app n_1 = g.app n_1)


@[simp]
theorem mk_eq_one {x : α} (hx : 0 ≤ x) :
    (⟨x, hx⟩ : { x : α // 0 ≤ x }) = 1 ↔ x = 1

{α : Type u_1}
[Zero α]
[One α]
[LE α]
[ZeroLEOneClass α]
{x : α}
(hx : 0 ≤ x)


/-- This is often the more useful lemma to rewrite the norm as opposed to
`Unitization.nnnorm_def`. -/
theorem nnnorm_eq_sup (x : Unitization 𝕜 A) :
    ‖x‖₊ = ‖x.fst‖₊ ⊔ ‖algebraMap 𝕜 (A →L[𝕜] A) x.fst + mul 𝕜 A x.snd‖₊

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[IsScalarTower 𝕜 A A]
[SMulCommClass 𝕜 A A]
[RegularNormedAlgebra 𝕜 A]
(x : Unitization 𝕜 A)

‖x‖₊ = ‖x.fst‖₊ ⊔ ‖(algebraMap 𝕜 (A →L[𝕜] A)) x.fst + (ContinuousLinearMap.mul 𝕜 A) x.snd‖₊


theorem forall_mem_union {p : α → Prop} : (∀ a ∈ s ∪ t, p a) ↔ (∀ a ∈ s, p a) ∧ ∀ a ∈ t, p a

{α : Type u_1}
[DecidableEq α]
{s t : Finset α}
{p : α → Prop}


theorem inv_lt_one_iff {x : ℝ≥0} (hx : x ≠ 0) : x⁻¹ < 1 ↔ 1 < x


@[simp]
lemma prodEquiv_symm_apply_fst (x : X₁ × X₂) :
    (Limits.prod.fst : X₁ ⨯ X₂ ⟶ X₁) ((prodEquiv X₁ X₂).symm x) = x.1

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.pair X₁ X₂) (CategoryTheory.forget C)]

(x : (CategoryTheory.forget C).obj X₁ × (CategoryTheory.forget C).obj X₂)

CategoryTheory.Limits.prod.fst ((CategoryTheory.Limits.Concrete.prodEquiv X₁ X₂).symm x) = x.1


theorem toIocDiv_neg' (a b : α) : toIocDiv hp (-a) b = -(toIcoDiv hp a (-b) + 1)

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


@[simp]
theorem mem_Iio : x ∈ Iio a ↔ x < a

{α : Type u_1}
[Preorder α]
[LocallyFiniteOrderBot α]
{a x : α}


theorem dist_iterate_succ_le_geometric {f : α → α} (hf : LipschitzWith K f) (x n) :
    dist (f^[n] x) (f^[n + 1] x) ≤ dist x (f x) * (K : ℝ) ^ n

{α : Type u}
[PseudoMetricSpace α]
{K : ℝ≥0}
{f : α → α}
(hf : LipschitzWith K f)
(x : α)
(n : ℕ)

dist (f^[n] x) (f^[n + 1] x) ≤ dist x (f x) * ↑K ^ n


@[simp, reassoc]
lemma induced_isoShiftZero_hom_app_obj (X : C) :
    letI := (induced e M F' e')
    (F.isoShiftZero M).hom.app (L.obj X) =
      (e' 0).hom.app X ≫ (isoShiftZero G M).hom.app X ≫ e.inv.app X

[((CategoryTheory.whiskeringLeft C D A).obj L).Full]

[((CategoryTheory.whiskeringLeft C D A).obj L).Faithful]

(F.isoShiftZero M).hom.app (L.obj X) = (e' 0).hom.app X ≫ (G.isoShiftZero M).hom.app X ≫ e.inv.app X


/-- If `A` and `B` are isomorphic, then an ind-object presentation of `A` can be extended to an
    ind-object presentation of `B`. -/
@[simps!]
noncomputable def extend {A B : Cᵒᵖ ⥤ Type v} (P : IndObjectPresentation A) (η : A ⟶ B) [IsIso η] :
    IndObjectPresentation B

{A B : CategoryTheory.Functor Cᵒᵖ (Type v)}

(P : CategoryTheory.Limits.IndObjectPresentation A)

(s : CategoryTheory.Limits.Cocone (P.F.comp CategoryTheory.yoneda))

∀ (a : (P.cocone.extend η).pt.obj X),
  ((P.extend η).isColimit.desc s).app X a = (P.coconeIsColimit.desc s).app X (CategoryTheory.inv (η.app X) a)


protected theorem map_ne_zero_iff (hf : Function.Injective f) : p.map f ≠ 0 ↔ p ≠ 0

{R : Type u}
{S : Type v}
[Semiring R]
{p : R[X]}
[Semiring S]
{f : R →+* S}
(hf : Function.Injective ⇑f)


theorem imaginaryPart_apply_coe (a : A) : (ℑ a : A) = -I • (2 : ℝ)⁻¹ • (a - star a)

{A : Type u_1}
[AddCommGroup A]
[Module ℂ A]
[StarAddMonoid A]
[StarModule ℂ A]
(a : A)

↑(imaginaryPart a) = -Complex.I • 2⁻¹ • (a - star a)


lemma div_add_mod' (a b : ℕ) : a / b * b + a % b = a


/-- A quick way to convert a `PreEnvelGroupRel'` to a `PreEnvelGroupRel`.
-/
theorem PreEnvelGroupRel'.rel {R : Type u} [Rack R] {a b : PreEnvelGroup R} :
    PreEnvelGroupRel' R a b → PreEnvelGroupRel R a b

{R : Type u}
[Rack R]
{a b : Rack.PreEnvelGroup R}

Rack.PreEnvelGroupRel' R a b → Rack.PreEnvelGroupRel R a b


@[to_additive]
theorem le_hasProd (hf : HasProd f a) (i : ι) (hb : ∀ j, j ≠ i → 1 ≤ f j) : f i ≤ a

{ι : Type u_1}
{α : Type u_3}
[OrderedAddCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f : ι → α}
{a : α}
(hf : HasSum f a)
(i : ι)
(hb : ∀ (j : ι), j ≠ i → 0 ≤ f j)


theorem le_sInf_inter {s t : Set α} : sInf s ⊔ sInf t ≤ sInf (s ∩ t)

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


/-- If `a ^ n = 1`, `n ≠ 0`, then `a` is a unit. -/
@[to_additive (attr := simps!) "If `n • x = 0`, `n ≠ 0`, then `x` is an additive unit."]
def Units.ofPowEqOne (a : M) (n : ℕ) (ha : a ^ n = 1) (hn : n ≠ 0) : Mˣ

{M : Type u_1}
[Monoid M]
(a : M)
(n : ℕ)
(ha : a ^ n = 1)
(hn : n ≠ 0)


theorem measure_union_add_inter (s : Set α) (ht : MeasurableSet t) :
    μ (s ∪ t) + μ (s ∩ t) = μ s + μ t

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{t : Set α}
(s : Set α)
(ht : MeasurableSet t)


theorem tendsto_atTop_zero_of_summable {f : ℕ → ℝ≥0} (hf : Summable f) : Tendsto f atTop (𝓝 0)


/-- If the angle between three points is 0, they are collinear. -/
theorem collinear_of_angle_eq_zero {p₁ p₂ p₃ : P} (h : ∠ p₁ p₂ p₃ = 0) :
    Collinear ℝ ({p₁, p₂, p₃} : Set P)

(h : EuclideanGeometry.angle p₁ p₂ p₃ = 0)


/-- The identification `- ⊗ unmop X = unmop (X ⊗ mop -)` as a natural isomorphism. -/
@[simps!]
def MonoidalOpposite.tensorRightUnmopIso (X : Cᴹᵒᵖ) :
    tensorRight (unmop X) ≅ mopFunctor C ⋙ tensorLeft X ⋙ unmopFunctor C

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

∀ (X_1 : C), X.tensorRightUnmopIso.hom.app X_1 = 𝟙 (CategoryTheory.MonoidalCategory.tensorObj X_1 X.unmop)


@[to_additive (attr := simp)] theorem MonoidHom.id_monCat_comp
    {G : Type u} [Monoid G] {H : MonCat.{u}} (f : G →* H) : MonoidHom.comp (𝟙 H) f = f

{G : Type u}
[AddMonoid G]
{H : AddMonCat}
(f : G →+ ↑H)


theorem nnnorm_Integral_le_one : ‖integralCLM (α := α) (E := E) (μ := μ)‖₊ ≤ 1

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


lemma NullMeasurable.measure_preimage_eq_measure_restrict_preimage_of_ae_compl_eq_const
    {β : Type*} [MeasurableSpace β] {b : β} {f : α → β} {s : Set α}
    (f_mble : NullMeasurable f (μ.restrict s)) (hs : f =ᵐ[Measure.restrict μ sᶜ] (fun _ ↦ b))
    {t : Set β} (t_mble : MeasurableSet t) (ht : b ∉ t) :
    μ (f ⁻¹' t) = μ.restrict s (f ⁻¹' t)

(f_mble : MeasureTheory.NullMeasurable f (μ.restrict s))


theorem mul_one {n} (a : ⨂[R]^n M) : cast R M (add_zero _) (a ₜ* ₜ1) = a

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

(TensorPower.cast R M ⋯) (GradedMonoid.GMul.mul a GradedMonoid.GOne.one) = a


@[to_additive]
theorem isUnit_of_mul_eq_one [CommMonoid M] (a b : M) (h : a * b = 1) : IsUnit a

{M : Type u_1}
[CommMonoid M]
(a b : M)
(h : a * b = 1)


theorem neBot_iff {f : Filter α} : NeBot f ↔ f ≠ ⊥


theorem summable_of_isEquivalent {ι E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [FiniteDimensional ℝ E] {f : ι → E} {g : ι → E} (hg : Summable g) (h : f ~[cofinite] g) :
    Summable f

{ι : Type u_1}
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{f g : ι → E}
(hg : Summable g)
(h : f ~[Filter.cofinite] g)


theorem final_natIso_iff {F F' : C ⥤ D} (i : F ≅ F') : Final F ↔ Final F'

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F F' : CategoryTheory.Functor C D}
(i : F ≅ F')


theorem id_def (M : Mat R) : 𝟙 M = fun i j => if i = j then 1 else 0

(R : Type u)
[Semiring R]
(M : CategoryTheory.Mat R)


@[csimp] private theorem ndrecOn_eq_ndrecOnC : @Acc.ndrecOn = @Acc.ndrecOnC


@[simp] lemma Odd.mul : Odd a → Odd b → Odd (a * b)


@[to_additive]
theorem HasCompactMulSupport.uniformContinuous_of_continuous {f : α → β} [One β]
    (h1 : HasCompactMulSupport f) (h2 : Continuous f) : UniformContinuous f

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[UniformSpace β]
{f : α → β}
[Zero β]
(h1 : HasCompactSupport f)
(h2 : Continuous f)


/-- Each function of an equicontinuous family is continuous. -/
theorem Equicontinuous.continuous {F : ι → X → α} (h : Equicontinuous F) (i : ι) :
    Continuous (F i)

{ι : Type u_1}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
{F : ι → X → α}
(h : Equicontinuous F)
(i : ι)


theorem IsSubordinate.toPartitionOfUnity {f : BumpCovering ι X s} {U : ι → Set X}
    (h : f.IsSubordinate U) : f.toPartitionOfUnity.IsSubordinate U

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
{f : BumpCovering ι X s}
{U : ι → Set X}
(h : f.IsSubordinate U)


@[to_additive]
theorem Filter.EventuallyEq.of_mulIndicator [One β] {l : Filter α} {f : α → β}
    (hf : ∀ᶠ x in l, f x ≠ 1) {s t : Set α} (h : s.mulIndicator f =ᶠ[l] t.mulIndicator f) :
    s =ᶠ[l] t


theorem inclusion_eq_id (h : s ⊆ s) : inclusion h = id


@[simp] theorem beq_cons₂ [BEq α] [BEq β] :
    ((.cons a b t : AssocList α β) == .cons a' b' t') = (a == a' && b == b' && t == t')

{α : Type u_1}
{β : Type u_2}
{a : α}
{b : β}
{t : Batteries.AssocList α β}
{a' : α}
{b' : β}
{t' : Batteries.AssocList α β}
[BEq α]
[BEq β]

(Batteries.AssocList.cons a b t == Batteries.AssocList.cons a' b' t') = (a == a' && b == b' && t == t')


theorem iInter_congr_of_surjective {f : ι → Set α} {g : ι₂ → Set α} (h : ι → ι₂) (h1 : Surjective h)
    (h2 : ∀ x, g (h x) = f x) : ⋂ x, f x = ⋂ y, g y

{α : Type u_1}
{ι : Sort u_4}
{ι₂ : Sort u_6}
{f : ι → Set α}
{g : ι₂ → Set α}
(h : ι → ι₂)
(h1 : Function.Surjective h)
(h2 : ∀ (x : ι), g (h x) = f x)


theorem dedupKeys_cons {x : Sigma β} (l : List (Sigma β)) :
    dedupKeys (x :: l) = kinsert x.1 x.2 (dedupKeys l)

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{x : Sigma β}
(l : List (Sigma β))

(x :: l).dedupKeys = List.kinsert x.fst x.snd l.dedupKeys


lemma image_le_image_of_le {U V : X.Opens} (e : U ≤ V) : f ''ᵁ U ≤ f ''ᵁ V

[H : AlgebraicGeometry.IsOpenImmersion f]

f.opensFunctor.obj U ≤ f.opensFunctor.obj V


lemma zpow_left₀ (h : Commute a b) (m : ℤ) : Commute (a ^ m) b

{G₀ : Type u_3}
[GroupWithZero G₀]
{a b : G₀}
(h : Commute a b)
(m : ℤ)


theorem Squarefree.nodup_primeFactorsList {n : ℕ} (hn : Squarefree n) : n.primeFactorsList.Nodup


@[simp]
theorem pow_pos [ZeroLEOneClass α] [PosMulStrictMono α]
    (H : 0 < a) : ∀ n : ℕ, 0 < a ^ n

{α : Type u}
[Semiring α]
[PartialOrder α]
{a : α}
[ZeroLEOneClass α]
[PosMulStrictMono α]
(H : 0 < a)
(n : ℕ)


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


theorem nonarchimedean (hB : SubmodulesBasis B) : @NonarchimedeanAddGroup M _ hB.topology

{ι : Type u_1}
{R : Type u_2}
[CommRing R]
{M : Type u_4}
[AddCommGroup M]
[Module R M]
[TopologicalSpace R]
[Nonempty ι]
{B : ι → Submodule R M}
(hB : SubmodulesBasis B)


theorem segment_subset_uIcc (x y : E) : [x -[𝕜] y] ⊆ uIcc x y

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid E]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
(x y : E)


theorem left_nonuniformWitnesses_subset (h : ¬G.IsUniform ε s t) :
    (G.nonuniformWitnesses ε s t).1 ⊆ s

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
(G : SimpleGraph α)
[DecidableRel G.Adj]
{ε : 𝕜}
{s t : Finset α}
(h : ¬G.IsUniform ε s t)


theorem curry_eq_iff (f : A ⨯ Y ⟶ X) (g : Y ⟶ A ⟹ X) : curry f = g ↔ f = uncurry g

CategoryTheory.CartesianClosed.curry f = g ↔ f = CategoryTheory.CartesianClosed.uncurry g


theorem biSup_congr' {p : ι → Prop} {f g : (i : ι) → p i → α}
    (h : ∀ i (hi : p i), f i hi = g i hi) :
    ⨆ i, ⨆ (hi : p i), f i hi = ⨆ i, ⨆ (hi : p i), g i hi

(h : ∀ (i : ι) (hi : p i), f i hi = g i hi)


theorem mul_sub_mul_div_mul_neg_iff (hc : c ≠ 0) (hd : d ≠ 0) :
    (a * d - b * c) / (c * d) < 0 ↔ a / c < b / d

{α : Type u_2}
[LinearOrderedField α]
{a b c d : α}
(hc : c ≠ 0)
(hd : d ≠ 0)


/-- Each element of the monoid defines a module endomorphism.

This is a stronger version of `DistribMulAction.toAddMonoidEnd`. -/
@[simps]
def toModuleEnd : S →* Module.End R M

(R : Type u_1)
{S : Type u_4}
(M : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Monoid S]
[DistribMulAction S M]
[SMulCommClass S R M]
(s : S)

(DistribMulAction.toModuleEnd R M) s = DistribMulAction.toLinearMap R M s


protected theorem polarCoord_target :
    Complex.polarCoord.target = Set.Ioi (0 : ℝ) ×ˢ Set.Ioo (-π) π

Complex.polarCoord.target = Set.Ioi 0 ×ˢ Set.Ioo (-Real.pi) Real.pi


theorem withDensity_of_not_measurable (κ : Kernel α β) [IsSFiniteKernel κ]
    (hf : ¬Measurable (Function.uncurry f)) : withDensity κ f = 0

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{f : α → β → ℝ≥0∞}
(κ : ProbabilityTheory.Kernel α β)
[ProbabilityTheory.IsSFiniteKernel κ]
(hf : ¬Measurable (Function.uncurry f))


theorem gramSchmidtNormed_unit_length {f : ι → E} (n : ι) (h₀ : LinearIndependent 𝕜 f) :
    ‖gramSchmidtNormed 𝕜 f n‖ = 1

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_3}
[LinearOrder ι]
[LocallyFiniteOrderBot ι]
[IsWellOrder ι fun x x_1 => x < x_1]
{f : ι → E}
(n : ι)
(h₀ : LinearIndependent 𝕜 f)


theorem HasFDerivWithinAt.ccosh (hf : HasFDerivWithinAt f f' s x) :
    HasFDerivWithinAt (fun x => Complex.cosh (f x)) (Complex.sinh (f x) • f') s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{f' : E →L[ℂ] ℂ}
{x : E}
{s : Set E}
(hf : HasFDerivWithinAt f f' s x)


@[to_additive (attr := simp) addCentralizer_univ]
lemma centralizer_univ : centralizer univ = center M


theorem coe_map_toEnd_le :
    (N : Submodule R M).map (LieModule.toEnd R L M x) ≤ N

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
{N : LieSubmodule R L M}
{x : L}

Submodule.map ((LieModule.toEnd R L M) x) ↑N ≤ ↑N


@[simp]
protected theorem inter (hs : NullMeasurableSet s μ) (ht : NullMeasurableSet t μ) :
    NullMeasurableSet (s ∩ t) μ

(hs : MeasureTheory.NullMeasurableSet s μ)

(ht : MeasureTheory.NullMeasurableSet t μ)

MeasureTheory.NullMeasurableSet (s ∩ t) μ


theorem coprime_of_dvd_coprime {a b : ℤ√d} (hcoprime : IsCoprime a.re a.im) (hdvd : b ∣ a) :
    IsCoprime b.re b.im

{d : ℤ}
{a b : ℤ√d}
(hcoprime : IsCoprime a.re a.im)
(hdvd : b ∣ a)


theorem IsOpen.smul₀ {c : G₀} {s : Set α} (hs : IsOpen s) (hc : c ≠ 0) : IsOpen (c • s)

{α : Type u_2}
{G₀ : Type u_4}
[TopologicalSpace α]
[GroupWithZero G₀]
[MulAction G₀ α]
[ContinuousConstSMul G₀ α]
{c : G₀}
{s : Set α}
(hs : IsOpen s)
(hc : c ≠ 0)


/-- A cocone `c` on `F : J ⥤ C` lifts to a cocone in `Over c.pt` with cone point `𝟙 c.pt`. -/
@[simps]
def Cocone.toOver {F : J ⥤ C} (c : Cocone F) :
    Cocone (c.toCostructuredArrow ⋙ CostructuredArrow.toOver _ _)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : CategoryTheory.Functor J C}
(c : CategoryTheory.Limits.Cocone F)
(j : J)

c.toOver.ι.app j = CategoryTheory.Over.homMk (c.ι.app j) ⋯


/-- This is the reverse direction of the equivalence we're constructing. -/
@[simps! obj map]
def costructuredArrowPresheafToOver (A : Cᵒᵖ ⥤ Type v) :
    ((CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) ⥤ Over A

(A : CategoryTheory.Functor Cᵒᵖ (Type v))

(Y : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v))

(CategoryTheory.OverPresheafAux.costructuredArrowPresheafToOver A).obj Y =
  CategoryTheory.CostructuredArrow.mk (CategoryTheory.OverPresheafAux.yonedaCollectionPresheafToA Y)


theorem comap_singleton_isClosed_of_surjective (f : R →+* S) (hf : Function.Surjective f)
    (x : PrimeSpectrum S) (hx : IsClosed ({x} : Set (PrimeSpectrum S))) :
    IsClosed ({comap f x} : Set (PrimeSpectrum R))

{R : Type u}
(S : Type v)
[CommRing R]
[CommRing S]
(f : R →+* S)
(hf : Function.Surjective ⇑f)
(x : PrimeSpectrum S)
(hx : IsClosed {x})


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

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

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


theorem Filter.Tendsto.isCoboundedUnder_ge [NeBot f] (h : Tendsto u f (𝓝 a)) :
    f.IsCoboundedUnder (· ≥ ·) u

{ι : Type u_1}
{α : Type u_2}
[Preorder α]
[TopologicalSpace α]
[BoundedLENhdsClass α]
{f : Filter ι}
{u : ι → α}
{a : α}
[f.NeBot]
(h : Filter.Tendsto u f (𝓝 a))

Filter.IsCoboundedUnder (fun x x_1 => x ≥ x_1) f u


theorem smoothAt_fst {p : M × N} : SmoothAt (I.prod J) I Prod.fst p

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{F : Type u_11}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_12}
[TopologicalSpace G]
{J : ModelWithCorners 𝕜 F G}
{N : Type u_13}
[TopologicalSpace N]
[ChartedSpace G N]
{p : M × N}


@[to_additive (attr := ext)]
lemma ext {X Y : CommMonCat} {f g : X ⟶ Y} (w : ∀ x : X, f x = g x) : f = g

{X Y : CommMonCat}
{f g : X ⟶ Y}
(w : ∀ (x : ↑X), f x = g x)


/-- An injective object admits a trivial injective resolution: itself in degree 0. -/
@[simps]
def self [Injective Z] : InjectiveResolution Z

(CategoryTheory.InjectiveResolution.self Z).cocomplex = (CochainComplex.single₀ C).obj Z


@[simp]
theorem coe_submonoidClass_iff {M B : Type*} [CommMonoid M] [SetLike B M] [SubmonoidClass B M]
    {N : B} {ζ : N} : IsPrimitiveRoot (ζ : M) k ↔ IsPrimitiveRoot ζ k

{k : ℕ}
{M : Type u_7}
{B : Type u_8}
[CommMonoid M]
[SetLike B M]
[SubmonoidClass B M]
{N : B}
{ζ : ↥N}

IsPrimitiveRoot (↑ζ) k ↔ IsPrimitiveRoot ζ k


/-- Auxiliary lemma for `rnDeriv_withDensity_right`. -/
lemma rnDeriv_withDensity_right_of_absolutelyContinuous {ν : Measure α} [SigmaFinite μ]
    [SigmaFinite ν] (hμν : μ ≪ ν) (hf : AEMeasurable f ν)
    (hf_ne_zero : ∀ᵐ x ∂ν, f x ≠ 0) (hf_ne_top : ∀ᵐ x ∂ν, f x ≠ ∞) :
    μ.rnDeriv (ν.withDensity f) =ᵐ[ν] fun x ↦ (f x)⁻¹ * μ.rnDeriv ν x

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
{ν : MeasureTheory.Measure α}
[MeasureTheory.SigmaFinite μ]
[MeasureTheory.SigmaFinite ν]
(hμν : μ ≪ ν)
(hf : AEMeasurable f ν)
(hf_ne_zero : ∀ᵐ (x : α) ∂ν, f x ≠ 0)
(hf_ne_top : ∀ᵐ (x : α) ∂ν, f x ≠ ⊤)

μ.rnDeriv (ν.withDensity f) =ᵐ[ν] fun x => (f x)⁻¹ * μ.rnDeriv ν x


theorem iteratedDerivWithin_neg' :
    iteratedDerivWithin n (fun z => -f z) s x = -iteratedDerivWithin n f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}
{x : 𝕜}
{s : Set 𝕜}
(hx : x ∈ s)
(h : UniqueDiffOn 𝕜 s)
(f : 𝕜 → F)


lemma IsPushout.of_iso {sq₁ sq₂ : Square C} (h : sq₁.IsPushout)
    (e : sq₁ ≅ sq₂) : sq₂.IsPushout

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{sq₁ sq₂ : CategoryTheory.Square C}
(h : sq₁.IsPushout)
(e : sq₁ ≅ sq₂)


theorem locallyConvexSpace_sInf {ts : Set (TopologicalSpace E)}
    (h : ∀ t ∈ ts, @LocallyConvexSpace 𝕜 E _ _ _ t) : @LocallyConvexSpace 𝕜 E _ _ _ (sInf ts)

{𝕜 : Type u_2}
{E : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{ts : Set (TopologicalSpace E)}
(h : ∀ t ∈ ts, LocallyConvexSpace 𝕜 E)


/-- In other words, `liminf cofinite s` is the set of elements lying outside the family `s`
finitely often. -/
theorem cofinite.liminf_set_eq : liminf s cofinite = { x | { n | x ∉ s n }.Finite }

{α : Type u_1}
{ι : Type u_4}
{s : ι → Set α}

Filter.liminf s Filter.cofinite = {x | {n | x ∉ s n}.Finite}


@[simp, norm_cast]
theorem unop_coe (S : Subalgebra R Aᵐᵒᵖ) : S.unop = MulOpposite.op ⁻¹' (S : Set Aᵐᵒᵖ)

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R Aᵐᵒᵖ)


/-- The canonical morphism of sheafed spaces from `X` to the spectrum of its global sections. -/
@[simps]
def toΓSpecSheafedSpace : X.toSheafedSpace ⟶ Spec.toSheafedSpace.obj (op (Γ.obj (op X)))

X.toΓSpecSheafedSpace.c =
  (TopCat.Sheaf.restrictHomEquivHom
      (AlgebraicGeometry.Spec.structureSheaf ↑(AlgebraicGeometry.LocallyRingedSpace.Γ.obj (Opposite.op X))).val
      ((TopCat.Sheaf.pushforward CommRingCat X.toΓSpecBase).obj X.𝒪) ⋯)
    X.toΓSpecCBasicOpens


theorem wcovBy_iff_eq_or_covBy : a ⩿ b ↔ a = b ∨ a ⋖ b

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


theorem star_mulVec [Fintype n] [StarRing α] (M : Matrix m n α) (v : n → α) :
    star (M *ᵥ v) = star v ᵥ* Mᴴ

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonUnitalSemiring α]
[Fintype n]
[StarRing α]
(M : Matrix m n α)
(v : n → α)


theorem lt_rev_iff {i j : Fin n} : i < rev j ↔ j < rev i


/-- An equivalence between `Finmap β` and pairs `(keys : Finset α, lookup : ∀ a, Option (β a))` such
that `(lookup a).isSome ↔ a ∈ keys`. -/
@[simps apply_coe_fst apply_coe_snd]
def keysLookupEquiv :
    Finmap β ≃ { f : Finset α × (∀ a, Option (β a)) // ∀ i, (f.2 i).isSome ↔ i ∈ f.1 }

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(s : Finmap β)

(↑(Finmap.keysLookupEquiv s)).1 = s.keys


theorem sub_inv_antitoneOn_Icc_left (ha : b < c) :
    AntitoneOn (fun x ↦ (x-c)⁻¹) (Set.Icc a b)

{α : Type u_2}
[LinearOrderedField α]
{a b c : α}
(ha : b < c)

AntitoneOn (fun x => (x - c)⁻¹) (Set.Icc a b)


theorem mem_nhds_induced [T : TopologicalSpace α] (f : β → α) (a : β) (s : Set β) :
    s ∈ @nhds β (TopologicalSpace.induced f T) a ↔ ∃ u ∈ 𝓝 (f a), f ⁻¹' u ⊆ s

{α : Type u}
{β : Type v}
[T : TopologicalSpace α]
(f : β → α)
(a : β)
(s : Set β)


/-- The adjoint of the linear map associated to a matrix is the linear map associated to the
conjugate transpose of that matrix. -/
theorem Matrix.toEuclideanLin_conjTranspose_eq_adjoint (A : Matrix m n 𝕜) :
    Matrix.toEuclideanLin A.conjTranspose = LinearMap.adjoint (Matrix.toEuclideanLin A)

{𝕜 : Type u_1}
[RCLike 𝕜]
{m : Type u_5}
{n : Type u_6}
[Fintype m]
[DecidableEq m]
[Fintype n]
[DecidableEq n]
(A : Matrix m n 𝕜)


@[simp] lemma symm_symm (e : G ≃+c[a, b] H) : e.symm.symm = e

{G : Type u_1}
{H : Type u_2}
[Add G]
[Add H]
{a : G}
{b : H}
(e : G ≃+c[a, b] H)


/-- Every vector in `stdSimplex 𝕜 ι` has `max`-norm at most `1`. -/
theorem stdSimplex_subset_closedBall : stdSimplex ℝ ι ⊆ Metric.closedBall 0 1


/-- The lifting of a functor to the path category of `LocQuiver W` -/
@[simps!]
def liftToPathCategory : Paths (LocQuiver W) ⥤ D

(X : CategoryTheory.Paths (CategoryTheory.Localization.Construction.LocQuiver W))

(CategoryTheory.Localization.Construction.liftToPathCategory G hG).obj X = G.obj X.obj


theorem neg_of_sign_eq_neg_one : ∀ {a : Int}, sign a = -1 → a < 0


@[simp] theorem modify_get?_length (f : α → α) : ∀ n l, length (modifyNth f n l) = length l

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

(List.modifyNth f n l).length = l.length


theorem normalize_num_den' (num den nz) : ∃ d : Nat, d ≠ 0 ∧
    num = (normalize num den nz).num * d ∧ den = (normalize num den nz).den * d

∃ d, d ≠ 0 ∧ num = (Rat.normalize num den nz).num * ↑d ∧ den = (Rat.normalize num den nz).den * d


@[simp]
theorem mk_coe_of_nndist_eq {α β} [PseudoMetricSpace α] [PseudoMetricSpace β] (f : α →ᵈ β)
    (h) : Dilation.mkOfNNDistEq f h = f

(f : α →ᵈ β)

(h : ∃ r, r ≠ 0 ∧ ∀ (x y : α), nndist (f x) (f y) = r * nndist x y)


/-- `J.diagram P`, as a functor in `P`. -/
@[simps]
def diagramFunctor (X : C) : (Cᵒᵖ ⥤ D) ⥤ (J.Cover X)ᵒᵖ ⥤ 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_1 Y : CategoryTheory.Functor Cᵒᵖ D} (η : X_1 ⟶ Y), (J.diagramFunctor D X).map η = J.diagramNatTrans η X


@[to_additive]
-- Porting note: renamed theorem to conform to naming convention
theorem comm_topologicalGroup_is_uniform : UniformGroup G

{G : Type u_1}
[CommGroup G]
[TopologicalSpace G]
[TopologicalGroup G]


theorem norm_sq_re_add_conj (x : K) : ‖x + conj x‖ ^ 2 = re (x + conj x) ^ 2

‖x + (starRingEnd K) x‖ ^ 2 = RCLike.re (x + (starRingEnd K) x) ^ 2


theorem four_zero_nine_six_lt_exp_sixteen : 4096 < exp 16


/-- If `α` is a seminormed ring with `‖1‖ = 1`, then `‖a ^ n‖ ≤ ‖a‖ ^ n`.
See also `norm_pow_le'`. -/
theorem norm_pow_le [NormOneClass α] (a : α) (n : ℕ) : ‖a ^ n‖ ≤ ‖a‖ ^ n

{α : Type u_1}
[SeminormedRing α]
[NormOneClass α]
(a : α)
(n : ℕ)


theorem map_eq_zero_iff (h : IsAdjoinRoot S f) {p} : h.map p = 0 ↔ f ∣ p

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRoot S f)
{p : R[X]}


protected theorem congr_fun {φ₁ φ₂ : A →ₐc[R] B} (H : φ₁ = φ₂) (x : A) : φ₁ x = φ₂ x

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
{φ₁ φ₂ : A →ₐc[R] B}
(H : φ₁ = φ₂)
(x : A)


theorem disjoint_span_singleton' {K E : Type*} [DivisionRing K] [AddCommGroup E] [Module K E]
    {p : Submodule K E} {x : E} (x0 : x ≠ 0) : Disjoint p (K ∙ x) ↔ x ∉ p

{K : Type u_9}
{E : Type u_10}
[DivisionRing K]
[AddCommGroup E]
[Module K E]
{p : Submodule K E}
{x : E}
(x0 : x ≠ 0)

Disjoint p (Submodule.span K {x}) ↔ x ∉ p


/-- A filter `f` is measurably generates if each `s ∈ f` includes a measurable `t ∈ f`. -/
class IsMeasurablyGenerated (f : Filter α) : Prop where
  exists_measurable_subset : ∀ ⦃s⦄, s ∈ f → ∃ t ∈ f, MeasurableSet t ∧ t ⊆ s

{α : Type u_1}
[MeasurableSpace α]
{f : Filter α}
[self : f.IsMeasurablyGenerated]
⦃s : Set α⦄


lemma ext_from_X' (i : ι) (hi : ¬ c.Rel i (c.next i)) {A : C} {f g : X φ i ⟶ A}
    (h : inrX φ i ≫ f = inrX φ i ≫ g) : f = g

{f g : HomologicalComplex.homotopyCofiber.X φ i ⟶ A}

(h : HomologicalComplex.homotopyCofiber.inrX φ i ≫ f = HomologicalComplex.homotopyCofiber.inrX φ i ≫ g)


/-- **Jordan's inequality** for `cos`. -/
lemma one_sub_two_div_pi_mul_le_cos (hx₀ : 0 ≤ x) (hx : x ≤ π / 2) : 1 - 2 / π * x ≤ cos x

{x : ℝ}
(hx₀ : 0 ≤ x)
(hx : x ≤ Real.pi / 2)


theorem lift_range_le {N} [Group N] (f : ∀ i, G i →* N) {s : Subgroup N}
    (h : ∀ i, (f i).range ≤ s) : (lift f).range ≤ s

{ι : Type u_1}
(G : ι → Type u_4)
[(i : ι) → Group (G i)]
{N : Type u_5}
[Group N]
(f : (i : ι) → G i →* N)
{s : Subgroup N}
(h : ∀ (i : ι), (f i).range ≤ s)


/-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is
also noetherian. -/
theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S]
    [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M

(R : Type u_1)
{S : Type u_2}
{M : Type u_3}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[SMul R S]
[Module S M]
[Module R M]
[IsScalarTower R S M]
(h : IsNoetherian R M)


/-- If `dist (f n) (f (n+1))` is bounded by `(C / 2) / 2^n`, then the distance from
`f n` to the limit of `f` is bounded above by `C / 2^n`. -/
theorem dist_le_of_le_geometric_two_of_tendsto {a : α} (ha : Tendsto f atTop (𝓝 a)) (n : ℕ) :
    dist (f n) a ≤ C / 2 ^ n

(ha : Filter.Tendsto f Filter.atTop (𝓝 a))


@[to_additive]
theorem Left.inv_le_self (h : 1 ≤ a) : a⁻¹ ≤ a

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


lemma Spec.map_injective {R S : CommRingCat} : Function.Injective (Spec.map : (R ⟶ S) → _)


/-- Let `f : ℝ → ℝ` be a differentiable function. If `f' < C`, then `f` grows slower than
`C * x` on `D`, i.e., `f y - f x < C * (y - x)` whenever `x < y`. -/
theorem image_sub_lt_mul_sub_of_deriv_lt {f : ℝ → ℝ} (hf : Differentiable ℝ f) {C}
    (lt_hf' : ∀ x, deriv f x < C) ⦃x y⦄ (hxy : x < y) : f y - f x < C * (y - x)

{f : ℝ → ℝ}
(hf : Differentiable ℝ f)
{C : ℝ}
(lt_hf' : ∀ (x : ℝ), deriv f x < C)
⦃x y : ℝ⦄
(hxy : x < y)


@[simp] lemma dens_univ : dens (univ : Finset α) = 1


/-- Conjugating a linear equiv by a linear equiv does not change its determinant. -/
@[simp]
theorem det_conj (f : M ≃ₗ[R] M) (e : M ≃ₗ[R] M') :
    LinearEquiv.det ((e.symm.trans f).trans e) = LinearEquiv.det f

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{M' : Type u_3}
[AddCommGroup M']
[Module R M']
(f : M ≃ₗ[R] M)
(e : M ≃ₗ[R] M')

LinearEquiv.det (e.symm ≪≫ₗ f ≪≫ₗ e) = LinearEquiv.det f


lemma MonovaryOn.pow_right₀ (hg : ∀ i ∈ s, 0 ≤ g i) (hfg : MonovaryOn f g s) (n : ℕ) :
    MonovaryOn f (g ^ n) s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedSemiring α]
[LinearOrderedSemiring β]
{s : Set ι}
{f : ι → α}
{g : ι → β}
(hg : ∀ i ∈ s, 0 ≤ g i)
(hfg : MonovaryOn f g s)
(n : ℕ)


@[scoped simp]
theorem map_nsmul_add [AddCommMonoid G] [AddMonoid H] [AddConstMapClass F G H a b]
    (f : F) (n : ℕ) (x : G) : f (n • a + x) = f x + n • b

{F : Type u_1}
{G : Type u_2}
{H : Type u_3}
[FunLike F G H]
{a : G}
{b : H}
[AddCommMonoid G]
[AddMonoid H]
[AddConstMapClass F G H a b]
(f : F)
(n : ℕ)
(x : G)


theorem col_injective [Nonempty ι] : Function.Injective (col ι : (m → α) → Matrix m ι α)

{m : Type u_2}
{α : Type v}
{ι : Type u_6}
[Nonempty ι]


protected theorem pos_of_ne_zero {n : Nat} : n ≠ 0 → 0 < n


lemma cons_lt_cons (a : α) (h : s < t) : a ::ₘ s < a ::ₘ t

{α : Type u_1}
{s t : Multiset α}
(a : α)
(h : s < t)


@[simp, norm_cast]
theorem coe_inf (s t : LowerSet α) : (↑(s ⊓ t) : Set α) = (s : Set α) ∩ t

{α : Type u_1}
[LE α]
(s t : LowerSet α)


@[simp] theorem top_toNNReal : ∞.toNNReal = 0


theorem le_one_iff {a : Ordinal} : a ≤ 1 ↔ a = 0 ∨ a = 1


@[simp]
theorem leftInv_coeff_zero (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F) :
    p.leftInv i 0 = 0

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
(i : E ≃L[𝕜] F)


theorem dimH_univ_eq_finrank : dimH (univ : Set E) = finrank ℝ E

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

dimH Set.univ = ↑(FiniteDimensional.finrank ℝ E)


@[simp]
theorem sup_eq_left : a ⊔ b = a ↔ b ≤ a

{α : Type u}
[SemilatticeSup α]
{a b : α}


@[simp]
theorem max_empty : (∅ : Finset α).max = ⊥


/-- A variant of `measure_eq_iInf` which has a single `iInf`. This is useful when applying a
  lemma next that only works for non-empty infima, in which case you can use
  `nonempty_measurable_superset`. -/
theorem measure_eq_iInf' (μ : Measure α) (s : Set α) :
    μ s = ⨅ t : { t // s ⊆ t ∧ MeasurableSet t }, μ t

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


/-- The terms of the sequence have nonzero norm. -/
theorem seq_norm_ne_zero (n : ℕ) : Algebra.norm ℤ (seq K w₁ hB n : 𝓞 K) ≠ 0

(hB : NumberField.mixedEmbedding.minkowskiBound K 1 < ↑(NumberField.mixedEmbedding.convexBodyLTFactor K) * ↑B)

(Algebra.norm ℤ) ↑(NumberField.Units.dirichletUnitTheorem.seq K w₁ hB n) ≠ 0


/-- **Schreier's Lemma**: If `R : Set G` is a `rightTransversal` of `H : Subgroup G`
  with `1 ∈ R`, and if `G` is generated by `S : Set G`, then `H` is generated by the `Set`
  `(R * S).image (fun g ↦ g * (toFun hR g)⁻¹)`. -/
theorem closure_mul_image_eq (hR : R ∈ rightTransversals (H : Set G)) (hR1 : (1 : G) ∈ R)
    (hS : closure S = ⊤) : closure ((R * S).image fun g => g * (toFun hR g : G)⁻¹) = H

(hR : R ∈ Subgroup.rightTransversals ↑H)

Subgroup.closure ((fun g => g * (↑(Subgroup.MemRightTransversals.toFun hR g))⁻¹) '' (R * S)) = H


/-- **First moment method**. The minimum of an integrable function is smaller than its mean. -/
theorem exists_le_average (hμ : μ ≠ 0) (hf : Integrable f μ) : ∃ x, f x ≤ ⨍ a, f a ∂μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ}
[MeasureTheory.IsFiniteMeasure μ]
(hμ : μ ≠ 0)
(hf : MeasureTheory.Integrable f μ)


/-- A topological space is **locally connected** if each neighborhood filter admits a basis
of connected *open* sets. Note that it is equivalent to each point having a basis of connected
(non necessarily open) sets but in a non-trivial way, so we choose this definition and prove the
equivalence later in `locallyConnectedSpace_iff_connected_basis`. -/
class LocallyConnectedSpace (α : Type*) [TopologicalSpace α] : Prop where
  /-- Open connected neighborhoods form a basis of the neighborhoods filter. -/
  open_connected_basis : ∀ x, (𝓝 x).HasBasis (fun s : Set α => IsOpen s ∧ x ∈ s ∧ IsConnected s) id

{α : Type u_3}
[TopologicalSpace α]
[self : LocallyConnectedSpace α]
(x : α)

(𝓝 x).HasBasis (fun s => IsOpen s ∧ x ∈ s ∧ IsConnected s) id


@[nontriviality] lemma stdSimplex_of_subsingleton [Subsingleton 𝕜] : stdSimplex 𝕜 ι = univ

(𝕜 : Type u_1)
(ι : Type u_5)
[OrderedSemiring 𝕜]
[Fintype ι]
[Subsingleton 𝕜]


theorem contDiff_cos {n} : ContDiff ℂ n cos


/-- The forgetful functor from bimonoid objects to comonoid objects. -/
@[simps!]
def toComon_ : Bimon_ C ⥤ Comon_ C

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

((Bimon_.toComon_ C).obj A).comul = A.comul.hom


/-- The Grothendieck construction applied to a functor to `Type`
(thought of as a functor to `Cat` by realising a type as a discrete category)
is the same as the 'category of elements' construction.
-/
-- See porting note on grothendieckTypeToCatInverse.
-- We just want to turn off grothendieckTypeToCat_inverse_map_fiber_down_down,
-- so have to list the complement here for `@[simps]`.
@[simps! functor_obj_fst functor_obj_snd functor_map_coe inverse_obj_base inverse_obj_fiber_as
  inverse_map_base unitIso_hom_app_base unitIso_hom_app_fiber unitIso_inv_app_base
  unitIso_inv_app_fiber counitIso_hom_app_coe counitIso_inv_app_coe]
def grothendieckTypeToCat : Grothendieck (G ⋙ typeToCat) ≌ G.Elements

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
(G : CategoryTheory.Functor C (Type w))

∀ {X Y : CategoryTheory.Grothendieck (G.comp CategoryTheory.typeToCat)} (f : X ⟶ Y),
  ↑((CategoryTheory.Grothendieck.grothendieckTypeToCat G).functor.map f) = f.base


@[simp]
theorem mem_map {f : E →ₗ[𝕜] F} {S : ConvexCone 𝕜 E} {y : F} : y ∈ S.map f ↔ ∃ x ∈ S, f x = y

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
{f : E →ₗ[𝕜] F}
{S : ConvexCone 𝕜 E}
{y : F}

y ∈ ConvexCone.map f S ↔ ∃ x ∈ S, f x = y


lemma setLIntegral_rnDeriv [HaveLebesgueDecomposition μ ν] [SFinite ν]
    (hμν : μ ≪ ν) (s : Set α) :
    ∫⁻ x in s, μ.rnDeriv ν x ∂ν = μ s

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


theorem lineMap_symm (p₀ p₁ : P1) :
    lineMap p₀ p₁ = (lineMap p₁ p₀).comp (lineMap (1 : k) (0 : k))

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
(p₀ p₁ : P1)

AffineMap.lineMap p₀ p₁ = (AffineMap.lineMap p₁ p₀).comp (AffineMap.lineMap 1 0)


lemma ShiftMkCore.shiftFunctorAdd_eq (h : ShiftMkCore C A) (a b : A) :
    letI := hasShiftMk C A h
    shiftFunctorAdd C a b = h.add a b

{C : Type u}
{A : Type u_1}
[CategoryTheory.Category.{v, u} C]
[AddMonoid A]
(h : CategoryTheory.ShiftMkCore C A)
(a b : A)

CategoryTheory.shiftFunctorAdd C a b = h.add a b


theorem zero_tprodCoeff (f : Π i, s i) : tprodCoeff R 0 f = 0

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
(f : (i : ι) → s i)


theorem Quot.eq {α : Type*} {r : α → α → Prop} {x y : α} :
    Quot.mk r x = Quot.mk r y ↔ EqvGen r x y

{α : Type u_3}
{r : α → α → Prop}
{x y : α}


/-- The sine of an angle in a right-angled triangle as a ratio of sides. -/
theorem sin_angle_of_angle_eq_pi_div_two {p₁ p₂ p₃ : P} (h : ∠ p₁ p₂ p₃ = π / 2)
    (h0 : p₁ ≠ p₂ ∨ p₃ ≠ p₂) : Real.sin (∠ p₂ p₃ p₁) = dist p₁ p₂ / dist p₁ p₃

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}
(h : ∠ p₁ p₂ p₃ = π / 2)
(h0 : p₁ ≠ p₂ ∨ p₃ ≠ p₂)


theorem prev_eq (f : Hom C₁ C₂) {i j : ι} (w : c.Rel i j) :
    f.prev j = (C₁.xPrevIso w).hom ≫ f.f i ≫ (C₂.xPrevIso w).inv


/-- Structure containing the minimal axioms required to check that an order is a coframe. Do NOT
use, except for implementing `Order.Coframe` via `Order.Coframe.ofMinimalAxioms`.

This structure omits the `sdiff`, `hnot` fields, which can be recovered using
`Order.Coframe.ofMinimalAxioms`. -/
class Order.Coframe.MinimalAxioms (α : Type u) extends CompleteLattice α where
  iInf_sup_le_sup_sInf (a : α) (s : Set α) : ⨅ b ∈ s, a ⊔ b ≤ a ⊔ sInf s

{α : Type u}
[self : Order.Coframe.MinimalAxioms α]
(a : α)
(s : Set α)


/-- Implementation of `SheafConditionPairwiseIntersections.coneEquiv`. -/
@[simps]
def coneEquivFunctorObj (c : Cone ((diagram U).op ⋙ F)) :
    Cone (SheafConditionEqualizerProducts.diagram F U)

(c : CategoryTheory.Limits.Cone ((CategoryTheory.Pairwise.diagram U).op ⋙ F))

(TopCat.Presheaf.SheafConditionPairwiseIntersections.coneEquivFunctorObj F U c).pt = c.pt


/-- This is a weaker version of `sup_sInf_eq` -/
theorem sup_sInf_le_iInf_sup : a ⊔ sInf s ≤ ⨅ b ∈ s, a ⊔ b

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


lemma toAdd_pow (a : Multiplicative ℕ) (b : ℕ) : toAdd (a ^ b) = toAdd a * b

Multiplicative.toAdd (a ^ b) = Multiplicative.toAdd a * b


theorem Integrable.integrableAtFilter (h : Integrable f μ) (l : Filter α) :
    IntegrableAtFilter f l μ

{α : Type u_1}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
{f : α → E}
{μ : MeasureTheory.Measure α}
(h : MeasureTheory.Integrable f μ)
(l : Filter α)


@[simp] lemma sigma_base_iff {B} :
    (Matroid.sigma M).Base B ↔ ∀ i, (M i).Base (Sigma.mk i ⁻¹' B)

{ι : Type u_1}
{α : ι → Type u_2}
{M : (i : ι) → Matroid (α i)}
{B : Set ((i : ι) × α i)}

(Matroid.sigma M).Base B ↔ ∀ (i : ι), (M i).Base (Sigma.mk i ⁻¹' B)


/-- A graph is connected if it's preconnected and contains at least one vertex.
This follows the convention observed by mathlib that something is connected iff it has
exactly one connected component.

There is a `CoeFun` instance so that `h u v` can be used instead of `h.Preconnected u v`. -/
@[mk_iff]
structure Connected : Prop where
  protected preconnected : G.Preconnected
  protected [nonempty : Nonempty V]

{V : Type u}
{G : SimpleGraph V}
(self : G.Connected)


@[simp]
theorem wbtw_self_iff {x y : P} : Wbtw R x y x ↔ y = x

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


theorem pos_eq_zero {l r it} (h : ValidFor l r it) : it.2 = 0 ↔ l = []

{l r : List Char}
{it : String.Iterator}
(h : String.Iterator.ValidFor l r it)


/-- **Lifting the exponent lemma** for odd primes. -/
theorem Int.pow_sub_pow {x y : ℤ} (hxy : ↑p ∣ x - y) (hx : ¬↑p ∣ x) (n : ℕ) :
    multiplicity (↑p) (x ^ n - y ^ n) = multiplicity (↑p) (x - y) + multiplicity p n

{p : ℕ}
(hp : Nat.Prime p)
(hp1 : Odd p)
{x y : ℤ}
(hxy : ↑p ∣ x - y)
(hx : ¬↑p ∣ x)
(n : ℕ)


lemma Shatters.mono_left (h : 𝒜 ⊆ ℬ) (h𝒜 : 𝒜.Shatters s) : ℬ.Shatters s

{α : Type u_1}
[DecidableEq α]
{𝒜 ℬ : Finset (Finset α)}
{s : Finset α}
(h : 𝒜 ⊆ ℬ)
(h𝒜 : 𝒜.Shatters s)


theorem _root_.Measurable.lintegral_kernel_prod_right'' {f : β × γ → ℝ≥0∞} (hf : Measurable f) :
    Measurable fun x => ∫⁻ y, f (x, y) ∂η (a, x)

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

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

Measurable fun x => ∫⁻ (y : γ), f (x, y) ∂η (a, x)


@[to_additive (attr := congr)]
theorem prod_congr (h : s₁ = s₂) : (∀ x ∈ s₂, f x = g x) → s₁.prod f = s₂.prod g

{α : Type u_3}
{β : Type u_4}
{s₁ s₂ : Finset α}
{f g : α → β}
[AddCommMonoid β]
(h : s₁ = s₂)

(∀ x ∈ s₂, f x = g x) → s₁.sum f = s₂.sum g


lemma Y_ne_negY_of_Y_ne [NoZeroDivisors R] {P Q : Fin 3 → R} (hP : W'.Equation P)
    (hQ : W'.Equation Q) (hx : P x * Q z ^ 2 = Q x * P z ^ 2) (hy : P y * Q z ^ 3 ≠ Q y * P z ^ 3) :
    P y ≠ W'.negY P

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
[NoZeroDivisors R]
{P Q : Fin 3 → R}
(hP : W'.Equation P)
(hQ : W'.Equation Q)
(hx : P x * Q z ^ 2 = Q x * P z ^ 2)
(hy : P y * Q z ^ 3 ≠ Q y * P z ^ 3)


/-- If `legendreSym p a = -1` and `p` divides `x^2 - a*y^2`, then `p` must divide `x` and `y`. -/
theorem prime_dvd_of_eq_neg_one {p : ℕ} [Fact p.Prime] {a : ℤ} (h : legendreSym p a = -1) {x y : ℤ}
    (hxy : (p : ℤ) ∣ x ^ 2 - a * y ^ 2) : ↑p ∣ x ∧ ↑p ∣ y

{p : ℕ}
[Fact (Nat.Prime p)]
{a : ℤ}
(h : legendreSym p a = -1)
{x y : ℤ}
(hxy : ↑p ∣ x ^ 2 - a * y ^ 2)

↑p ∣ x ∧ ↑p ∣ y


/-- Composition of two partial homeomorphisms when the target of the first and the source of
the second coincide. -/
@[simps! apply symm_apply toPartialEquiv, simps! (config := .lemmasOnly) source target]
protected def trans' (h : e.target = e'.source) : PartialHomeomorph X Z

{X : Type u_1}
{Y : Type u_3}
{Z : Type u_5}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(e : PartialHomeomorph X Y)
(e' : PartialHomeomorph Y Z)
(h : e.target = e'.source)

(e.trans' e' h).toPartialEquiv = e.trans' e'.toPartialEquiv h


theorem isLocallySurjective_iff_isIso {F G : Sheaf J (Type w)} (f : F ⟶ G) :
    IsLocallySurjective f ↔ IsIso (imageSheafι f)

{J : CategoryTheory.GrothendieckTopology C}

CategoryTheory.Sheaf.IsLocallySurjective f ↔ CategoryTheory.IsIso (CategoryTheory.GrothendieckTopology.imageSheafι f)


@[simp]
theorem to_lattice_hom_apply (f : F) (a : α) : toLatticeHom α β f a = f a

{F : Type u_1}
(α : Type u_3)
(β : Type u_4)
[LinearOrder α]
[Lattice β]
[FunLike F α β]
[OrderHomClass F α β]
(f : F)
(a : α)

(OrderHomClass.toLatticeHom α β f) a = f a


theorem LipschitzWith.coordinate [PseudoMetricSpace α] {f : α → ℓ^∞(ι)} (K : ℝ≥0) :
    LipschitzWith K f ↔ ∀ i : ι, LipschitzWith K (fun a : α ↦ f a i)

{α : Type u_1}
{ι : Type u_3}
[PseudoMetricSpace α]
{f : α → ↥(lp (fun i => ℝ) ⊤)}
(K : ℝ≥0)

LipschitzWith K f ↔ ∀ (i : ι), LipschitzWith K fun a => ↑(f a) i


theorem IsPreconnected.intermediate_value_Ioi {s : Set X} (hs : IsPreconnected s) {l₁ l₂ : Filter X}
    [NeBot l₁] [NeBot l₂] (hl₁ : l₁ ≤ 𝓟 s) (hl₂ : l₂ ≤ 𝓟 s) {f : X → α} (hf : ContinuousOn f s)
    {v : α} (ht₁ : Tendsto f l₁ (𝓝 v)) (ht₂ : Tendsto f l₂ atTop) : Ioi v ⊆ f '' s

(ht₂ : Filter.Tendsto f l₂ Filter.atTop)


theorem extend_unique_at [T2Space γ] {b : β} {f : α → γ} {g : β → γ} (di : DenseInducing i)
    (hf : ∀ᶠ x in comap i (𝓝 b), g (i x) = f x) (hg : ContinuousAt g b) : di.extend f b = g b

(hf : ∀ᶠ (x : α) in Filter.comap i (𝓝 b), g (i x) = f x)


@[to_additive]
theorem tprod_fintype [Fintype β] (f : β → α) : ∏' b, f b = ∏ b, f b

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
[Fintype β]
(f : β → α)


/-- The equivalence induced by `PartialFunToPointed` and `PointedToPartialFun`.
`Part.equivOption` made functorial. -/
@[simps!]
noncomputable def partialFunEquivPointed : PartialFun.{u} ≌ Pointed

∀ {X Y : Pointed} (f : X ⟶ Y) (a : { x // x ≠ X.point }) (property : f.toFun ↑a ≠ Y.point),
  ↑((partialFunEquivPointed.inverse.map f a).get property) = f.toFun ↑a


theorem ofEquiv_card [Fintype α] (f : α ≃ β) : @card β (ofEquiv α f) = card α

{α : Type u_1}
{β : Type u_2}
[Fintype α]
(f : α ≃ β)


theorem update_eq_erase_add_single {β : ι → Type*} [∀ i, AddZeroClass (β i)] (f : Π₀ i, β i)
    (i : ι) (b : β i) : f.update i b = f.erase i + single i b

{ι : Type u}
[DecidableEq ι]
{β : ι → Type u_1}
[(i : ι) → AddZeroClass (β i)]
(f : Π₀ (i : ι), β i)
(i : ι)
(b : β i)

DFinsupp.update i f b = DFinsupp.erase i f + DFinsupp.single i b


@[simp]
theorem ι_inj (x y : M) : ι R x = ι R y ↔ x = y

(R : Type u_1)
[CommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
(x y : M)

(TensorAlgebra.ι R) x = (TensorAlgebra.ι R) y ↔ x = y


theorem foldlM_eq_foldlM_data [Monad m]
    (f : β → α → m β) (init : β) (arr : Array α) :
    arr.foldlM f init = arr.data.foldlM f init

{m : Type u_1 → Type u_2}
{β : Type u_1}
{α : Type u_3}
[Monad m]
(f : β → α → m β)
(init : β)
(arr : Array α)

Array.foldlM f init arr 0 = List.foldlM f init arr.data


@[to_additive]
lemma powers_eq_zpowers (x : G) : (powers x : Set G) = zpowers x

{G : Type u_1}
[Group G]
[Finite G]
(x : G)

↑(Submonoid.powers x) = ↑(Subgroup.zpowers x)


/-- The translation of a strictly convex set is also strictly convex. -/
theorem StrictConvex.preimage_add_left (hs : StrictConvex 𝕜 s) (z : E) :
    StrictConvex 𝕜 ((fun x => x + z) ⁻¹' s)

{𝕜 : Type u_1}
{E : Type u_3}
[OrderedSemiring 𝕜]
[TopologicalSpace E]
[AddCancelCommMonoid E]
[ContinuousAdd E]
[Module 𝕜 E]
{s : Set E}
(hs : StrictConvex 𝕜 s)
(z : E)


/-- A component of a transposed version of the mates correspondence. -/
theorem mateEquiv_counit (α : G ⋙ L₂ ⟶ L₁ ⋙ H) (d : D) :
    L₂.map ((mateEquiv adj₁ adj₂ α).app _) ≫ adj₂.counit.app _ =
      α.app _ ≫ H.map (adj₁.counit.app d)

{C : Type u₁}
{D : Type u₂}
{E : Type u₃}
{F : Type u₄}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.Category.{v₃, u₃} E]
[CategoryTheory.Category.{v₄, u₄} F]
{G : CategoryTheory.Functor C E}
{H : CategoryTheory.Functor D F}
{L₁ : CategoryTheory.Functor C D}
{R₁ : CategoryTheory.Functor D C}
{L₂ : CategoryTheory.Functor E F}
{R₂ : CategoryTheory.Functor F E}
(adj₁ : L₁ ⊣ R₁)
(adj₂ : L₂ ⊣ R₂)
(α : G.comp L₂ ⟶ L₁.comp H)
(d : D)

CategoryTheory.CategoryStruct.comp (L₂.map (((CategoryTheory.mateEquiv adj₁ adj₂) α).app d))
    (adj₂.counit.app (H.obj d)) =
  CategoryTheory.CategoryStruct.comp (α.app (R₁.obj d)) (H.map (adj₁.counit.app d))


theorem gcd_dvd_gcd_mul_right (m n k : Nat) : gcd m n ∣ gcd (m * k) n


/-- `CSLift α β` is a typeclass used by `ring` for lifting operations from `α`
(which is not a commutative semiring) into a commutative semiring `β` by using an injective map
`lift : α → β`. -/
class CSLift (α : Type u) (β : outParam (Type u)) where
  /-- `lift` is the "canonical injection" from `α` to `β` -/
  lift : α → β
  /-- `lift` is an injective function -/
  inj : Function.Injective lift

{α : Type u}
{β : outParam (Type u)}
[self : Mathlib.Tactic.Ring.CSLift α β]


theorem Products.max_eq_o_cons_tail' [Inhabited I] (l : Products I) (hl : l.val ≠ [])
    (hlh : l.val.head! = term I ho) (hlc : List.Chain' (·>·) (term I ho :: l.Tail.val)) :
    l = ⟨term I ho :: l.Tail.val, hlc⟩

(ho : o < Ordinal.type fun x x_1 => x < x_1)

(l : Profinite.NobelingProof.Products I)

(hlh : (↑l).head! = Profinite.NobelingProof.term I ho)

(hlc : List.Chain' (fun x x_1 => x > x_1) (Profinite.NobelingProof.term I ho :: ↑l.Tail))

l = ⟨Profinite.NobelingProof.term I ho :: ↑l.Tail, hlc⟩


/-- Evaluation at point as a bundled continuous map. -/
@[simps (config := .asFn)]
def eval (i : I) : C(∀ j, X j, X i)

{I : Type u_5}
{X : I → Type u_7}
[(i : I) → TopologicalSpace (X i)]
(i : I)

⇑(ContinuousMap.eval i) = Function.eval i


theorem ne_zero_or_ne_zero_of_nat_coprime {A : Type u} [CommRing A] [Nontrivial A] {a b : ℕ}
    (h : Nat.Coprime a b) : (a : A) ≠ 0 ∨ (b : A) ≠ 0

{A : Type u}
[CommRing A]
[Nontrivial A]
{a b : ℕ}
(h : a.Coprime b)

↑a ≠ 0 ∨ ↑b ≠ 0


protected theorem mul_left_comm (a b c : Int) : a * (b * c) = b * (a * c)


lemma dblU_of_Z_eq_zero {P : Fin 3 → R} (hPz : P z = 0) : W'.dblU P = -3 * P x ^ 2

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{P : Fin 3 → R}
(hPz : P z = 0)


lemma prod_fac :
    (W₁.Q.prod W₂.Q) ⋙ prodLift F hF = F

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(F : CategoryTheory.Functor (C₁ × C₂) E)

(W₁.Q.prod W₂.Q).comp (CategoryTheory.Localization.StrictUniversalPropertyFixedTarget.prodLift F hF) = F


@[simp]
theorem restrict_toMeasurable_of_sFinite [SFinite μ] (s : Set α) :
    μ.restrict (toMeasurable μ s) = μ.restrict s

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

μ.restrict (MeasureTheory.toMeasurable μ s) = μ.restrict s


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

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

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


/-- The duality equivalence `(WidePullbackShape J)ᵒᵖ ≌ WidePushoutShape J` -/
@[simps]
def widePullbackShapeOpEquiv : (WidePullbackShape J)ᵒᵖ ≌ WidePushoutShape J

(CategoryTheory.Limits.widePullbackShapeOpEquiv J).unitIso = (CategoryTheory.Limits.widePullbackShapeOpUnop J).symm


@[simp]
theorem bind₁_verschiebungPoly_wittPolynomial (n : ℕ) :
    bind₁ verschiebungPoly (wittPolynomial p ℤ n) =
      if n = 0 then 0 else p * wittPolynomial p ℤ (n - 1)

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

(MvPolynomial.bind₁ WittVector.verschiebungPoly) (wittPolynomial p ℤ n) =
  if n = 0 then 0 else ↑p * wittPolynomial p ℤ (n - 1)


@[to_additive]
theorem toEquiv_apply {f : Quotient (QuotientGroup.rightRel H) → G}
    (hf : ∀ q, Quotient.mk'' (f q) = q) (q : Quotient (QuotientGroup.rightRel H)) :
    (toEquiv (range_mem_rightTransversals hf) q : G) = f q

{f : Quotient (QuotientAddGroup.rightRel H) → G}

(hf : ∀ (q : Quotient (QuotientAddGroup.rightRel H)), Quotient.mk'' (f q) = q)

↑((AddSubgroup.MemRightTransversals.toEquiv ⋯) q) = f q


theorem inner_sq_add_areaForm_sq (a b : E) : ⟪a, b⟫ ^ 2 + ω a b ^ 2 = ‖a‖ ^ 2 * ‖b‖ ^ 2

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

⟪a, b⟫_ℝ ^ 2 + (o.areaForm a) b ^ 2 = ‖a‖ ^ 2 * ‖b‖ ^ 2


@[simp]
theorem mem_toSubsemiring {S : Subalgebra R A} {x} : x ∈ S.toSubsemiring ↔ x ∈ S

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


/-- If a monic generates the annihilating ideal, it must match our choice
 of the annihilating ideal generator. -/
theorem monic_generator_eq_minpoly (a : A) (p : 𝕜[X]) (p_monic : p.Monic)
    (p_gen : Ideal.span {p} = annIdeal 𝕜 a) : annIdealGenerator 𝕜 a = p

(p_gen : Ideal.span {p} = Polynomial.annIdeal 𝕜 a)


theorem quotientRel_r_def {x y : M} : @Setoid.r _ p.quotientRel x y ↔ x - y ∈ p

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(p : Submodule R M)
{x y : M}


protected theorem summable_mul {p q : ℝ≥0∞} (hpq : p.toReal.IsConjExponent q.toReal)
    (f : lp E p) (g : lp E q) : Summable fun i => ‖f i‖ * ‖g i‖


/-- The abelian image in a functor category can be calculated componentwise. -/
@[simps!]
def imageObjIso : (Abelian.image α).obj X ≅ Abelian.image (α.app X)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type w}
[CategoryTheory.Category.{z, w} D]
[CategoryTheory.Abelian D]
{F G : CategoryTheory.Functor C D}
(α : F ⟶ G)
(X : C)

(CategoryTheory.Abelian.FunctorCategory.imageObjIso α X).inv =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Limits.kernel.map (CategoryTheory.Limits.cokernel.π (α.app X))
      ((CategoryTheory.Limits.cokernel.π α).app X) (CategoryTheory.CategoryStruct.id (G.obj X))
      (CategoryTheory.Limits.cokernelComparison α ((CategoryTheory.evaluation C D).obj X)) ⋯)
    (CategoryTheory.Limits.PreservesKernel.iso ((CategoryTheory.evaluation C D).obj X)
        (CategoryTheory.Limits.cokernel.π α)).inv


theorem sized_powersetCard (s : Finset α) (r : ℕ) : (powersetCard r s : Set (Finset α)).Sized r


@[simp]
theorem union_product [DecidableEq α] [DecidableEq β] : (s ∪ s') ×ˢ t = s ×ˢ t ∪ s' ×ˢ t

{α : Type u_1}
{β : Type u_2}
{s s' : Finset α}
{t : Finset β}
[DecidableEq α]
[DecidableEq β]


@[simp]
theorem disjoint_union_right : Disjoint s (t ∪ u) ↔ Disjoint s t ∧ Disjoint s u

{α : Type u_1}
[DecidableEq α]
{s t u : Finset α}


/-- Let `f : α → α` be a quasi ergodic map.
Let `g : α → X` be a null-measurable function from `α` to a nonempty measurable space
with a countable family of measurable sets separating the points of `X`.
If `g` is a.e.-invariant under `f`, then `g` is a.e. constant. -/
theorem QuasiErgodic.ae_eq_const_of_ae_eq_comp₀ (h : QuasiErgodic f μ) (hgm : NullMeasurable g μ)
    (hg_eq : g ∘ f =ᵐ[μ] g) : ∃ c, g =ᵐ[μ] const α c

(hgm : MeasureTheory.NullMeasurable g μ)


theorem isBounded_range_of_tendsto_cofinite {f : β → α} {a : α} (hf : Tendsto f cofinite (𝓝 a)) :
    IsBounded (range f)

(hf : Filter.Tendsto f Filter.cofinite (𝓝 a))


lemma stronglyMeasurable_countableFiltration_densityProcess (κ : Kernel α (γ × β)) (ν : Kernel α γ)
    (n : ℕ) (a : α) {s : Set β} (hs : MeasurableSet s) :
    StronglyMeasurable[countableFiltration γ n] (fun x ↦ densityProcess κ ν n a x s)

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

MeasureTheory.StronglyMeasurable fun x => κ.densityProcess ν n a x s


/-- The kernel of `g.unop` is the opposite of `cokernel g`. -/
@[simps!]
def kernelUnopUnop : kernel g.unop ≅ (cokernel g).unop

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]
{A B : Cᵒᵖ}
(g : A ⟶ B)

(CategoryTheory.kernelUnopUnop g).hom =
  (CategoryTheory.Limits.cokernel.desc g (CategoryTheory.Limits.kernel.ι g.unop).op ⋯).unop


@[to_additive]
theorem mul_one_div (x y : G) : x * (1 / y) = x / y

{G : Type u_3}
[SubNegMonoid G]
(x y : G)


@[simp]
theorem LinearMap.toMatrix₂_apply (B : M₁ →ₗ[R] M₂ →ₗ[R] N₂) (i : n) (j : m) :
    LinearMap.toMatrix₂ b₁ b₂ B i j = B (b₁ i) (b₂ j)

{R : Type u_1}
{M₁ : Type u_7}
{M₂ : Type u_8}
{N₂ : Type u_11}
{n : Type u_12}
{m : Type u_13}
[CommSemiring R]
[AddCommMonoid M₁]
[Module R M₁]
[AddCommMonoid M₂]
[Module R M₂]
[AddCommMonoid N₂]
[Module R N₂]
[DecidableEq n]
[Fintype n]
[DecidableEq m]
[Fintype m]
(b₁ : Basis n R M₁)
(b₂ : Basis m R M₂)
(B : M₁ →ₗ[R] M₂ →ₗ[R] N₂)
(i : n)
(j : m)

(LinearMap.toMatrix₂ b₁ b₂) B i j = (B (b₁ i)) (b₂ j)


/-- Two algebra morphism from the graded tensor product agree if their compositions with the left
and right inclusions agree. -/
@[ext]
lemma algHom_ext ⦃f g : (𝒜 ᵍ⊗[R] ℬ) →ₐ[R] C⦄
    (ha : f.comp (includeLeft 𝒜 ℬ) = g.comp (includeLeft 𝒜 ℬ))
    (hb : f.comp (includeRight 𝒜 ℬ) = g.comp (includeRight 𝒜 ℬ)) : f = g

(ha : f.comp (GradedTensorProduct.includeLeft 𝒜 ℬ) = g.comp (GradedTensorProduct.includeLeft 𝒜 ℬ))

(hb : f.comp (GradedTensorProduct.includeRight 𝒜 ℬ) = g.comp (GradedTensorProduct.includeRight 𝒜 ℬ))


@[simp]
theorem ulift_symm_down (x : α) : (Equiv.ulift.{u, v}.symm x).down = x


/--
  If an accumulation function `f`, produces the same output bits regardless of accumulation state,
  then the state is redundant and can be optimized out
-/
@[simp]
theorem mapAccumr₂_eq_map₂_of_unused_state (f : α → β → σ → σ × γ) (s : σ)
    (h : ∀ a b s s', (f a b s).snd = (f a b s').snd) :
    (mapAccumr₂ f xs ys s).snd = (map₂ (fun x y => (f x y s).snd) xs ys)

(f : α → β → σ → σ × γ)

(Mathlib.Vector.mapAccumr₂ f xs ys s).2 = Mathlib.Vector.map₂ (fun x y => (f x y s).2) xs ys


theorem eventualRange_eq_range_precomp (f : i ⟶ j) (g : j ⟶ k)
    (h : F.eventualRange k = range (F.map g)) : F.eventualRange k = range (F.map <| f ≫ g)

(h : F.eventualRange k = Set.range (F.map g))

F.eventualRange k = Set.range (F.map (f ≫ g))


/--
A *semisimple* Lie algebra is one that is a direct sum of non-abelian atomic ideals.
These ideals are simple Lie algebras, by `LieAlgebra.IsSemisimple.isSimple_of_isAtom`.

Note that the label 'semisimple' is apparently not universally agreed
[upon](https://mathoverflow.net/questions/149391/on-radicals-of-a-lie-algebra#comment383669_149391)
for general coefficients.

For example [Seligman, page 15](seligman1967) uses the label for `LieAlgebra.HasTrivialRadical`,
the weakest of the various properties which are all equivalent over a field of characteristic zero.
-/
class IsSemisimple : Prop where
  /-- In a semisimple Lie algebra, the supremum of the atoms is the whole Lie algebra. -/
  sSup_atoms_eq_top : sSup {I : LieIdeal R L | IsAtom I} = ⊤
  /-- In a semisimple Lie algebra, the atoms are independent. -/
  setIndependent_isAtom : CompleteLattice.SetIndependent {I : LieIdeal R L | IsAtom I}
  /-- In a semisimple Lie algebra, the atoms are non-abelian. -/
  non_abelian_of_isAtom : ∀ I : LieIdeal R L, IsAtom I → ¬ IsLieAbelian I

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[self : LieAlgebra.IsSemisimple R L]

CompleteLattice.SetIndependent {I | IsAtom I}


@[congr]
theorem bind_congr' {f g : α → Option β} {x y : Option α} (hx : x = y)
    (hf : ∀ a ∈ y, f a = g a) : x.bind f = y.bind g

{α : Type u_1}
{β : Type u_2}
{f g : α → Option β}
{x y : Option α}
(hx : x = y)
(hf : ∀ (a : α), a ∈ y → f a = g a)


/-- The identity morphism of a short complex. -/
@[simps]
def Hom.id : Hom S S

(CategoryTheory.ShortComplex.Hom.id S).τ₂ = CategoryTheory.CategoryStruct.id S.X₂


@[simp, norm_cast]
theorem coe_add (f g : P1 →ᵃ[k] V2) : ⇑(f + g) = f + g

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
{V2 : Type u_4}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]
(f g : P1 →ᵃ[k] V2)


/-- This property is equivalent to `α` being upper continuous. -/
theorem inf_sSup_eq_iSup_inf_sup_finset :
    a ⊓ sSup s = ⨆ (t : Finset α) (_ : ↑t ⊆ s), a ⊓ t.sup id

{α : Type u_2}
[CompleteLattice α]
[IsCompactlyGenerated α]
{a : α}
{s : Set α}

a ⊓ sSup s = ⨆ t, ⨆ (_ : ↑t ⊆ s), a ⊓ t.sup id


theorem card_sdiff_add_card_eq_card {s t : Finset α} (h : s ⊆ t) : card (t \ s) + card s = card t

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


@[simp]
theorem snd_prod (f : M →ₗ[R] M₂) (g : M →ₗ[R] M₃) : (snd R M₂ M₃).comp (prod f g) = g

{R : Type u}
{M : Type v}
{M₂ : Type w}
{M₃ : Type y}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M]
[Module R M₂]
[Module R M₃]
(f : M →ₗ[R] M₂)
(g : M →ₗ[R] M₃)


@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
protected theorem smul {𝕜} [TopologicalSpace 𝕜] [SMul 𝕜 β] [ContinuousSMul 𝕜 β] {f : α → 𝕜}
    {g : α → β} (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) :
    AEStronglyMeasurable (fun x => f x • g x) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

(hg : MeasureTheory.AEStronglyMeasurable g μ)

MeasureTheory.AEStronglyMeasurable (fun x => f x +ᵥ g x) μ


theorem sdiff_sup_cancel (h : b ≤ a) : a \ b ⊔ b = a

{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
{a b : α}
(h : b ≤ a)


/-- Characterization of neighborhoods for `ℝ≥0∞` numbers. See also `tendsto_order`
for a version with strict inequalities. -/
protected theorem tendsto_nhds {f : Filter α} {u : α → ℝ≥0∞} {a : ℝ≥0∞} (ha : a ≠ ∞) :
    Tendsto u f (𝓝 a) ↔ ∀ ε > 0, ∀ᶠ x in f, u x ∈ Icc (a - ε) (a + ε)

{α : Type u_1}
{f : Filter α}
{u : α → ℝ≥0∞}
{a : ℝ≥0∞}
(ha : a ≠ ⊤)

Filter.Tendsto u f (𝓝 a) ↔ ∀ ε > 0, ∀ᶠ (x : α) in f, u x ∈ Set.Icc (a - ε) (a + ε)


protected lemma lt_def : p < q ↔ p.num * q.den < q.num * p.den


@[csimp] theorem sublists_eq_sublistsFast : @sublists = @sublistsFast


@[simp]
theorem coe_mk (f : ContinuousMultilinearMap R (fun _ : ι => M) N) (h) : ⇑(mk f h) = f

(f : ContinuousMultilinearMap R (fun x => M) N)

(h : ∀ (v : ι → M) (i j : ι), v i = v j → i ≠ j → f.toFun v = 0)

⇑{ toContinuousMultilinearMap := f, map_eq_zero_of_eq' := h } = ⇑f


theorem le_ndinter {s t u : Multiset α} : s ≤ ndinter t u ↔ s ≤ t ∧ s ⊆ u

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


protected theorem ContinuousMap.HomotopyEquiv.contractibleSpace_iff (e : X ≃ₕ Y) :
    ContractibleSpace X ↔ ContractibleSpace Y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : X ≃ₕ Y)


theorem of_isClosed (h : ∀ t : Set X, (∀ s ∈ S, IsClosed ((↑) ⁻¹' t : Set s)) → IsClosed t) :
    RestrictGenTopology S

(h : ∀ (t : Set X), (∀ s ∈ S, IsClosed (Subtype.val ⁻¹' t)) → IsClosed t)


@[simp]
theorem mem_toSubfield (s : IntermediateField K L) (x : L) : x ∈ s.toSubfield ↔ x ∈ s

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(s : IntermediateField K L)
(x : L)


/-- The Poisson pmf is measurable. -/
@[measurability]
lemma measurable_poissonPMFReal (r : ℝ≥0) : Measurable (poissonPMFReal r)


/-- 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 κ ν)

Filter.Tendsto (↑(f p)) Filter.atBot (𝓝 0)


theorem MDifferentiableWithinAt.continuousWithinAt {f : M → M'} {s : Set M} {x : M}
    (hf : MDifferentiableWithinAt I I' f s x) :
    ContinuousWithinAt f s x


theorem tendsto_floor_left_pure_sub_one (n : ℤ) :
    Tendsto (floor : α → ℤ) (𝓝[<] n) (pure (n - 1))

{α : Type u_1}
[LinearOrderedRing α]
[FloorRing α]
[TopologicalSpace α]
[OrderClosedTopology α]
(n : ℤ)

Filter.Tendsto Int.floor (𝓝[<] ↑n) (pure (n - 1))


lemma eventually_one_add_smoothingFn_r_pos : ∀ᶠ (n : ℕ) in atTop, ∀ i, 0 < 1 + ε (r i n)

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

∀ᶠ (n : ℕ) in Filter.atTop, ∀ (i : α), 0 < 1 + AkraBazziRecurrence.smoothingFn ↑(r i n)


theorem coe_finsupp_sum (t : ι →₀ γ) (g : ι → γ → M →ₛₗ[σ₁₂] M₂) :
    ⇑(t.sum g) = t.sum fun i d => g i d

{R : Type u_4}
{R₂ : Type u_5}
{M : Type u_6}
{M₂ : Type u_7}
{ι : Type u_8}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
{σ₁₂ : R →+* R₂}
[Module R M]
[Module R₂ M₂]
{γ : Type u_9}
[Zero γ]
(t : ι →₀ γ)
(g : ι → γ → M →ₛₗ[σ₁₂] M₂)


/-- The map `normalizedFactorsEquivOfQuotEquiv` preserves multiplicities. -/
theorem normalizedFactorsEquivOfQuotEquiv_multiplicity_eq_multiplicity (hI : I ≠ ⊥) (hJ : J ≠ ⊥)
    (L : Ideal R) (hL : L ∈ normalizedFactors I) :
    multiplicity (↑(normalizedFactorsEquivOfQuotEquiv f hI hJ ⟨L, hL⟩)) J = multiplicity L I

(hL : L ∈ UniqueFactorizationMonoid.normalizedFactors I)

multiplicity (↑((normalizedFactorsEquivOfQuotEquiv f hI hJ) ⟨L, hL⟩)) J = multiplicity L I


@[to_additive]
theorem noncommProd_commute (s : Multiset α) (comm) (y : α) (h : ∀ x ∈ s, Commute y x) :
    Commute y (s.noncommProd comm)

(comm : {x | x ∈ s}.Pairwise AddCommute)


/-- Right scalar multiplication as an order isomorphism. -/
@[simps!]
def OrderIso.smulRight [PosSMulMono α β] [PosSMulReflectLE α β] {a : α} (ha : 0 < a) : β ≃o β

{α : Type u_1}
{β : Type u_2}
[GroupWithZero α]
[Preorder α]
[Preorder β]
[MulAction α β]
[PosSMulMono α β]
[PosSMulReflectLE α β]
{a : α}
(ha : 0 < a)
(b : β)


@[simp]
theorem AwayMap.lift_eq (hg : IsUnit (g x)) (a : R) : lift x hg ((algebraMap R S) a) = g a

{R : Type u_1}
[CommSemiring R]
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
{P : Type u_3}
[CommSemiring P]
(x : R)
[IsLocalization.Away x S]
{g : R →+* P}
(hg : IsUnit (g x))
(a : R)

(IsLocalization.Away.lift x hg) ((algebraMap R S) a) = g a


@[simp]
theorem not_mem_top : a ∉ (⊤ : UpperSet α)


@[simp]
theorem mkQ_apply (x : M) : p.mkQ x = (Quotient.mk x : M ⧸ p)

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(p : Submodule R M)
(x : M)


@[simp]
lemma comp_neg (α : Ext X Y n) {m : ℕ} (β : Ext Y Z m) {p : ℕ} (h : n + m = p) :
    α.comp (-β) h = -α.comp β h

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[CategoryTheory.HasExt C]
{X Y Z : C}
{n : ℕ}
(α : CategoryTheory.Abelian.Ext X Y n)
{m : ℕ}
(β : CategoryTheory.Abelian.Ext Y Z m)
{p : ℕ}
(h : n + m = p)


/-- One can reformulate smoothness within a set at a point as continuity within this set at this
point, and smoothness in the corresponding extended chart. This form states smoothness of `f`
written in such a way that the set is restricted to lie within the domain/codomain of the
corresponding charts.
Even though this expression is more complicated than the one in `contMDiffWithinAt_iff`, it is
a smaller set, but their germs at `extChartAt I x x` are equal. It is sometimes useful to rewrite
using this in the goal.
-/
theorem contMDiffWithinAt_iff' :
    ContMDiffWithinAt I I' n f s x ↔
      ContinuousWithinAt f s x ∧
        ContDiffWithinAt 𝕜 n (extChartAt I' (f x) ∘ f ∘ (extChartAt I x).symm)
          ((extChartAt I x).target ∩
            (extChartAt I x).symm ⁻¹' (s ∩ f ⁻¹' (extChartAt I' (f x)).source))
          (extChartAt I x x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
{s : Set M}
{x : M}
{n : ℕ∞}

ContMDiffWithinAt I I' n f s x ↔
  ContinuousWithinAt f s x ∧
    ContDiffWithinAt 𝕜 n (↑(extChartAt I' (f x)) ∘ f ∘ ↑(extChartAt I x).symm)
      ((extChartAt I x).target ∩ ↑(extChartAt I x).symm ⁻¹' (s ∩ f ⁻¹' (extChartAt I' (f x)).source))
      (↑(extChartAt I x) x)


@[simp, deprecated get_zipWith (since := "2024-05-09")]
theorem nthLe_zipWith {f : α → β → γ} {l : List α} {l' : List β} {i : ℕ}
    {h : i < (zipWith f l l').length} :
    (zipWith f l l').nthLe i h =
      f (l.nthLe i (lt_length_left_of_zipWith h)) (l'.nthLe i (lt_length_right_of_zipWith h))

{α : Type u}
{β : Type u_1}
{γ : Type u_2}
{f : α → β → γ}
{l : List α}
{l' : List β}
{i : ℕ}
{h : i < (List.zipWith f l l').length}

(List.zipWith f l l').nthLe i h = f (l.nthLe i ⋯) (l'.nthLe i ⋯)


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

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

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


@[to_additive]
theorem mul_iUnion (s : Set α) (t : ι → Set α) : (s * ⋃ i, t i) = ⋃ i, s * t i

{α : Type u_2}
{ι : Sort u_5}
[Add α]
(s : Set α)
(t : ι → Set α)


/-- The functor which sends `S : SnakeInput C` to `S.L₂'` which is
`S.L₀.X₃ ⟶ S.L₃.X₁ ⟶ S.L₃.X₂`. -/
@[simps]
noncomputable def functorL₂' : SnakeInput C ⥤ ShortComplex C

(S : CategoryTheory.ShortComplex.SnakeInput C)

CategoryTheory.ShortComplex.SnakeInput.functorL₂'.obj S = S.L₂'


theorem lintegral_countable' [Countable α] [MeasurableSingletonClass α] (f : α → ℝ≥0∞) :
    ∫⁻ a, f a ∂μ = ∑' a, f a * μ {a}

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

∫⁻ (a : α), f a ∂μ = ∑' (a : α), f a * μ {a}


theorem sumCongr_refl : sumCongr (Equiv.refl α) (Equiv.refl β) = Equiv.refl (α ⊕ β)

Equiv.Perm.sumCongr (Equiv.refl α) (Equiv.refl β) = Equiv.refl (α ⊕ β)


theorem nsmul_apply [∀ i, AddMonoid (β i)] (b : ℕ) (v : Π₀ i, β i) (i : ι) : (b • v) i = b • v i

{ι : Type u}
{β : ι → Type v}
[(i : ι) → AddMonoid (β i)]
(b : ℕ)
(v : Π₀ (i : ι), β i)
(i : ι)


/-- An auxiliary lemma that is used to specialize the general divergence theorem to spaces that do
not have the form `Fin n → ℝ`. -/
theorem integral_divergence_of_hasFDerivWithinAt_off_countable_of_equiv {F : Type*}
    [NormedAddCommGroup F] [NormedSpace ℝ F] [PartialOrder F] [MeasureSpace F] [BorelSpace F]
    (eL : F ≃L[ℝ] ℝⁿ⁺¹) (he_ord : ∀ x y, eL x ≤ eL y ↔ x ≤ y)
    (he_vol : MeasurePreserving eL volume volume) (f : Fin (n + 1) → F → E)
    (f' : Fin (n + 1) → F → F →L[ℝ] E) (s : Set F) (hs : s.Countable) (a b : F) (hle : a ≤ b)
    (Hc : ∀ i, ContinuousOn (f i) (Icc a b))
    (Hd : ∀ x ∈ interior (Icc a b) \ s, ∀ (i), HasFDerivAt (f i) (f' i x) x) (DF : F → E)
    (hDF : ∀ x, DF x = ∑ i, f' i x (eL.symm <| e i)) (Hi : IntegrableOn DF (Icc a b)) :
    ∫ x in Icc a b, DF x =
      ∑ i : Fin (n + 1),
        ((∫ x in Icc (eL a ∘ i.succAbove) (eL b ∘ i.succAbove),
            f i (eL.symm <| i.insertNth (eL b i) x)) -
          ∫ x in Icc (eL a ∘ i.succAbove) (eL b ∘ i.succAbove),
            f i (eL.symm <| i.insertNth (eL a i) x))

(he_ord : ∀ (x y : F), eL x ≤ eL y ↔ x ≤ y)

(he_vol : MeasureTheory.MeasurePreserving (⇑eL) MeasureTheory.volume MeasureTheory.volume)

(Hc : ∀ (i : Fin (n + 1)), ContinuousOn (f i) (Set.Icc a b))

(Hd : ∀ x ∈ interior (Set.Icc a b) \ s, ∀ (i : Fin (n + 1)), HasFDerivAt (f i) (f' i x) x)

(hDF : ∀ (x : F), DF x = ∑ i : Fin (n + 1), (f' i x) (eL.symm (Pi.single i 1)))

(Hi : MeasureTheory.IntegrableOn DF (Set.Icc a b) MeasureTheory.volume)

∫ (x : F) in Set.Icc a b, DF x =
  ∑ i : Fin (n + 1),
    ((∫ (x : Fin n → ℝ) in Set.Icc (eL a ∘ i.succAbove) (eL b ∘ i.succAbove), f i (eL.symm (i.insertNth (eL b i) x))) -
      ∫ (x : Fin n → ℝ) in Set.Icc (eL a ∘ i.succAbove) (eL b ∘ i.succAbove), f i (eL.symm (i.insertNth (eL a i) x)))


theorem LowerSemicontinuousOn.lowerSemicontinuousWithinAt (h : LowerSemicontinuousOn f s)
    (hx : x ∈ s) : LowerSemicontinuousWithinAt f s x

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


@[simp, norm_cast] lemma coe_one : ((1 : α) : WithZero α) = 1


theorem orthogonalFamily_eigenspaces' :
    OrthogonalFamily 𝕜 (fun μ : Eigenvalues T => eigenspace T μ) fun μ =>
      (eigenspace T μ).subtypeₗᵢ

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

OrthogonalFamily 𝕜 (fun μ => ↥(Module.End.eigenspace T (↑T μ))) fun μ => (Module.End.eigenspace T (↑T μ)).subtypeₗᵢ


@[simp]
theorem deriv_rpow_const (hf : DifferentiableAt ℝ f x) (hx : f x ≠ 0 ∨ 1 ≤ p) :
    deriv (fun x => f x ^ p) x = deriv f x * p * f x ^ (p - 1)

{f : ℝ → ℝ}
{x p : ℝ}
(hf : DifferentiableAt ℝ f x)
(hx : f x ≠ 0 ∨ 1 ≤ p)


theorem iso_eq_iso_refl {x : SimplexCategory} (e : x ≅ x) : e = Iso.refl x


@[simp]
theorem mul_inv_cancel_left_of_invertible (B : Matrix n m α) [Invertible A] : A * (A⁻¹ * B) = B

{m : Type u}
{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(A : Matrix n n α)
(B : Matrix n m α)
[Invertible A]


theorem sub_one_ne_self : ∀ {a}, a ≠ 0 → a - 1 ≠ a


/-- Build an isomorphism in the category `Semigroup` from a `MulEquiv` between `Semigroup`s. -/
@[to_additive (attr := simps)
  "Build an isomorphism in the category
  `AddSemigroup` from an `AddEquiv` between `AddSemigroup`s."]
def MulEquiv.toSemigrpIso (e : X ≃* Y) : Semigrp.of X ≅ Semigrp.of Y

{X Y : Type u}
[Semigroup X]
[Semigroup Y]
(e : X ≃* Y)

∀ (a : Y), e.toSemigrpIso.inv a = e.symm.toFun a


theorem eLpNormEssSup_lt_top_of_ae_nnnorm_bound {f : α → F} {C : ℝ≥0} (hfC : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ C) :
    eLpNormEssSup f μ < ∞

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
{f : α → F}
{C : ℝ≥0}
(hfC : ∀ᵐ (x : α) ∂μ, ‖f x‖₊ ≤ C)


theorem JoinedIn.mono {U V : Set X} (h : JoinedIn U x y) (hUV : U ⊆ V) : JoinedIn V x y

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
{U V : Set X}
(h : JoinedIn U x y)
(hUV : U ⊆ V)


theorem HasDerivAt.scomp_hasDerivWithinAt (hg : HasDerivAt g₁ g₁' (h x))
    (hh : HasDerivWithinAt h h' s x) : HasDerivWithinAt (g₁ ∘ h) (h' • g₁') s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(x : 𝕜)
{s : Set 𝕜}
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{h : 𝕜 → 𝕜'}
{h' : 𝕜'}
{g₁ : 𝕜' → F}
{g₁' : F}
(hg : HasDerivAt g₁ g₁' (h x))
(hh : HasDerivWithinAt h h' s x)


theorem le_iff_count {s t : Multiset α} : s ≤ t ↔ ∀ a, count a s ≤ count a t

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

s ≤ t ↔ ∀ (a : α), Multiset.count a s ≤ Multiset.count a t


theorem continuous_polynomial_eval_inv_mul (p : ℝ[X]) :
    Continuous (fun x ↦ p.eval x⁻¹ * expNegInvGlue x)

Continuous fun x => Polynomial.eval x⁻¹ p * expNegInvGlue x


theorem leftInverse_section_inclusion : Function.LeftInverse sectionΓ'Bool inclusionBoolΓ'


theorem NormedAddCommGroup.denseRange_toCompl : DenseRange (toCompl : G → Completion G)

{G : Type u_1}
[SeminormedAddCommGroup G]


theorem IsBigO.const_mul_right {g : α → 𝕜} {c : 𝕜} (hc : c ≠ 0) (h : f =O[l] g) :
    f =O[l] fun x => c * g x

{α : Type u_1}
{E : Type u_3}
{𝕜 : Type u_15}
[Norm E]
[NormedDivisionRing 𝕜]
{f : α → E}
{l : Filter α}
{g : α → 𝕜}
{c : 𝕜}
(hc : c ≠ 0)
(h : f =O[l] g)


/-- Given an action of an additive group `α` on a set `β`, each `g : α` defines a permutation of
`β`. -/
@[simps!]
def AddAction.toPermHom (α : Type*) [AddGroup α] [AddAction α β] :
    α →+ Additive (Equiv.Perm β)

(β : Type u_2)
(α : Type u_4)
[AddGroup α]
[AddAction α β]
(a : α)
(x : β)

((AddAction.toPermHom β α) a) x = a +ᵥ x


theorem Pi.sdiff_def [∀ i, SDiff (π i)] (x y : ∀ i, π i) :
    x \ y = fun i ↦ x i \ y i

{ι : Type u_1}
{π : ι → Type u_4}
[(i : ι) → SDiff (π i)]
(x y : (i : ι) → π i)


/-- If right-multiplication by any element is cancellative, right-multiplication by `g` is an
embedding. -/
@[to_additive (attr := simps)
      "If right-addition by any element is cancellative, right-addition by `g` is an
        embedding."]
def mulRightEmbedding [Mul G] [IsRightCancelMul G] (g : G) : G ↪ G

{G : Type u_1}
[Add G]
[IsRightCancelAdd G]
(g h : G)


lemma StarOrderedRing.nonneg_iff_quasispectrum_nonneg (a : A) (ha : p a := by cfc_tac) :
    0 ≤ a ↔ ∀ x ∈ quasispectrum R a, 0 ≤ x

[∀ (α : Type u_1) [inst : Zero α] [inst_1 : TopologicalSpace α], StarOrderedRing C(α, R)₀]


theorem compl_iInf₂ (f : ∀ i, κ i → UpperSet α) :
    (⨅ (i) (j), f i j).compl = ⨅ (i) (j), (f i j).compl

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

(⨅ i, ⨅ j, f i j).compl = ⨅ i, ⨅ j, (f i j).compl


/-- **Bernoulli's inequality** for real exponents, non-strict version: for `1 ≤ p` and `-1 ≤ s`
we have `1 + p * s ≤ (1 + s) ^ p`. -/
theorem one_add_mul_self_le_rpow_one_add {s : ℝ} (hs : -1 ≤ s) {p : ℝ} (hp : 1 ≤ p) :
    1 + p * s ≤ (1 + s) ^ p


lemma coe_toLinear_ne_zero_iff : (χ : L →ₗ[R] R) ≠ 0 ↔ χ.IsNonZero

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

LieModule.Weight.toLinear R L M χ ≠ 0 ↔ χ.IsNonZero


/-- Any nonempty compact Hausdorff semigroup where right-multiplication is continuous contains
an idempotent, i.e. an `m` such that `m * m = m`. -/
@[to_additive
      "Any nonempty compact Hausdorff additive semigroup where right-addition is continuous
      contains an idempotent, i.e. an `m` such that `m + m = m`"]
theorem exists_idempotent_of_compact_t2_of_continuous_mul_left {M} [Nonempty M] [Semigroup M]
    [TopologicalSpace M] [CompactSpace M] [T2Space M]
    (continuous_mul_left : ∀ r : M, Continuous (· * r)) : ∃ m : M, m * m = m

(continuous_mul_left : ∀ (r : M), Continuous fun x => x + r)


theorem unifIntegrable_of_tendsto_Lp_zero (hp : 1 ≤ p) (hp' : p ≠ ∞) (hf : ∀ n, Memℒp (f n) p μ)
    (hf_tendsto : Tendsto (fun n => eLpNorm (f n) p μ) atTop (𝓝 0)) : UnifIntegrable f p μ

{f : ℕ → α → β}

(hf : ∀ (n : ℕ), MeasureTheory.Memℒp (f n) p μ)

(hf_tendsto : Filter.Tendsto (fun n => MeasureTheory.eLpNorm (f n) p μ) Filter.atTop (𝓝 0))


0 = Surreal.mk 0 SetTheory.PGame.numeric_zero


/-- Reinterpret `α →* Multiplicative β` as `Additive α →+ β`. -/
@[simps!]
def MonoidHom.toAdditive' [MulOneClass α] [AddZeroClass β] :
    (α →* Multiplicative β) ≃ (Additive α →+ β)

{α : Type u}
{β : Type v}
[MulOneClass α]
[AddZeroClass β]

∀ (a : Additive α →+ β) (a_1 : α), (MonoidHom.toAdditive'.symm a) a_1 = Multiplicative.ofAdd (a (Additive.ofMul a_1))


theorem single_smul_coeff_add [MulZeroClass R] [SMulWithZero R V] {r : R} {x : HahnModule Γ' R V}
    {a : Γ'} {b : Γ} :
    ((of R).symm (HahnSeries.single b r • x)).coeff (b +ᵥ a) = r • ((of R).symm x).coeff a

{Γ : Type u_1}
{Γ' : Type u_2}
{R : Type u_3}
{V : Type u_4}
[PartialOrder Γ]
[PartialOrder Γ']
[VAdd Γ Γ']
[IsOrderedCancelVAdd Γ Γ']
[AddCommMonoid V]
[MulZeroClass R]
[SMulWithZero R V]
{r : R}
{x : HahnModule Γ' R V}
{a : Γ'}
{b : Γ}

((HahnModule.of R).symm ((HahnSeries.single b) r • x)).coeff (b +ᵥ a) = r • ((HahnModule.of R).symm x).coeff a


theorem den_mem_deg (f : HomogeneousLocalization 𝒜 x) : f.den ∈ 𝒜 f.deg

{ι : Type u_1}
{R : Type u_2}
{A : Type u_3}
[CommRing R]
[CommRing A]
[Algebra R A]
{𝒜 : ι → Submodule R A}
{x : Submonoid A}
(f : HomogeneousLocalization 𝒜 x)


theorem isConnected_Ioi [NoMaxOrder α] : IsConnected (Ioi a)

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


private lemma card_S_lt_card_T : (S).card < (T).card

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(A : Matrix α β ℤ)
(hn : Fintype.card α < Fintype.card β)
(hm : 0 < Fintype.card α)
[DecidableEq α]
[DecidableEq β]

(Finset.Icc
      (fun i =>
        ∑ j : β,
          ↑⌊(↑(Fintype.card β) * max 1 ‖A‖) ^ (↑(Fintype.card α) / (↑(Fintype.card β) - ↑(Fintype.card α)))⌋₊ *
            -(A i j)⁻)
      fun i =>
      ∑ j : β,
        ↑⌊(↑(Fintype.card β) * max 1 ‖A‖) ^ (↑(Fintype.card α) / (↑(Fintype.card β) - ↑(Fintype.card α)))⌋₊ *
          (A i j)⁺).card <
  (Finset.Icc 0 fun x =>
      ↑⌊(↑(Fintype.card β) * max 1 ‖A‖) ^ (↑(Fintype.card α) / (↑(Fintype.card β) - ↑(Fintype.card α)))⌋₊).card


/-- If `p : 𝓞 K` is a prime that divides both `S.a + S.b` and `S.a + η ^ 2 * S.b`, then `p`
is associated with `λ`. -/
lemma associated_of_dvd_a_add_b_of_dvd_a_add_eta_sq_mul_b {p : 𝓞 K} (hp : Prime p)
    (hpab : p ∣ (S.a + S.b)) (hpaηsqb : p ∣ (S.a + η ^ 2 * S.b)) : Associated p λ

(S : FermatLastTheoremForThreeGen.Solution hζ)


theorem subsingleton_zero_smul_set (s : Set β) : ((0 : α) • s).Subsingleton

{α : Type u_2}
{β : Type u_3}
[Zero α]
[Zero β]
[SMulWithZero α β]
(s : Set β)


theorem infs_subset_left : t₁ ⊆ t₂ → s ⊼ t₁ ⊆ s ⊼ t₂

{α : Type u_2}
[DecidableEq α]
[SemilatticeInf α]
{s t₁ t₂ : Finset α}

t₁ ⊆ t₂ → s ⊼ t₁ ⊆ s ⊼ t₂


@[simp]
theorem toDual_sSup (s : Set α) : toDual (sSup s) = sInf (ofDual ⁻¹' s)

{α : Type u_1}
[CompleteLattice α]
(s : Set α)

OrderDual.toDual (sSup s) = sInf (⇑OrderDual.ofDual ⁻¹' s)


theorem EuclideanSpace.norm_eq {𝕜 : Type*} [RCLike 𝕜] {n : Type*} [Fintype n]
    (x : EuclideanSpace 𝕜 n) : ‖x‖ = √(∑ i, ‖x i‖ ^ 2)

{𝕜 : Type u_8}
[RCLike 𝕜]
{n : Type u_9}
[Fintype n]
(x : EuclideanSpace 𝕜 n)


@[simp]
theorem coeFn_toRealAffineIsometryEquiv (f : PE ≃ᵢ PF) : ⇑f.toRealAffineIsometryEquiv = f

{E : Type u_1}
{PE : Type u_2}
{F : Type u_3}
{PF : Type u_4}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MetricSpace PE]
[NormedAddTorsor E PE]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[MetricSpace PF]
[NormedAddTorsor F PF]
(f : PE ≃ᵢ PF)


theorem HasFTaylorSeriesUpTo.hasFTaylorSeriesUpToOn (h : HasFTaylorSeriesUpTo n f p) (s : Set E) :
    HasFTaylorSeriesUpToOn n f p s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{n : ℕ∞}
{p : E → FormalMultilinearSeries 𝕜 E F}
(h : HasFTaylorSeriesUpTo n f p)
(s : Set E)


/-- Any power of a left-regular element is left-regular. -/
theorem IsLeftRegular.pow (n : ℕ) (rla : IsLeftRegular a) : IsLeftRegular (a ^ n)

{R : Type u_1}
{a : R}
[Monoid R]
(n : ℕ)
(rla : IsLeftRegular a)


theorem neg_val' {n : ℕ} [NeZero n] (a : ZMod n) : (-a).val = (n - a.val) % n


/-- `cantorFunction c` is strictly increasing with if `0 < c < 1/2`, if we endow `ℕ → Bool` with a
lexicographic order. The lexicographic order doesn't exist for these infinitary products, so we
explicitly write out what it means. -/
theorem increasing_cantorFunction (h1 : 0 < c) (h2 : c < 1 / 2) {n : ℕ} {f g : ℕ → Bool}
    (hn : ∀ k < n, f k = g k) (fn : f n = false) (gn : g n = true) :
    cantorFunction c f < cantorFunction c g

{c : ℝ}
(h1 : 0 < c)
(h2 : c < 1 / 2)
{n : ℕ}
{f g : ℕ → Bool}
(hn : ∀ k < n, f k = g k)
(fn : f n = false)
(gn : g n = true)

Cardinal.cantorFunction c f < Cardinal.cantorFunction c g


@[simp]
theorem Submodule.orthogonal_eq_bot_iff [HasOrthogonalProjection K] : Kᗮ = ⊥ ↔ K = ⊤

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
[HasOrthogonalProjection K]

Kᗮ = ⊥ ↔ K = ⊤


lemma three_ne_zero' [OfNat α 3] [NeZero (3 : α)] : (3 : α) ≠ 0

(α : Type u_2)
[Zero α]
[OfNat α 3]
[NeZero 3]


theorem single (hab : r a b) : ReflTransGen r a b

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


/-- If `M` and `M` are each other's inverse matrices, `Matrix.toLin M` and `Matrix.toLin M'`
form a linear equivalence. -/
@[simps]
def Matrix.toLinOfInv [DecidableEq m] {M : Matrix m n R} {M' : Matrix n m R} (hMM' : M * M' = 1)
    (hM'M : M' * M = 1) : M₁ ≃ₗ[R] M₂

{R : Type u_1}
[CommSemiring R]
{m : Type u_3}
{n : Type u_4}
[Fintype n]
[Fintype m]
[DecidableEq n]
{M₁ : Type u_5}
{M₂ : Type u_6}
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[Module R M₁]
[Module R M₂]
(v₁ : Basis n R M₁)
(v₂ : Basis m R M₂)
[DecidableEq m]
{M : Matrix m n R}
{M' : Matrix n m R}
(hMM' : M * M' = 1)
(hM'M : M' * M = 1)
(a : M₂)

(Matrix.toLinOfInv v₁ v₂ hMM' hM'M).symm a = ((Matrix.toLin v₂ v₁) M') a


/-- The unit isomorphism of the equivalence
`ShortComplex.functorEquivalence : ShortComplex (J ⥤ C) ≌ J ⥤ ShortComplex C`. -/
@[simps!]
def unitIso : 𝟭 _ ≅ functor J C ⋙ inverse J C

(X : CategoryTheory.ShortComplex (CategoryTheory.Functor J C))

∀ (X_1 : J),
  ((CategoryTheory.ShortComplex.FunctorEquivalence.unitIso J C).hom.app X).τ₁.app X_1 =
    CategoryTheory.CategoryStruct.id (X.X₁.obj X_1)


/-- The embedding of a metric space in its completion is an isometry. -/
theorem coe_isometry : Isometry ((↑) : α → Completion α)


@[simp]
theorem ker_codRestrict (f : M₁ →SL[σ₁₂] M₂) (p : Submodule R₂ M₂) (h : ∀ x, f x ∈ p) :
    ker (f.codRestrict p h) = ker f

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
(f : M₁ →SL[σ₁₂] M₂)
(p : Submodule R₂ M₂)
(h : ∀ (x : M₁), f x ∈ p)

LinearMap.ker (f.codRestrict p h) = LinearMap.ker f


/-- A (random) homomorphism from a separable extension L of K into a separably
  closed extension M of K. -/
noncomputable irreducible_def lift : L →ₐ[K] M

{K : Type u_1}
{L : Type u_2}
{M : Type u_3}
[Field K]
[Field L]
[Algebra K L]
[Field M]
[Algebra K M]
[IsSepClosed M]
[Algebra.IsSeparable K L]


theorem tail_sublistForall₂_self [IsRefl α Rₐ] (l : List α) : SublistForall₂ Rₐ l.tail l

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


lemma natCast_le_toNNReal {n : ℕ} {r : ℝ} (hn : n ≠ 0) : ↑n ≤ r.toNNReal ↔ n ≤ r


@[to_additive]
theorem continuous_finprod_cond {f : ι → X → M} {p : ι → Prop} (hc : ∀ i, p i → Continuous (f i))
    (hf : LocallyFinite fun i => mulSupport (f i)) :
    Continuous fun x => ∏ᶠ (i) (_ : p i), f i x

(hc : ∀ (i : ι), p i → Continuous (f i))

(hf : LocallyFinite fun i => Function.support (f i))

Continuous fun x => ∑ᶠ (i : ι) (_ : p i), f i x


@[simp]
theorem nndist_equiv_symm_fst (x₁ x₂ : α) :
    nndist ((WithLp.equiv p (α × β)).symm (x₁, 0)) ((WithLp.equiv p (α × β)).symm (x₂, 0)) =
      nndist x₁ x₂

(p : ℝ≥0∞)
(α : Type u_2)
(β : Type u_3)
[hp : Fact (1 ≤ p)]
[SeminormedAddCommGroup α]
[SeminormedAddCommGroup β]
(x₁ x₂ : α)


@[simp] protected theorem sub_zero (a : Int) : a - 0 = a


theorem add_le_zero_iff_le_neg' (a b : Int) : a + b ≤ 0 ↔ b ≤ -a


theorem isBounded_sUnion {S : Set (Set α)} (hs : S.Finite) :
    IsBounded (⋃₀ S) ↔ ∀ s ∈ S, IsBounded s

{α : Type u_2}
[Bornology α]
{S : Set (Set α)}
(hs : S.Finite)

Bornology.IsBounded (⋃₀ S) ↔ ∀ s ∈ S, Bornology.IsBounded s


/-- Split monomorphisms are also absolute monomorphisms. -/
@[simps]
def SplitMono.map {X Y : C} {f : X ⟶ Y} (sm : SplitMono f) (F : C ⥤ D) : SplitMono (F.map f)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{X Y : C}
{f : X ⟶ Y}
(sm : CategoryTheory.SplitMono f)
(F : CategoryTheory.Functor C D)

(sm.map F).retraction = F.map sm.retraction


theorem scanlTR_go_eq : ∀ l, scanlTR.go f l a acc = acc.data ++ scanl f a l

∀ {α : Type u_1} {α_1 : Type u_2} {f : α → α_1 → α} {a : α} {acc : Array α} (l : List α_1),
  List.scanlTR.go f l a acc = acc.data ++ List.scanl f a l


theorem setToSimpleFunc_neg (T : Set α → E →L[ℝ] F) (h_add : FinMeasAdditive μ T) {f : α →ₛ E}
    (hf : Integrable f μ) : setToSimpleFunc T (-f) = -setToSimpleFunc T f

(h_add : MeasureTheory.FinMeasAdditive μ T)

MeasureTheory.SimpleFunc.setToSimpleFunc T (-f) = -MeasureTheory.SimpleFunc.setToSimpleFunc T f


theorem ext_iff {f g : α ≃. β} : f = g ↔ ∀ x, f x = g x

{α : Type u}
{β : Type v}
{f g : α ≃. β}


@[simp]
theorem coe_mk (s : Set α) (h) : (mk s h : Set α) = s

{α : Type u_2}
[TopologicalSpace α]
(s : Set α)
(h : IsClopen s)


lemma UniformConvexOn.convexOn (hf : UniformConvexOn s φ f) (hφ : 0 ≤ φ) : ConvexOn ℝ s f

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{φ : ℝ → ℝ}
{s : Set E}
{f : E → ℝ}
(hf : UniformConvexOn s φ f)
(hφ : 0 ≤ φ)


/-- On a probability space, the (pre)ergodicity condition is a zero one law. -/
theorem prob_eq_zero_or_one [IsProbabilityMeasure μ] (hf : PreErgodic f μ) (hs : MeasurableSet s)
    (hs' : f ⁻¹' s = s) : μ s = 0 ∨ μ s = 1

{α : Type u_1}
{m : MeasurableSpace α}
{f : α → α}
{s : Set α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.IsProbabilityMeasure μ]
(hf : PreErgodic f μ)
(hs : MeasurableSet s)
(hs' : f ⁻¹' s = s)


theorem pairwise_iUnion {f : κ → Set α} (h : Directed (· ⊆ ·) f) :
    (⋃ n, f n).Pairwise r ↔ ∀ n, (f n).Pairwise r

{α : Type u_1}
{κ : Sort u_6}
{r : α → α → Prop}
{f : κ → Set α}
(h : Directed (fun x x_1 => x ⊆ x_1) f)

(⋃ n, f n).Pairwise r ↔ ∀ (n : κ), (f n).Pairwise r


theorem minFac_lemma (n k : ℕ) (h : ¬n < k * k) : sqrt n - k < sqrt n + 2 - k


theorem minimalPeriod_eq_zero_iff_nmem_periodicPts : minimalPeriod f x = 0 ↔ x ∉ periodicPts f

Function.minimalPeriod f x = 0 ↔ x ∉ Function.periodicPts f


@[to_additive (attr := simp)]
theorem Subgroup.exponent_top : Monoid.exponent (⊤ : Subgroup G) = Monoid.exponent G


/-- A *Coxeter matrix* is a symmetric matrix of natural numbers whose diagonal entries are equal to
1 and whose off-diagonal entries are not equal to 1. -/
@[ext]
structure CoxeterMatrix (B : Type*) where
  /-- The underlying matrix of the Coxeter matrix. -/
  M : Matrix B B ℕ
  isSymm : M.IsSymm := by decide
  diagonal i : M i i = 1 := by decide
  off_diagonal i i' : i ≠ i' → M i i' ≠ 1 := by decide

{B : Type u_1}
(self : CoxeterMatrix B)
(i i' : B)


lemma tendsto_nhds_compactOpen {l : Filter α} {f : α → C(Y, Z)} {g : C(Y, Z)} :
    Tendsto f l (𝓝 g) ↔
      ∀ K, IsCompact K → ∀ U, IsOpen U → MapsTo g K U → ∀ᶠ a in l, MapsTo (f a) K U

{α : Type u_1}
{Y : Type u_3}
{Z : Type u_4}
[TopologicalSpace Y]
[TopologicalSpace Z]
{l : Filter α}
{f : α → C(Y, Z)}
{g : C(Y, Z)}

Filter.Tendsto f l (𝓝 g) ↔
  ∀ (K : Set Y), IsCompact K → ∀ (U : Set Z), IsOpen U → Set.MapsTo (⇑g) K U → ∀ᶠ (a : α) in l, Set.MapsTo (⇑(f a)) K U


@[simp]
theorem forall₂_map_left_iff {f : γ → α} :
    ∀ {l u}, Forall₂ R (map f l) u ↔ Forall₂ (fun c b => R (f c) b) l u

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{R : α → β → Prop}
{f : γ → α}
{l : List γ}
{u : List β}

List.Forall₂ R (List.map f l) u ↔ List.Forall₂ (fun c b => R (f c) b) l u


@[simp]
theorem ofInjective'_apply (f : F) (hf : Function.Injective f) (x : A) :
    ofInjective' f hf x = f x

{F : Type v'}
{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[Star A]
[NonUnitalSemiring B]
[Module R B]
[Star B]
[FunLike F A B]
[NonUnitalAlgHomClass F R A B]
[NonUnitalStarAlgHomClass F R A B]
(f : F)
(hf : Function.Injective ⇑f)
(x : A)

↑((StarAlgEquiv.ofInjective' f hf) x) = f x


theorem limsSup_principal {s : Set α} (h : BddAbove s) (hs : s.Nonempty) :
    limsSup (𝓟 s) = sSup s

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s : Set α}
(h : BddAbove s)
(hs : s.Nonempty)


theorem ContDiffWithinAt.cexp {n} (hf : ContDiffWithinAt 𝕜 n f s x) :
    ContDiffWithinAt 𝕜 n (fun x => Complex.exp (f x)) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[NormedAlgebra 𝕜 ℂ]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : E → ℂ}
{x : E}
{s : Set E}
{n : ℕ∞}
(hf : ContDiffWithinAt 𝕜 n f s x)


@[to_additive] lemma isMulFreimanHom_id (hA : A₁ ⊆ A₂) : IsMulFreimanHom n A₁ A₂ id

{α : Type u_2}
[CommMonoid α]
{A₁ A₂ : Set α}
{n : ℕ}
(hA : A₁ ⊆ A₂)


theorem contMDiffAt_id : ContMDiffAt I I n (id : M → M) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{x : M}
{n : ℕ∞}


@[simp]
theorem vectorAllP_cons (p : α → Prop) (x : α) (v : Vector3 α n) :
    VectorAllP p (x :: v) ↔ p x ∧ VectorAllP p v

{α : Type u_1}
{n : ℕ}
(p : α → Prop)
(x : α)
(v : Vector3 α n)

VectorAllP p (Vector3.cons x v) ↔ p x ∧ VectorAllP p v


/-- Note that `b ∈ (s.filter (fun ab => Prod.fst ab = a)).image Prod.snd` iff `(a, b) ∈ s` so
we can simplify the right hand side of this lemma. However the form stated here is more useful for
iterating this lemma, e.g., if we have `f : α × β × γ → M`. -/
@[to_additive
      "Note that `b ∈ (s.filter (fun ab => Prod.fst ab = a)).image Prod.snd` iff `(a, b) ∈ s` so
      we can simplify the right hand side of this lemma. However the form stated here is more
      useful for iterating this lemma, e.g., if we have `f : α × β × γ → M`."]
theorem finprod_mem_finset_product' [DecidableEq α] [DecidableEq β] (s : Finset (α × β))
    (f : α × β → M) :
    (∏ᶠ (ab) (_ : ab ∈ s), f ab) =
      ∏ᶠ (a) (b) (_ : b ∈ (s.filter fun ab => Prod.fst ab = a).image Prod.snd), f (a, b)

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[CommMonoid M]
[DecidableEq α]
[DecidableEq β]
(s : Finset (α × β))
(f : α × β → M)

∏ᶠ (ab : α × β) (_ : ab ∈ s), f ab =
  ∏ᶠ (a : α) (b : β) (_ : b ∈ Finset.image Prod.snd (Finset.filter (fun ab => ab.1 = a) s)), f (a, b)


theorem strictMonoOn_logb_of_base_lt_one : StrictMonoOn (logb b) (Set.Iio 0)


theorem finrank_add_le_finrank_add_finrank (s t : Submodule K V) [FiniteDimensional K s]
    [FiniteDimensional K t] : finrank K (s ⊔ t : Submodule K V) ≤ finrank K s + finrank K t

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
(s t : Submodule K V)
[FiniteDimensional K ↥s]
[FiniteDimensional K ↥t]

FiniteDimensional.finrank K ↥(s ⊔ t) ≤ FiniteDimensional.finrank K ↥s + FiniteDimensional.finrank K ↥t


/-- A map `f` between modules over a semiring is linear if it satisfies the two properties
`f (x + y) = f x + f y` and `f (c • x) = c • f x`. The predicate `IsLinearMap R f` asserts this
property. A bundled version is available with `LinearMap`, and should be favored over
`IsLinearMap` most of the time. -/
structure IsLinearMap (R : Type u) {M : Type v} {M₂ : Type w} [Semiring R] [AddCommMonoid M]
  [AddCommMonoid M₂] [Module R M] [Module R M₂] (f : M → M₂) : Prop where
  /-- A linear map preserves addition. -/
  map_add : ∀ x y, f (x + y) = f x + f y
  /-- A linear map preserves scalar multiplication. -/
  map_smul : ∀ (c : R) (x), f (c • x) = c • f x

{R : Type u}
{M : Type v}
{M₂ : Type w}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
{f : M → M₂}
(self : IsLinearMap R f)
(x y : M)


theorem bernoulliPowerSeries_mul_exp_sub_one : bernoulliPowerSeries A * (exp A - 1) = X

(A : Type u_1)
[CommRing A]
[Algebra ℚ A]

bernoulliPowerSeries A * (PowerSeries.exp A - 1) = PowerSeries.X


@[to_additive (attr := simp)]
theorem prod_univ_get [CommMonoid α] (l : List α) : ∏ i : Fin l.length, l[i.1] = l.prod

{α : Type u_1}
[CommMonoid α]
(l : List α)


@[simp]
theorem toFinset_eq_univ [Fintype α] [Fintype s] : s.toFinset = Finset.univ ↔ s = univ

{α : Type u_1}
{s : Set α}
[Fintype α]
[Fintype ↑s]


@[simp] protected theorem «exists» {p : α ⊕ β → Prop} :
    (∃ x, p x) ↔ (∃ a, p (inl a)) ∨ ∃ b, p (inr b)

{α : Type u_1}
{β : Type u_2}
{p : α ⊕ β → Prop}

(∃ x, p x) ↔ (∃ a, p (Sum.inl a)) ∨ ∃ b, p (Sum.inr b)


@[to_additive (attr := continuity, fun_prop)]
theorem continuous_mk_symm : Continuous (@mk M).symm


theorem count_not_eq_count (hl : Chain' (· ≠ ·) l) (h2 : Even (length l)) (b : Bool) :
    count (!b) l = count b l

(hl : List.Chain' (fun x x_1 => x ≠ x_1) l)


/-- The restrictions of `x` and `y` to `n` are equal if and only if `x m = y m` for all `m < n`. -/
theorem res_eq_res {x y : ℕ → α} {n : ℕ} :
    res x n = res y n ↔ ∀ ⦃m⦄, m < n → x m = y m

PiNat.res x n = PiNat.res y n ↔ ∀ ⦃m : ℕ⦄, m < n → x m = y m


theorem top_eq_none : (⊤ : PartENat) = Part.none


@[reassoc (attr := simp)]
lemma toRightDerivedZero'_comp_iCycles {X : C}
    (P : InjectiveResolution X) (F : C ⥤ D) [F.Additive] :
    P.toRightDerivedZero' F ≫
      HomologicalComplex.iCycles _ _ = F.map (P.ι.f 0)

(P : CategoryTheory.InjectiveResolution X)

CategoryTheory.CategoryStruct.comp (P.toRightDerivedZero' F)
    (((F.mapHomologicalComplex (ComplexShape.up ℕ)).obj P.cocomplex).iCycles 0) =
  F.map (P.ι.f 0)


@[to_additive]
theorem div_ne_one : a / b ≠ 1 ↔ a ≠ b


@[to_additive] lemma range_smul [SMul α β] {ι : Sort*} (a : α) (f : ι → β) :
    range (fun i ↦ a • f i) = a • range f

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{ι : Sort u_5}
(a : α)
(f : ι → β)

(Set.range fun i => a • f i) = a • Set.range f


@[simp]
theorem sign_swap' {x y : α} : sign (swap x y) = if x = y then 1 else -1

{α : Type u}
[DecidableEq α]
[Fintype α]
{x y : α}

Equiv.Perm.sign (Equiv.swap x y) = if x = y then 1 else -1


protected theorem Surjective.exists₃ (hf : Surjective f) {p : β → β → β → Prop} :
    (∃ y₁ y₂ y₃, p y₁ y₂ y₃) ↔ ∃ x₁ x₂ x₃, p (f x₁) (f x₂) (f x₃)

{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
(hf : Function.Surjective f)
{p : β → β → β → Prop}


@[to_additive (attr := simp)]
theorem map_id_id : map (.id M) (.id N) = .id (M ∗ N)

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

AddMonoid.Coprod.map (AddMonoidHom.id M) (AddMonoidHom.id N) = AddMonoidHom.id (AddMonoid.Coprod M N)


theorem tendsto_abs_re (hl : IsExpCmpFilter l) : Tendsto (fun z : ℂ => |z.re|) l atTop

{l : Filter ℂ}
(hl : Complex.IsExpCmpFilter l)

Filter.Tendsto (fun z => |z.re|) l Filter.atTop


/-- A category is (finitary) extensive if it has finite coproducts,
and binary coproducts are van Kampen. -/
class FinitaryExtensive (C : Type u) [Category.{v} C] : Prop where
  [hasFiniteCoproducts : HasFiniteCoproducts C]
  [hasPullbacksOfInclusions : HasPullbacksOfInclusions C]
  /-- In a finitary extensive category, all coproducts are van Kampen-/
  van_kampen' : ∀ {X Y : C} (c : BinaryCofan X Y), IsColimit c → IsVanKampenColimit c

[self : CategoryTheory.FinitaryExtensive C]


theorem Monovary.comp_antitone_left (h : Monovary f g) (hf : Antitone f') : Antivary (f' ∘ f) g

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Preorder α]
[Preorder β]
[Preorder γ]
{f : ι → α}
{f' : α → γ}
{g : ι → β}
(h : Monovary f g)
(hf : Antitone f')