/-- Rotating twice is equivalent to rotating by the sum of the angles. -/
@[simp]
theorem rotation_trans (θ₁ θ₂ : Real.Angle) :
    (o.rotation θ₁).trans (o.rotation θ₂) = o.rotation (θ₂ + θ₁)

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


@[reassoc]
lemma leftHomologyIso_hom_naturality :
    S₁.leftHomologyIso.hom ≫ homologyMap φ =
      leftHomologyMap φ ≫ S₂.leftHomologyIso.hom

CategoryTheory.CategoryStruct.comp S₁.leftHomologyIso.hom (CategoryTheory.ShortComplex.homologyMap φ) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.leftHomologyMap φ) S₂.leftHomologyIso.hom


@[to_additive]
theorem hasProd_iff_hasProd_of_ne_one_bij {g : γ → α} (i : mulSupport g → β)
    (hi : Injective i) (hf : mulSupport f ⊆ Set.range i)
    (hfg : ∀ x, f (i x) = g x) : HasProd f a ↔ HasProd g a

(hf : Function.mulSupport f ⊆ Set.range i)

(hfg : ∀ (x : ↑(Function.mulSupport g)), f (i x) = g ↑x)


lemma liftAux_map {Y : C} (f : G.obj Y ⟶ X) {W : C} (g : W ⟶ Y) (i : S.Arrow)
    (h : G.obj W ⟶ i.Y) (w : h ≫ i.f = G.map g ≫ f) :
    liftAux hF α s f ≫ F.map g.op = s.ι i ≫ R.map h.op ≫ α.app _

{J : CategoryTheory.GrothendieckTopology C}

{K : CategoryTheory.GrothendieckTopology D}

(hF : CategoryTheory.Presheaf.IsSheaf J F)

(s : CategoryTheory.Limits.Multifork (S.index R))

CategoryTheory.RanIsSheafOfIsCocontinuous.liftAux hF α s f ≫ F.map g.op = s.ι i ≫ R.map h.op ≫ α.app (Opposite.op W)


@[reassoc (attr := simp)]
lemma toCycles_comp_homologyπ :
    S.toCycles ≫ S.homologyπ = 0

CategoryTheory.CategoryStruct.comp S.toCycles S.homologyπ = 0


theorem apply_eq_of_preconnectedSpace [PreconnectedSpace X] (f : LocallyConstant X Y) (x y : X) :
    f x = f y

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


theorem smul_eq_of_smul {i} (m : M i) (w : Word M) :
    m • w = of m • w

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
[(i : ι) → DecidableEq (M i)]
[DecidableEq ι]
{i : ι}
(m : M i)
(w : Monoid.CoprodI.Word M)


/-- We have the congruence `legendreSym p a ≡ a ^ (p / 2) mod p`. -/
theorem eq_pow (a : ℤ) : (legendreSym p a : ZMod p) = (a : ZMod p) ^ (p / 2)


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

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


theorem shift_shiftFunctorCompIsoId_neg_add_self_inv_app (n : A) (X : C) :
    ((shiftFunctorCompIsoId C (-n) n (neg_add_self n)).inv.app X)⟦-n⟧' =
    (shiftFunctorCompIsoId C n (-n) (add_neg_self n)).inv.app (X⟦-n⟧)

{C : Type u}
{A : Type u_1}
[CategoryTheory.Category.{v, u} C]
[AddGroup A]
[CategoryTheory.HasShift C A]
(n : A)
(X : C)

(CategoryTheory.shiftFunctor C (-n)).map ((CategoryTheory.shiftFunctorCompIsoId C (-n) n ⋯).inv.app X) =
  (CategoryTheory.shiftFunctorCompIsoId C n (-n) ⋯).inv.app ((CategoryTheory.shiftFunctor C (-n)).obj X)


/-- Bisimulation principle using `LiftR` to match and relate children of two trees. -/
theorem Cofix.bisim {α : TypeVec n} (r : Cofix F α → Cofix F α → Prop)
    (h : ∀ x y, r x y → LiftR (RelLast α r (i := _)) (Cofix.dest x) (Cofix.dest y)) :
    ∀ x y, r x y → x = y

(r : MvQPF.Cofix F α → MvQPF.Cofix F α → Prop)

(h : ∀ (x y : MvQPF.Cofix F α), r x y → MvFunctor.LiftR (fun {i} => α.RelLast r) x.dest y.dest)


@[to_additive additive_of_symmetric_of_isTotal]
lemma multiplicative_of_symmetric_of_isTotal
    (hsymm : Symmetric p) (hf_swap : ∀ {a b}, p a b → f a b * f b a = 1)
    (hmul : ∀ {a b c}, r a b → r b c → p a b → p b c → p a c → f a c = f a b * f b c)
    {a b c : α} (pab : p a b) (pbc : p b c) (pac : p a c) : f a c = f a b * f b c

(f : α → α → β)

(hf_swap : ∀ {a b : α}, p a b → f a b * f b a = 1)

(hmul : ∀ {a b c : α}, r a b → r b c → p a b → p b c → p a c → f a c = f a b * f b c)


@[to_additive]
theorem comap_map_eq_of_injective (S : Submonoid M) : (S.map f).comap f = S

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

AddSubmonoid.comap f (AddSubmonoid.map f S) = S


theorem abs_cos_eq_abs_sin_of_two_nsmul_add_two_nsmul_eq_pi {θ ψ : Angle}
    (h : (2 : ℕ) • θ + (2 : ℕ) • ψ = π) : |cos θ| = |sin ψ|

{θ ψ : Real.Angle}
(h : 2 • θ + 2 • ψ = ↑π)


@[simp, bv_toNat] theorem toNat_zeroExtend' {m n : Nat} (p : m ≤ n) (x : BitVec m) :
    (zeroExtend' p x).toNat = x.toNat

(BitVec.zeroExtend' p x).toNat = x.toNat


/-- Definition of `IsBigOWith`. We record it in a lemma as `IsBigOWith` is irreducible. -/
theorem isBigOWith_iff : IsBigOWith c l f g ↔ ∀ᶠ x in l, ‖f x‖ ≤ c * ‖g x‖

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{c : ℝ}
{f : α → E}
{g : α → F}
{l : Filter α}

Asymptotics.IsBigOWith c l f g ↔ ∀ᶠ (x : α) in l, ‖f x‖ ≤ c * ‖g x‖


@[to_additive (attr := simp)]
lemma ofUnits_sup_units (S T : Subgroup Mˣ) : (S.ofUnits ⊔ T.ofUnits).units = S ⊔ T

{M : Type u_1}
[AddMonoid M]
(S T : AddSubgroup (AddUnits M))

(S.ofAddUnits ⊔ T.ofAddUnits).addUnits = S ⊔ T


theorem zeroLocus_union (s s' : Set A) : zeroLocus 𝒜 (s ∪ s') = zeroLocus _ s ∩ zeroLocus _ s'

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

ProjectiveSpectrum.zeroLocus 𝒜 (s ∪ s') = ProjectiveSpectrum.zeroLocus 𝒜 s ∩ ProjectiveSpectrum.zeroLocus 𝒜 s'


theorem LpAddConst_lt_top (p : ℝ≥0∞) : LpAddConst p < ∞


theorem trace_tensorProduct : compr₂ (mapBilinear R M N M N) (trace R (M ⊗ N)) =
    compl₁₂ (lsmul R R : R →ₗ[R] R →ₗ[R] R) (trace R M) (trace R N)

(R : Type u_1)
[CommRing R]
(M : Type u_2)
[AddCommGroup M]
[Module R M]
(N : Type u_3)
[AddCommGroup N]
[Module R N]
[Module.Free R M]
[Module.Finite R M]
[Module.Free R N]
[Module.Finite R N]

(TensorProduct.mapBilinear R M N M N).compr₂ (LinearMap.trace R (TensorProduct R M N)) =
  (LinearMap.lsmul R R).compl₁₂ (LinearMap.trace R M) (LinearMap.trace R N)


theorem hcomp_id_app {H : D ⥤ E} (α : F ⟶ G) (X : C) : (α ◫ 𝟙 H).app X = H.map (α.app X)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
{F G : CategoryTheory.Functor C D}
{H : CategoryTheory.Functor D E}
(α : F ⟶ G)
(X : C)

(α ◫ CategoryTheory.CategoryStruct.id H).app X = H.map (α.app X)


@[simp]
theorem hrecOn'_mk'' {φ : Quotient s₁ → Sort*} (f : ∀ a, φ (Quotient.mk'' a))
    (c : ∀ a₁ a₂, a₁ ≈ a₂ → HEq (f a₁) (f a₂))
    (x : α) : (Quotient.mk'' x).hrecOn' f c = f x

(c : ∀ (a₁ a₂ : α), a₁ ≈ a₂ → HEq (f a₁) (f a₂))


theorem cast_eq_iff_heq : cast e a = a' ↔ HEq a a'


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

0 < ∫ (x : E), ExistsContDiffBumpBase.u x ∂MeasureTheory.Measure.addHaar


theorem measurePreserving_pi {β : ι → Type*} [∀ i, MeasurableSpace (β i)]
    (ν : (i : ι) → Measure (β i)) {f : (i : ι) → (α i) → (β i)} [∀ i, SigmaFinite (ν i)]
    (hf : ∀ i, MeasurePreserving (f i) (μ i) (ν i)) :
    MeasurePreserving (fun a i ↦ f i (a i)) (Measure.pi μ) (Measure.pi ν)

(μ : (i : ι) → MeasureTheory.Measure (α i))

(ν : (i : ι) → MeasureTheory.Measure (β i))

[∀ (i : ι), MeasureTheory.SigmaFinite (ν i)]

(hf : ∀ (i : ι), MeasureTheory.MeasurePreserving (f i) (μ i) (ν i))

MeasureTheory.MeasurePreserving (fun a i => f i (a i)) (MeasureTheory.Measure.pi μ) (MeasureTheory.Measure.pi ν)


@[simp]
theorem asIso_hom (f : X ⟶ Y) {_ : IsIso f} : (asIso f).hom = f

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

∀ {x : CategoryTheory.IsIso f}, (CategoryTheory.asIso f).hom = f


theorem support_X (H : ¬(1 : R) = 0) : (X : R[X]).support = singleton 1


theorem logDeriv_mul_const {f : 𝕜 → 𝕜'} (x : 𝕜) (a : 𝕜') (ha : a ≠ 0):
    logDeriv (fun z => f z * a) x = logDeriv f x

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{f : 𝕜 → 𝕜'}
(x : 𝕜)
(a : 𝕜')
(ha : a ≠ 0)


@[simp]
theorem mulVec_empty (A : Matrix m' (Fin 0) α) (v : Fin 0 → α) : A *ᵥ v = 0

{α : Type u}
{m' : Type uₘ}
[NonUnitalNonAssocSemiring α]
(A : Matrix m' (Fin 0) α)
(v : Fin 0 → α)


@[simp]
theorem sup_apply (x : E) : (p ⊔ q) x = p x ⊔ q x

{E : Type u_4}
[AddGroup E]
(p q : NonarchAddGroupSeminorm E)
(x : E)


theorem iCondIndep.iCondIndepSets {m : ι → MeasurableSpace Ω}
    {s : ι → Set (Set Ω)} (hms : ∀ n, m n = generateFrom (s n))
    (h_indep : iCondIndep m' hm' m μ) :
    iCondIndepSets m' hm' s μ

(hms : ∀ (n : ι), m n = MeasurableSpace.generateFrom (s n))

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

ProbabilityTheory.iCondIndepSets m' hm' s μ


theorem countP_map (f : α → β) (s : Multiset α) (p : β → Prop) [DecidablePred p] :
    countP p (map f s) = card (s.filter fun a => p (f a))

{α : Type u_1}
{β : Type v}
(f : α → β)
(s : Multiset α)
(p : β → Prop)
[DecidablePred p]

Multiset.countP p (Multiset.map f s) = Multiset.card (Multiset.filter (fun a => p (f a)) s)


/-- The natural isomorphism `shortComplexFunctor C c j ≅ shortComplexFunctor' C c i j k`
when `c.prev j = i` and `c.next j = k`. -/
@[simps!]
noncomputable def natIsoSc' (i j k : ι) (hi : c.prev j = i) (hk : c.next j = k) :
    shortComplexFunctor C c j ≅ shortComplexFunctor' C c i j k

((HomologicalComplex.natIsoSc' C c i j k hi hk).hom.app X).τ₂ = 𝟙 (X.X j)


theorem isCompl_top_bot : IsCompl (⊤ : α) ⊥

{α : Type u_1}
[Lattice α]
[BoundedOrder α]


theorem geom_mean_le_arith_mean4_weighted {w₁ w₂ w₃ w₄ p₁ p₂ p₃ p₄ : ℝ} (hw₁ : 0 ≤ w₁)
    (hw₂ : 0 ≤ w₂) (hw₃ : 0 ≤ w₃) (hw₄ : 0 ≤ w₄) (hp₁ : 0 ≤ p₁) (hp₂ : 0 ≤ p₂) (hp₃ : 0 ≤ p₃)
    (hp₄ : 0 ≤ p₄) (hw : w₁ + w₂ + w₃ + w₄ = 1) :
    p₁ ^ w₁ * p₂ ^ w₂ * p₃ ^ w₃ * p₄ ^ w₄ ≤ w₁ * p₁ + w₂ * p₂ + w₃ * p₃ + w₄ * p₄


theorem sup_himp_distrib (a b c : α) : a ⊔ b ⇨ c = (a ⇨ c) ⊓ (b ⇨ c)

{α : Type u_2}
[GeneralizedHeytingAlgebra α]
(a b c : α)


theorem aleph_limit {o : Ordinal} (ho : o.IsLimit) : aleph o = ⨆ a : Iio o, aleph a

Cardinal.aleph o = ⨆ a, Cardinal.aleph ↑a


@[simp]
theorem swap_apply_right (a b : α) : swap a b b = a

{α : Sort u_1}
[DecidableEq α]
(a b : α)


theorem w_compact_support {D : ℝ} (Dpos : 0 < D) : HasCompactSupport (w D : E → ℝ)

(E : Type u_1)
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
[MeasurableSpace E]
[BorelSpace E]
{D : ℝ}
(Dpos : 0 < D)


@[elab_as_elim]
protected theorem induction_on [Finite m] [Finite n] [Nonempty m] [Nonempty n]
    {P : Matrix m n α → Prop} (M : Matrix m n α) (h_add : ∀ p q, P p → P q → P (p + q))
    (h_std_basis : ∀ i j x, P (stdBasisMatrix i j x)) : P M

(h_add : ∀ (p q : Matrix m n α), P p → P q → P (p + q))

(h_std_basis : ∀ (i : m) (j : n) (x : α), P (Matrix.stdBasisMatrix i j x))


theorem isPrime_iff_mem_or_compl_mem [IsProper I] : IsPrime I ↔ ∀ {x : P}, x ∈ I ∨ xᶜ ∈ I

{P : Type u_1}
[BooleanAlgebra P]
{I : Order.Ideal P}
[I.IsProper]


/-- The L-series of the von Mangoldt function `Λ` equals the negative logarithmic derivative
of the L-series of the constant sequence `1` on its domain of convergence `re s > 1`. -/
lemma LSeries_vonMangoldt_eq {s : ℂ} (hs : 1 < s.re) : L ↗Λ s = - deriv (L 1) s / L 1 s

L (fun n => ↑(ArithmeticFunction.vonMangoldt n)) s = -deriv (L 1) s / L 1 s


theorem ofReal_eval (p : ℝ[X]) (x : ℝ) : (↑(p.eval x) : K) = aeval (↑x) p

{K : Type u_1}
[RCLike K]
(p : Polynomial ℝ)
(x : ℝ)

↑(Polynomial.eval x p) = (Polynomial.aeval ↑x) p


@[mono]
theorem connectedComponentIn_mono (x : α) {F G : Set α} (h : F ⊆ G) :
    connectedComponentIn F x ⊆ connectedComponentIn G x

{α : Type u}
[TopologicalSpace α]
(x : α)
{F G : Set α}
(h : F ⊆ G)


/-- A category is `MonoidalPreadditive` if tensoring is additive in both factors.

Note we don't `extend Preadditive C` here, as `Abelian C` already extends it,
and we'll need to have both typeclasses sometimes.
-/
class MonoidalPreadditive : Prop where
  whiskerLeft_zero : ∀ {X Y Z : C}, X ◁ (0 : Y ⟶ Z) = 0 := by aesop_cat
  zero_whiskerRight : ∀ {X Y Z : C}, (0 : Y ⟶ Z) ▷ X = 0 := by aesop_cat
  whiskerLeft_add : ∀ {X Y Z : C} (f g : Y ⟶ Z), X ◁ (f + g) = X ◁ f + X ◁ g := by aesop_cat
  add_whiskerRight : ∀ {X Y Z : C} (f g : Y ⟶ Z), (f + g) ▷ X = f ▷ X + g ▷ X := by aesop_cat

[self : CategoryTheory.MonoidalPreadditive C]

CategoryTheory.MonoidalCategory.whiskerRight 0 X = 0


/-- subsemigroup closure of a set is monotone in its argument: if `s ⊆ t`,
then `closure s ≤ closure t`. -/
@[to_additive "Additive subsemigroup closure of a set is monotone in its argument: if `s ⊆ t`,
  then `closure s ≤ closure t`"]
theorem closure_mono ⦃s t : Set M⦄ (h : s ⊆ t) : closure s ≤ closure t

{M : Type u_1}
[Mul M]
⦃s t : Set M⦄
(h : s ⊆ t)

Subsemigroup.closure s ≤ Subsemigroup.closure t


@[simp]
theorem toRingHom_eq_coe (f : A →ₐ[R] B) : f.toRingHom = f

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : A →ₐ[R] B)


theorem ker_sup_ker_le_ker_comp_of_commute {f g : M →ₗ[R] M} (h : Commute f g) :
    ker f ⊔ ker g ≤ ker (f ∘ₗ g)

{R : Type u_1}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{f g : M →ₗ[R] M}
(h : Commute f g)

LinearMap.ker f ⊔ LinearMap.ker g ≤ LinearMap.ker (f ∘ₗ g)


theorem nonempty_algHom_adjoin_of_splits : Nonempty (adjoin F S →ₐ[F] K)

(hK : ∀ s ∈ S, IsIntegral F s ∧ Polynomial.Splits (algebraMap F K) (minpoly F s))

Nonempty (↥(IntermediateField.adjoin F S) →ₐ[F] K)


@[simp]
theorem liftHom_comp {a b c : FreeBicategory B} (f : a ⟶ b) (g : b ⟶ c) :
    liftHom F (f ≫ g) = liftHom F f ≫ liftHom F g

{a b c : CategoryTheory.FreeBicategory B}

CategoryTheory.FreeBicategory.liftHom F (CategoryTheory.CategoryStruct.comp f g) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.FreeBicategory.liftHom F f)
    (CategoryTheory.FreeBicategory.liftHom F g)


@[to_additive (attr := simp)]
theorem mk_le_mk {s t : Set M} (h_mul) (h_mul') : mk s h_mul ≤ mk t h_mul' ↔ s ⊆ t

(h_mul : ∀ {a b : M}, a ∈ s → b ∈ s → a * b ∈ s)

(h_mul' : ∀ {a b : M}, a ∈ t → b ∈ t → a * b ∈ t)

{ carrier := s, mul_mem' := h_mul } ≤ { carrier := t, mul_mem' := h_mul' } ↔ s ⊆ t


theorem realize_noTopOrder_iff : M ⊨ Language.order.noTopOrderSentence ↔ NoTopOrder M

M ⊨ FirstOrder.Language.order.noTopOrderSentence ↔ NoTopOrder M


theorem one_act_left' : (R.one ▷ _) ≫ actLeft P Q = (λ_ _).hom

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁} (CategoryTheory.MonoidalCategory.tensorLeft X)]

R.one ▷ Bimod.TensorBimod.X P Q ≫ Bimod.TensorBimod.actLeft P Q = (λ_ (Bimod.TensorBimod.X P Q)).hom


@[elab_as_elim]
theorem leInductionOn {C : Multiset α → Multiset α → Prop} {s t : Multiset α} (h : s ≤ t)
    (H : ∀ {l₁ l₂ : List α}, l₁ <+ l₂ → C l₁ l₂) : C s t

(H : ∀ {l₁ l₂ : List α}, l₁ <+ l₂ → C ↑l₁ ↑l₂)


theorem discreteTopology_iff_nhds_ne [TopologicalSpace α] :
    DiscreteTopology α ↔ ∀ x : α, 𝓝[≠] x = ⊥

DiscreteTopology α ↔ ∀ (x : α), 𝓝[≠] x = ⊥


theorem fastGrowingε₀_two : fastGrowingε₀ 2 = 2048


@[simp]
theorem support_zero : (0 : R[X]).support = ∅


@[simp]
theorem extendDomain_eq_one_iff {e : Perm α} {f : α ≃ Subtype p} : e.extendDomain f = 1 ↔ e = 1

{α : Type u}
{β : Type v}
{p : β → Prop}
[DecidablePred p]
{e : Equiv.Perm α}
{f : α ≃ Subtype p}


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

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


lemma map_add_right_Ioc (a b c : α) : ((Ioc a b).map fun x => x + c) = Ioc (a + c) (b + c)

{α : Type u_1}
[OrderedCancelAddCommMonoid α]
[ExistsAddOfLE α]
[LocallyFiniteOrder α]
(a b c : α)

Multiset.map (fun x => x + c) (Multiset.Ioc a b) = Multiset.Ioc (a + c) (b + c)


@[to_additive]
theorem closedBall_one_div_singleton : closedBall 1 δ / {x} = closedBall x⁻¹ δ

{E : Type u_1}
[SeminormedAddCommGroup E]
(δ : ℝ)
(x : E)

Metric.closedBall 0 δ - {x} = Metric.closedBall (-x) δ


theorem supported_iUnion {δ : Type*} (s : δ → Set α) :
    supported M R (⋃ i, s i) = ⨆ i, supported M R (s i)

{α : Type u_1}
{M : Type u_2}
{R : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{δ : Type u_7}
(s : δ → Set α)

Finsupp.supported M R (⋃ i, s i) = ⨆ i, Finsupp.supported M R (s i)


@[to_additive]
theorem finset_prod_singleton {M ι : Type*} [CommMonoid M] (s : Finset ι) (I : ι → M) :
    ∏ i ∈ s, ({I i} : Set M) = {∏ i ∈ s, I i}

{M : Type u_5}
{ι : Type u_6}
[CommMonoid M]
(s : Finset ι)
(I : ι → M)


theorem card_fintype_uIcc : Fintype.card (Set.uIcc a b) = (b - a : ℤ).natAbs + 1

Fintype.card ↑(Set.uIcc a b) = (↑↑b - ↑↑a).natAbs + 1


lemma weightSpace_add_chainTop :
    weightSpace M (α + chainTop α β : L → R) = ⊥

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieAlgebra.IsNilpotent R L]
[NoZeroSMulDivisors ℤ R]
[NoZeroSMulDivisors R M]
[IsNoetherian R M]
(α : L → R)
(β : LieModule.Weight R L M)
(hα : α ≠ 0)

LieModule.weightSpace M (α + ⇑(LieModule.chainTop α β)) = ⊥


@[simp] theorem get_pure {α} (x : α) : (Thunk.pure x).get = x


@[simp]
theorem symmDiff_self : a ∆ a = ⊥

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


@[ext]
theorem ext {s t : SummableFamily Γ R α} (h : ∀ a : α, s a = t a) : s = t

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[AddCommMonoid R]
{α : Type u_3}
{s t : HahnSeries.SummableFamily Γ R α}
(h : ∀ (a : α), s a = t a)


@[norm_cast]
theorem coe_set_eq (L₁' L₂' : LieSubalgebra R L) : (L₁' : Set L) = L₂' ↔ L₁' = L₂'

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(L₁' L₂' : LieSubalgebra R L)


/-- A measure `μ : Measure α` is invariant under an additive action of `M` on `α` if for any
measurable set `s : Set α` and `c : M`, the measure of its preimage under `fun x => c +ᵥ x` is equal
to the measure of `s`. -/
class VAddInvariantMeasure (M α : Type*) [VAdd M α] {_ : MeasurableSpace α} (μ : Measure α) :
  Prop where
  measure_preimage_vadd : ∀ (c : M) ⦃s : Set α⦄, MeasurableSet s → μ ((fun x => c +ᵥ x) ⁻¹' s) = μ s

{M : Type u_1}
{α : Type u_2}
[VAdd M α]

∀ {x : MeasurableSpace α} {μ : MeasureTheory.Measure α} [self : MeasureTheory.VAddInvariantMeasure M α μ] (c : M)
  ⦃s : Set α⦄, MeasurableSet s → μ ((fun x => c +ᵥ x) ⁻¹' s) = μ s


/-- The glue data associated with an open cover.
The canonical isomorphism `𝒰.gluedCover.glued ⟶ X` is provided by `𝒰.fromGlued`. -/
@[simps]
def gluedCover : Scheme.GlueData.{u}

{X : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(x y : 𝒰.J)

𝒰.gluedCover.f x y = CategoryTheory.Limits.pullback.fst (𝒰.map x) (𝒰.map y)


theorem I_mul (z : ℂ) : I * z = ⟨-z.im, z.re⟩

Complex.I * z = { re := -z.im, im := z.re }


theorem image2_subset_left (ht : t ⊆ t') : image2 f s t ⊆ image2 f s t'

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{f : α → β → γ}
{s : Set α}
{t t' : Set β}
(ht : t ⊆ t')


@[simp]
theorem support_nonempty {u v : V} (p : G.Walk u v) : { w | w ∈ p.support }.Nonempty

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


/-- `ContinuousLinearMap.prod` as a `LinearEquiv`. -/
@[simps apply]
def prodₗ : ((M →L[R] N₂) × (M →L[R] N₃)) ≃ₗ[S] M →L[R] N₂ × N₃

{R : Type u_1}
(S : Type u_4)
[Semiring R]
[Semiring S]
{M : Type u_6}
[TopologicalSpace M]
[AddCommMonoid M]
[Module R M]
{N₂ : Type u_9}
[TopologicalSpace N₂]
[AddCommMonoid N₂]
[Module R N₂]
{N₃ : Type u_10}
[TopologicalSpace N₃]
[AddCommMonoid N₃]
[Module R N₃]
[Module S N₂]
[ContinuousConstSMul S N₂]
[SMulCommClass R S N₂]
[Module S N₃]
[SMulCommClass R S N₃]
[ContinuousConstSMul S N₃]
[ContinuousAdd N₂]
[ContinuousAdd N₃]

∀ (a : (M →L[R] N₂) × (M →L[R] N₃)), (ContinuousLinearMap.prodₗ S) a = ContinuousLinearMap.prodEquiv.toFun a


@[simp]
theorem subsingleton_dual_iff :
    Subsingleton (Dual K V) ↔ Subsingleton V

(K : Type uK)
{V : Type uV}
[CommRing K]
[AddCommGroup V]
[Module K V]
[Module.Free K V]

Subsingleton (Module.Dual K V) ↔ Subsingleton V


/-- A snake input in an abelian category `C` consists of morphisms
of short complexes `L₀ ⟶ L₁ ⟶ L₂ ⟶ L₃` (which should be visualized vertically) such
that `L₀` and `L₃` are respectively the kernel and the cokernel of `L₁ ⟶ L₂`,
`L₁` and `L₂` are exact, `L₁.g` is epi and `L₂.f` is mono. -/
structure SnakeInput where
  /-- the zeroth row -/
  L₀ : ShortComplex C
  /-- the first row -/
  L₁ : ShortComplex C
  /-- the second row -/
  L₂ : ShortComplex C
  /-- the third row -/
  L₃ : ShortComplex C
  /-- the morphism from the zeroth row to the first row -/
  v₀₁ : L₀ ⟶ L₁
  /-- the morphism from the first row to the second row -/
  v₁₂ : L₁ ⟶ L₂
  /-- the morphism from the second row to the third row -/
  v₂₃ : L₂ ⟶ L₃
  w₀₂ : v₀₁ ≫ v₁₂ = 0 := by aesop_cat
  w₁₃ : v₁₂ ≫ v₂₃ = 0 := by aesop_cat
  /-- `L₀` is the kernel of `v₁₂ : L₁ ⟶ L₂`. -/
  h₀ : IsLimit (KernelFork.ofι _ w₀₂)
  /-- `L₃` is the cokernel of `v₁₂ : L₁ ⟶ L₂`. -/
  h₃ : IsColimit (CokernelCofork.ofπ _ w₁₃)
  L₁_exact : L₁.Exact
  epi_L₁_g : Epi L₁.g
  L₂_exact : L₂.Exact
  mono_L₂_f : Mono L₂.f

(self : CategoryTheory.ShortComplex.SnakeInput C)


lemma isRatStieltjesPoint_defaultRatCDF (a : α) :
    IsRatStieltjesPoint (fun (_ : α) ↦ defaultRatCDF) a

ProbabilityTheory.IsRatStieltjesPoint (fun x => ProbabilityTheory.defaultRatCDF) a


theorem succ_castPred_le_iff {a b : Fin (n + 1)} (ha : a ≠ last n) :
    succ (a.castPred ha) ≤ b ↔ a < b

{n : ℕ}
{a b : Fin (n + 1)}
(ha : a ≠ Fin.last n)


@[simp] lemma mop_tensorHom {X₁ Y₁ X₂ Y₂ : C} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂) :
    (f ⊗ g).mop = g.mop ⊗ f.mop

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

(CategoryTheory.MonoidalCategory.tensorHom f g).mop = CategoryTheory.MonoidalCategory.tensorHom g.mop f.mop


/-- The identity oplax natural transformation. -/
@[simps]
def id : OplaxNatTrans F F

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.OplaxFunctor B C)
{a b : B}
(f : a ⟶ b)

(CategoryTheory.OplaxNatTrans.id F).naturality f =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.rightUnitor (F.map f)).hom
    (CategoryTheory.Bicategory.leftUnitor (F.map f)).inv


@[simp]
theorem filterMap_empty : (∅ : Finset α).filterMap f f_inj = ∅

{f_inj : ∀ (a a' : α), ∀ b ∈ f a, b ∈ f a' → a = a'}


theorem disjoint_filter_filter' (s t : Finset α)
    {p q : α → Prop} [DecidablePred p] [DecidablePred q] (h : Disjoint p q) :
    Disjoint (s.filter p) (t.filter q)

{α : Type u_1}
(s t : Finset α)
{p q : α → Prop}
[DecidablePred p]
[DecidablePred q]
(h : Disjoint p q)

Disjoint (Finset.filter p s) (Finset.filter q t)


theorem generatedNormal_isNormal : (generatedNormal X).IsNormal

{C : Type u}
[CategoryTheory.Groupoid C]
(X : (c d : C) → Set (c ⟶ d))


theorem intCast_snd (n : ℤ) : (n : 𝓜(𝕜, A)).snd = n

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


/-- Constructor for short complexes in `ModuleCat.{v} R` taking as inputs
linear maps `f` and `g` and the vanishing of their composition. -/
@[simps]
def moduleCatMk {X₁ X₂ X₃ : Type v} [AddCommGroup X₁] [AddCommGroup X₂] [AddCommGroup X₃]
    [Module R X₁] [Module R X₂] [Module R X₃] (f : X₁ →ₗ[R] X₂) (g : X₂ →ₗ[R] X₃)
    (hfg : g.comp f = 0) : ShortComplex (ModuleCat.{v} R)

{R : Type u}
[Ring R]
{X₁ X₂ X₃ : Type v}
[AddCommGroup X₁]
[AddCommGroup X₂]
[AddCommGroup X₃]
[Module R X₁]
[Module R X₂]
[Module R X₃]
(f : X₁ →ₗ[R] X₂)
(g : X₂ →ₗ[R] X₃)
(hfg : g ∘ₗ f = 0)

(CategoryTheory.ShortComplex.moduleCatMk f g hfg).X₃ = ModuleCat.of R X₃


@[to_additive (attr := simp)]
protected theorem le_div_iff : h ≤ f / g ↔ ∀ ⦃s⦄, s ∈ f → ∀ ⦃t⦄, t ∈ g → s / t ∈ h

{α : Type u_2}
[Div α]
{f g h : Filter α}

h ≤ f / g ↔ ∀ ⦃s : Set α⦄, s ∈ f → ∀ ⦃t : Set α⦄, t ∈ g → s / t ∈ h


@[to_additive]
theorem map_mul_right_inv_eq_self (μ : Measure G) [IsInvInvariant μ] [IsMulLeftInvariant μ]
    (g : G) : map (fun t => (g * t)⁻¹) μ = μ

{G : Type u_2}
[MeasurableSpace G]
[SubtractionMonoid G]
[MeasurableAdd G]
[MeasurableNeg G]
(μ : MeasureTheory.Measure G)
[μ.IsNegInvariant]
[μ.IsAddLeftInvariant]
(g : G)

MeasureTheory.Measure.map (fun t => -(g + t)) μ = μ


@[simp]
theorem ofHamming_smul [∀ i, SMul α (β i)] {r : α} {x : Hamming β} :
    ofHamming (r • x) = r • ofHamming x

{α : Type u_1}
{ι : Type u_2}
{β : ι → Type u_3}
[(i : ι) → SMul α (β i)]
{r : α}
{x : Hamming β}

Hamming.ofHamming (r • x) = r • Hamming.ofHamming x


/-- A version of `Filter.eventually_prod_iff` where the first filter consists of neighborhoods
in a pseudo-metric space. -/
theorem eventually_nhds_prod_iff {f : Filter ι} {x₀ : α} {p : α × ι → Prop} :
    (∀ᶠ x in 𝓝 x₀ ×ˢ f, p x) ↔ ∃ ε > (0 : ℝ), ∃ pa : ι → Prop, (∀ᶠ i in f, pa i) ∧
      ∀ {x}, dist x x₀ < ε → ∀ {i}, pa i → p (x, i)

{α : Type u}
{ι : Type u_2}
[PseudoMetricSpace α]
{f : Filter ι}
{x₀ : α}
{p : α × ι → Prop}

(∀ᶠ (x : α × ι) in 𝓝 x₀ ×ˢ f, p x) ↔
  ∃ ε > 0, ∃ pa, (∀ᶠ (i : ι) in f, pa i) ∧ ∀ {x : α}, dist x x₀ < ε → ∀ {i : ι}, pa i → p (x, i)


/-- A weakly regular sequence `rs` on `M` is regular if also `M/rsM ≠ 0`. -/
@[mk_iff]
structure IsRegular (rs : List R) extends IsWeaklyRegular M rs : Prop where
  top_ne_smul : (⊤ : Submodule R M) ≠ Ideal.ofList rs • ⊤

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

RingTheory.Sequence.IsRegular M rs ↔ RingTheory.Sequence.IsWeaklyRegular M rs ∧ ⊤ ≠ Ideal.ofList rs • ⊤


theorem ne_zero_iff_odd {n : ℕ} : (n : ZMod 2) ≠ 0 ↔ Odd n


/-- `γ`-valued functions on `α × β` are equivalent to functions `α → β → γ`. -/
@[simps (config := .asFn)]
def curry (α β γ) : (α × β → γ) ≃ (α → β → γ)

(α : Type u_1)
(β : Type u_2)
(γ : Type u_3)


theorem sup_right_idem (a b : α) : a ⊔ b ⊔ b = a ⊔ b

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


theorem CPolynomialAt.congr (hf : CPolynomialAt 𝕜 f x) (hg : f =ᶠ[𝓝 x] g) : CPolynomialAt 𝕜 g x

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{x : E}
(hf : CPolynomialAt 𝕜 f x)
(hg : f =ᶠ[𝓝 x] g)


@[simp]
theorem ker_zero : (0 : NormedAddGroupHom V₁ V₂).ker = ⊤

{V₁ : Type u_3}
{V₂ : Type u_4}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]


/-- The inverse of an upper-left subblock of a block-triangular matrix `M` is the upper-left
subblock of `M⁻¹`. -/
theorem BlockTriangular.inv_toBlock [LinearOrder α] [Invertible M] (hM : BlockTriangular M b)
    (k : α) :
    (M.toBlock (fun i => b i < k) fun i => b i < k)⁻¹ =
      M⁻¹.toBlock (fun i => b i < k) fun i => b i < k

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


@[simp]
theorem minimals_idem : minimals r (minimals r s) = minimals r s

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


protected theorem summable {m : ℝ} (hm : 1 < m) : Summable fun i : ℕ => 1 / m ^ i !


theorem log_pos_of_lt_neg_one (hx : x < -1) : 0 < log x


lemma nat_sqrt_helper {x y r : ℕ} (hr : y * y + r = x) (hle : Nat.ble r (2 * y)) :
    Nat.sqrt x = y

{x y r : ℕ}
(hr : y * y + r = x)
(hle : r.ble (2 * y) = true)


lemma TopologicalSpace.Clopens.surjective_finset_sup_prod :
    Surjective fun I : Finset (Clopens X × Clopens Y) ↦ I.sup fun i ↦ i.1 ×ˢ i.2

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[CompactSpace Y]
[CompactSpace X]

Function.Surjective fun I => I.sup fun i => i.1 ×ˢ i.2


@[simp] lemma repr_comp_embedding_eq_smul :
    snf.bM.repr m ∘ snf.f = snf.a • (snf.bN.repr m : Fin n → R)

{ι : Type u_1}
{R : Type u_2}
[CommRing R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{n : ℕ}
{N : Submodule R M}
(snf : Basis.SmithNormalForm N ι n)
(m : ↥N)

⇑(snf.bM.repr ↑m) ∘ ⇑snf.f = snf.a • ⇑(snf.bN.repr m)


@[simp, nolint simpNF] -- `simpNF` incorrectly complains the LHS doesn't simplify.
theorem single_smul (a b : α) (f : α → M) (r : R) : single a r b • f a = single a (r • f b) b

{α : Type u_1}
{M : Type u_5}
{R : Type u_11}
[Zero M]
[MonoidWithZero R]
[MulActionWithZero R M]
(a b : α)
(f : α → M)
(r : R)

(Finsupp.single a r) b • f a = (Finsupp.single a (r • f b)) b


@[to_additive]
theorem Left.self_lt_inv (h : a < 1) : a < a⁻¹

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


/-- The `r`-th slice of `𝒜` is a subset of `𝒜`. -/
theorem slice_subset : 𝒜 # r ⊆ 𝒜

{α : Type u_1}
{𝒜 : Finset (Finset α)}
{r : ℕ}


theorem ae_eq_restrict_iff_indicator_ae_eq {g : α → β} (hs : MeasurableSet s) :
    f =ᵐ[μ.restrict s] g ↔ s.indicator f =ᵐ[μ] s.indicator g

{α : Type u_2}
{β : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s : Set α}
{f : α → β}
[Zero β]
{g : α → β}
(hs : MeasurableSet s)


theorem ramificationIdx_lt {n : ℕ} (hgt : ¬map f p ≤ P ^ n) : ramificationIdx f p P < n

{R : Type u}
[CommRing R]
{S : Type v}
[CommRing S]
{f : R →+* S}
{p : Ideal R}
{P : Ideal S}
{n : ℕ}
(hgt : ¬Ideal.map f p ≤ P ^ n)


theorem smul_finset_sdiff₀ (ha : a ≠ 0) : a • (s \ t) = a • s \ a • t

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[GroupWithZero α]
[MulAction α β]
{s t : Finset β}
{a : α}
(ha : a ≠ 0)


@[to_additive]
theorem controlled_prod_of_mem_closure_range {j : E →* F} {b : F}
    (hb : b ∈ closure (j.range : Set F)) {f : ℕ → ℝ} (b_pos : ∀ n, 0 < f n) :
    ∃ a : ℕ → E,
      Tendsto (fun n => ∏ i ∈ range (n + 1), j (a i)) atTop (𝓝 b) ∧
        ‖j (a 0) / b‖ < f 0 ∧ ∀ n, 0 < n → ‖j (a n)‖ < f n

{E : Type u_6}
{F : Type u_7}
[SeminormedCommGroup E]
[SeminormedCommGroup F]
{j : E →* F}
{b : F}
(hb : b ∈ closure ↑j.range)
{f : ℕ → ℝ}
(b_pos : ∀ (n : ℕ), 0 < f n)

∃ a,
  Filter.Tendsto (fun n => ∏ i ∈ Finset.range (n + 1), j (a i)) Filter.atTop (𝓝 b) ∧
    ‖j (a 0) / b‖ < f 0 ∧ ∀ (n : ℕ), 0 < n → ‖j (a n)‖ < f n


lemma polyCharpoly_coeff_nilRankAux_ne_zero [Nontrivial R] :
    (polyCharpoly φ b).coeff (nilRankAux φ b) ≠ 0

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
{ι : Type u_5}
[CommRing R]
[AddCommGroup L]
[Module R L]
[AddCommGroup M]
[Module R M]
(φ : L →ₗ[R] Module.End R M)
[Fintype ι]
[DecidableEq ι]
[Module.Free R M]
[Module.Finite R M]
(b : Basis ι R L)
[Nontrivial R]

(φ.polyCharpoly b).coeff (φ.nilRankAux b) ≠ 0


/-- The type of bi-Heyting homomorphisms from `α` to `β`. Bounded lattice homomorphisms that
preserve Heyting implication and difference. -/
structure BiheytingHom (α β : Type*) [BiheytingAlgebra α] [BiheytingAlgebra β] extends
  LatticeHom α β where
  /-- The proposition that a bi-Heyting homomorphism preserves the Heyting implication. -/
  protected map_himp' : ∀ a b, toFun (a ⇨ b) = toFun a ⇨ toFun b
  /-- The proposition that a bi-Heyting homomorphism preserves the difference operation. -/
  protected map_sdiff' : ∀ a b, toFun (a \ b) = toFun a \ toFun b

{α : Type u_6}
{β : Type u_7}
[BiheytingAlgebra α]
[BiheytingAlgebra β]
(self : BiheytingHom α β)
(a b : α)

self.toFun (a ⇨ b) = self.toFun a ⇨ self.toFun b


@[simp]
theorem verschiebungFun_coeff_succ (x : 𝕎 R) (n : ℕ) :
    (verschiebungFun x).coeff n.succ = x.coeff n

{p : ℕ}
{R : Type u_1}
[CommRing R]
(x : WittVector p R)
(n : ℕ)

x.verschiebungFun.coeff n.succ = x.coeff n


lemma surjective_le_epimorphisms :
    MorphismProperty.surjective C ≤ epimorphisms C

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

CategoryTheory.MorphismProperty.surjective C ≤ CategoryTheory.MorphismProperty.epimorphisms C


@[to_additive]
lemma smul_eq_iff_eq_inv_smul (g : α) {x y : β} : g • x = y ↔ x = g⁻¹ • y

{α : Type u_1}
{β : Type u_2}
[AddGroup α]
[AddAction α β]
(g : α)
{x y : β}


theorem mulVec_neg [Fintype n] (v : n → α) (A : Matrix m n α) : A *ᵥ (-v) = - (A *ᵥ v)

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonUnitalNonAssocRing α]
[Fintype n]
(v : n → α)
(A : Matrix m n α)


@[simp]
theorem sumAssoc_symm_apply_inr_inl {α β γ} (b) :
    (sumAssoc α β γ).symm (inr (inl b)) = inl (inr b)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(b : β)

(Equiv.sumAssoc α β γ).symm (Sum.inr (Sum.inl b)) = Sum.inl (Sum.inr b)


@[simp]
theorem preimage_sub_const_Ioo : (fun x => x - a) ⁻¹' Ioo b c = Ioo (b + a) (c + a)

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

(fun x => x - a) ⁻¹' Set.Ioo b c = Set.Ioo (b + a) (c + a)


@[simp]
lemma piFinset_of_isEmpty [IsEmpty α] (s : ∀ a, Finset (γ a)) : piFinset s = univ

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


@[simp, mfld_simps]
theorem mfderivWithin_univ : mfderivWithin I I' f univ = mfderiv I I' f

{𝕜 : 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'}
[Is : SmoothManifoldWithCorners I M]
[I's : SmoothManifoldWithCorners I' M']

mfderivWithin I I' f Set.univ = mfderiv I I' f


@[reassoc (attr := simp)]
theorem PInfty_idem : (PInfty : K[X] ⟶ _) ≫ PInfty = PInfty

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{X : CategoryTheory.SimplicialObject C}

AlgebraicTopology.DoldKan.PInfty ≫ AlgebraicTopology.DoldKan.PInfty = AlgebraicTopology.DoldKan.PInfty


protected theorem add_neg_cancel_right (a b : Int) : a + b + -b = a


protected theorem inv_mul_le_iff {x y z : ℝ≥0∞} (h1 : x ≠ 0) (h2 : x ≠ ∞) :
    x⁻¹ * y ≤ z ↔ y ≤ x * z

{x y z : ENNReal}
(h1 : x ≠ 0)
(h2 : x ≠ ⊤)


theorem tendsto_extend_comp_iff {α : Type*} {l : Filter α} {g : α → M}
    (hg : ∀ᶠ z in l, g z ∈ f.source) {y : M} (hy : y ∈ f.source) :
    Tendsto (f.extend I ∘ g) l (𝓝 (f.extend I y)) ↔ Tendsto g l (𝓝 y)

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(f : PartialHomeomorph M H)
(I : ModelWithCorners 𝕜 E H)
{α : Type u_8}
{l : Filter α}
{g : α → M}
(hg : ∀ᶠ (z : α) in l, g z ∈ f.source)
{y : M}
(hy : y ∈ f.source)

Filter.Tendsto (↑(f.extend I) ∘ g) l (𝓝 (↑(f.extend I) y)) ↔ Filter.Tendsto g l (𝓝 y)


theorem add_bddBelow_range_add {p q : NonarchAddGroupSeminorm E} {x : E} :
    BddBelow (range fun y => p y + q (x - y))

{E : Type u_4}
[AddCommGroup E]
{p q : NonarchAddGroupSeminorm E}
{x : E}

BddBelow (Set.range fun y => p y + q (x - y))


theorem Subring.toNonUnitalSubring_toSubring (S : Subring R) :
    S.toNonUnitalSubring.toSubring S.one_mem = S


theorem eq_on_support_mem_disjoint {l : List (Perm α)} (h : f ∈ l) (hl : l.Pairwise Disjoint) :
    ∀ x ∈ f.support, f x = l.prod x

(hl : List.Pairwise Equiv.Perm.Disjoint l)


theorem upperSemicontinuousAt_const : UpperSemicontinuousAt (fun _x => z) x

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{x : α}
{z : β}


@[reassoc (attr := simp)]
theorem Q_f_naturality (q n : ℕ) {X Y : SimplicialObject C} (f : X ⟶ Y) :
    f.app (op [n]) ≫ (Q q).f n = (Q q).f n ≫ f.app (op [n])

{X Y : CategoryTheory.SimplicialObject C}

f.app (Opposite.op [n]) ≫ (AlgebraicTopology.DoldKan.Q q).f n =
  (AlgebraicTopology.DoldKan.Q q).f n ≫ f.app (Opposite.op [n])


protected lemma Connected.sup {H K : G.Subgraph}
    (hH : H.Connected) (hK : K.Connected) (hn : (H ⊓ K).verts.Nonempty) :
    (H ⊔ K).Connected

{V : Type u}
{G : SimpleGraph V}
{H K : G.Subgraph}
(hH : H.Connected)
(hK : K.Connected)
(hn : (H ⊓ K).verts.Nonempty)


theorem coe_pow (f : M₁ →L[R₁] M₁) (n : ℕ) : ⇑(f ^ n) = f^[n]

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
(f : M₁ →L[R₁] M₁)
(n : ℕ)


theorem degree_one_le : degree (1 : R[X]) ≤ (0 : WithBot ℕ)


@[simp]
theorem sqrt_eq_one : √x = 1 ↔ x = 1


@[simp, norm_cast]
theorem coe_toLinearMap (f : L₁ →ₗ⁅R⁆ L₂) : ⇑(f : L₁ →ₗ[R] L₂) = f

{R : Type u}
{L₁ : Type v}
{L₂ : Type w}
[CommRing R]
[LieRing L₁]
[LieAlgebra R L₁]
[LieRing L₂]
[LieAlgebra R L₂]
(f : L₁ →ₗ⁅R⁆ L₂)


@[simp]
theorem inner_coe (a b : E) : inner (a : Completion E) (b : Completion E) = (inner a b : 𝕜)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(a b : E)


@[to_additive]
theorem Multipliable.mul_compl {s : Set β} (hs : Multipliable (f ∘ (↑) : s → α))
    (hsc : Multipliable (f ∘ (↑) : (sᶜ : Set β) → α)) : Multipliable f

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
[ContinuousMul α]
{s : Set β}
(hs : Multipliable (f ∘ Subtype.val))
(hsc : Multipliable (f ∘ Subtype.val))


/-- If an integrable function `f : α → E` takes values in a strictly convex closed set `s`, then
either it is a.e. equal to its average value, or its average value belongs to the interior of
`s`. -/
theorem StrictConvex.ae_eq_const_or_average_mem_interior [IsFiniteMeasure μ] (hs : StrictConvex ℝ s)
    (hsc : IsClosed s) (hfs : ∀ᵐ x ∂μ, f x ∈ s) (hfi : Integrable f μ) :
    f =ᵐ[μ] const α (⨍ x, f x ∂μ) ∨ (⨍ x, f x ∂μ) ∈ interior s

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{μ : MeasureTheory.Measure α}
{s : Set E}
{f : α → E}
[MeasureTheory.IsFiniteMeasure μ]
(hs : StrictConvex ℝ s)
(hsc : IsClosed s)
(hfs : ∀ᵐ (x : α) ∂μ, f x ∈ s)
(hfi : MeasureTheory.Integrable f μ)

f =ᵐ[μ] Function.const α (⨍ (x : α), f x ∂μ) ∨ ⨍ (x : α), f x ∂μ ∈ interior s


protected theorem eventually_eq {f : X → Y} (hf : IsLocallyConstant f) (x : X) :
    ∀ᶠ y in 𝓝 x, f y = f x

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


@[mono, gcongr]
lemma div_le_div_of_nonneg_right (hab : a ≤ b) (hc : 0 ≤ c) : a / c ≤ b / c

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


theorem Ico_eq_filter_ssubsets : Ico s t = t.ssubsets.filter (s ⊆ ·)

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

Finset.Ico s t = Finset.filter (fun x => s ⊆ x) t.ssubsets


theorem bddAbove_coe {s : Set ℚ≥0} : BddAbove ((↑) '' s : Set ℚ) ↔ BddAbove s


/-- The determinant of `rotation` (as a linear map) is equal to `1`. -/
@[simp]
theorem det_rotation (a : circle) : LinearMap.det ((rotation a).toLinearEquiv : ℂ →ₗ[ℝ] ℂ) = 1

LinearMap.det ↑(rotation a).toLinearEquiv = 1


theorem objX_add_one (n) :
    objX X (n + 1) = Finset.univ.inf fun k : Fin (n + 1) => kernelSubobject (X.δ k.succ)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]
(X : CategoryTheory.SimplicialObject C)
(n : ℕ)

AlgebraicTopology.NormalizedMooreComplex.objX X (n + 1) =
  Finset.univ.inf fun k => CategoryTheory.Limits.kernelSubobject (X.δ k.succ)


@[simp]
lemma homMap_map (f : X ⟶ Y) :
    Φ.homMap L₁ L₂ (L₁.map f) = L₂.map (Φ.functor.map f)

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)


/-- The identity triangle morphism.
-/
@[simps]
def triangleMorphismId (T : Triangle C) : TriangleMorphism T T

(T : CategoryTheory.Pretriangulated.Triangle C)

(CategoryTheory.Pretriangulated.triangleMorphismId T).hom₃ = 𝟙 T.obj₃


@[simp]
theorem iUnion_eq_empty : π₁.iUnion = ∅ ↔ π₁ = ⊥

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{π₁ : BoxIntegral.Prepartition I}


theorem submodule_comap_pow_reverse (p : Submodule R (CliffordAlgebra Q)) (n : ℕ) :
    (p ^ n).comap (reverse : CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q) =
      p.comap (reverse : CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q) ^ n

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
(p : Submodule R (CliffordAlgebra Q))
(n : ℕ)

Submodule.comap CliffordAlgebra.reverse (p ^ n) = Submodule.comap CliffordAlgebra.reverse p ^ n


@[to_additive]
theorem one_def : (1 : S') = ⟨1, OneMemClass.one_mem S'⟩

{A : Type u_4}
{M₁ : Type u_5}
[SetLike A M₁]
[Zero M₁]
[hA : ZeroMemClass A M₁]
(S' : A)


@[to_additive (attr := simp)] lemma div_apply (f g : M →* G) (x : M) : (f / g) x = f x / g x

{M : Type u_3}
{G : Type u_6}
[MulOneClass M]
[CommGroup G]
(f g : M →* G)
(x : M)


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

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


/-- A variant of the **extended Hales-Jewett theorem** `exists_mono_in_high_dimension` where the
returned type is some `Fin n` instead of a general fintype. -/
theorem exists_mono_in_high_dimension_fin (α κ η) [Finite α] [Finite κ] [Finite η] :
    ∃ n, ∀ C : (Fin n → α) → κ, ∃ l : Subspace η α (Fin n), l.IsMono C

(α : Type u_5)
(κ : Type u_6)
(η : Type u_7)
[Finite α]
[Finite κ]
[Finite η]

∃ n, ∀ (C : (Fin n → α) → κ), ∃ l, Combinatorics.Subspace.IsMono C l


@[to_additive]
lemma card_fiber_eq_of_mem_range (f : F) {x y : M} (hx : x ∈ Set.range f) (hy : y ∈ Set.range f) :
    (univ.filter <| fun g => f g = x).card = (univ.filter <| fun g => f g = y).card

{G : Type u_1}
{M : Type u_2}
{F : Type u_3}
[Group G]
[Fintype G]
[Monoid M]
[DecidableEq M]
[FunLike F G M]
[MonoidHomClass F G M]
(f : F)
{x y : M}
(hx : x ∈ Set.range ⇑f)
(hy : y ∈ Set.range ⇑f)

(Finset.filter (fun g => f g = x) Finset.univ).card = (Finset.filter (fun g => f g = y) Finset.univ).card


theorem dvd_iff_mod_eq_zero {m n : Num} : m ∣ n ↔ n % m = 0


theorem stoppedProcess_eq (n : ℕ) : stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) +
    ∑ i ∈ Finset.range n, Set.indicator {ω | τ ω = i} (u i)

{Ω : Type u_1}
{β : Type u_2}
{u : ℕ → Ω → β}
{τ : Ω → ℕ}
[AddCommMonoid β]
(n : ℕ)

MeasureTheory.stoppedProcess u τ n = {a | n ≤ τ a}.indicator (u n) + ∑ i ∈ Finset.range n, {ω | τ ω = i}.indicator (u i)


@[simp]
theorem coprime_pow_left_iff {n : ℕ} (hn : 0 < n) (a b : ℕ) :
    Nat.Coprime (a ^ n) b ↔ Nat.Coprime a b


theorem image_Ico (e : α ↪o β) (he : OrdConnected (range e)) (x y : α) :
    e '' Ico x y = Ico (e x) (e y)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(e : α ↪o β)
(he : (Set.range ⇑e).OrdConnected)
(x y : α)


@[to_additive]
lemma prod_le_prod_map (f : α → α) (h : ∀ x, x ∈ s → x ≤ f x) : s.prod ≤ (s.map f).prod

{α : Type u_2}
[OrderedCommMonoid α]
{s : Multiset α}
(f : α → α)
(h : ∀ x ∈ s, x ≤ f x)


@[to_additive]
theorem toMap_injective_iff
    {M N : Type*} [CommMonoid M] {S : Submonoid M} [CommMonoid N] (f : LocalizationMap S N) :
    Injective (LocalizationMap.toMap f) ↔ ∀ ⦃x⦄, x ∈ S → IsLeftRegular x

{M : Type u_1}
{N : Type u_2}
[AddCommMonoid M]
{S : AddSubmonoid M}
[AddCommMonoid N]
(f : S.LocalizationMap N)

Function.Injective ⇑f.toMap ↔ ∀ ⦃x : M⦄, x ∈ S → IsAddLeftRegular x


theorem extend_pureCauchy {f : α → β} (hf : UniformContinuous f) (a : α) :
    extend f (pureCauchy a) = f a

{α : Type u}
[UniformSpace α]
{β : Type v}
[UniformSpace β]
[T0Space β]
{f : α → β}
(hf : UniformContinuous f)
(a : α)

CauchyFilter.extend f (CauchyFilter.pureCauchy a) = f a


lemma inf'_apply {ι : Type*} {s : Finset ι} (H : s.Nonempty) (f : ι → C(α, β)) (a : α) :
    s.inf' H f a = s.inf' H fun i ↦ f i a

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[SemilatticeInf β]
[ContinuousInf β]
{ι : Type u_4}
{s : Finset ι}
(H : s.Nonempty)
(f : ι → C(α, β))
(a : α)

(s.inf' H f) a = s.inf' H fun i => (f i) a


lemma inter_sdiff_assoc (s t u : Finset α) : (s ∩ t) \ u = s ∩ (t \ u)

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


@[to_additive (attr := simp)]
theorem OrderIso.mulLeft_symm (a : α) : (OrderIso.mulLeft a).symm = OrderIso.mulLeft a⁻¹

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

(OrderIso.addLeft a).symm = OrderIso.addLeft (-a)


theorem AECover.inter_restrict {φ : ι → Set α} (hφ : AECover μ l φ) {s : Set α}
    (hs : MeasurableSet s) : AECover (μ.restrict s) l fun i => φ i ∩ s

{α : Type u_1}
{ι : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
{φ : ι → Set α}
(hφ : MeasureTheory.AECover μ l φ)
{s : Set α}
(hs : MeasurableSet s)

MeasureTheory.AECover (μ.restrict s) l fun i => φ i ∩ s


lemma Icc_insert_succ_right (h : a ≤ b + 1) : insert (b + 1) (Icc a b) = Icc a (b + 1)

insert (b + 1) (Finset.Icc a b) = Finset.Icc a (b + 1)


theorem map_add_eq_of_lt_left (h : v y < v x) : v (x + y) = v x

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedCommGroupWithZero Γ₀]
(v : Valuation R Γ₀)
{x y : R}
(h : v y < v x)


/-- If `x^n = m` is an integer and `n` does not divide the `multiplicity p m`, then `x`
is irrational. -/
theorem irrational_nrt_of_n_not_dvd_multiplicity {x : ℝ} (n : ℕ) {m : ℤ} (hm : m ≠ 0) (p : ℕ)
    [hp : Fact p.Prime] (hxr : x ^ n = m)
    (hv : (multiplicity (p : ℤ) m).get (finite_int_iff.2 ⟨hp.1.ne_one, hm⟩) % n ≠ 0) :
    Irrational x

(hv : (multiplicity (↑p) m).get ⋯ % n ≠ 0)


lemma uIcc_of_lt (h : a < b) : [[a, b]] = Icc a b

{α : Type u_1}
[Lattice α]
{a b : α}
(h : a < b)


lemma nnnorm_map (φ : F) (a : A) : ‖φ a‖₊ = ‖a‖₊

{F : Type u_1}
{A : Type u_2}
{B : Type u_3}
[NormedRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
[StarRing A]
[CstarRing A]
[NormedRing B]
[NormedAlgebra ℂ B]
[CompleteSpace B]
[StarRing B]
[CstarRing B]
[EquivLike F A B]
[NonUnitalAlgEquivClass F ℂ A B]
[StarAlgEquivClass F ℂ A B]
(φ : F)
(a : A)

‖φ a‖₊ = ‖a‖₊


@[simp]
theorem eval_id (n) : eval Code.id n = Part.some n

Nat.Partrec.Code.id.eval n = Part.some n


/-- **Equality case of the Rearrangement Inequality**: Pointwise scalar multiplication of `f` and
`g`, which monovary together, is unchanged by a permutation if and only if `f ∘ σ` and `g` monovary
together. Stated by permuting the entries of `g`. -/
theorem Monovary.sum_comp_perm_smul_eq_sum_smul_iff (hfg : Monovary f g) :
    ∑ i, f (σ i) • g i = ∑ i, f i • g i ↔ Monovary (f ∘ σ) g

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{σ : Equiv.Perm ι}
{f : ι → α}
{g : ι → β}
[Fintype ι]
(hfg : Monovary f g)

∑ i : ι, f (σ i) • g i = ∑ i : ι, f i • g i ↔ Monovary (f ∘ ⇑σ) g


theorem HasDerivAt.continuousAt (h : HasDerivAt f f' x) : ContinuousAt f x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
(h : HasDerivAt f f' x)


theorem one_le_iff_ne_zero {c : Cardinal} : 1 ≤ c ↔ c ≠ 0


protected theorem map_neg_one {F : Type*} [Ring β] [FunLike F α β] [RingHomClass F α β]
    (f : F) : map (f : α →* β) (-1) = -1

{α : Type u}
{β : Type v}
[Ring α]
{F : Type u_1}
[Ring β]
[FunLike F α β]
[RingHomClass F α β]
(f : F)


theorem comap_gauge_nhds_zero_le (ha : Absorbent ℝ s) (hb : Bornology.IsVonNBounded ℝ s) :
    comap (gauge s) (𝓝 0) ≤ 𝓝 0

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
[TopologicalSpace E]
(ha : Absorbent ℝ s)
(hb : Bornology.IsVonNBounded ℝ s)


/-- Hölder's inequality for functions `α → ℝ≥0∞`. The integral of the product of two functions
is bounded by the product of their `ℒp` and `ℒq` seminorms when `p` and `q` are conjugate
exponents. -/
theorem lintegral_mul_le_Lp_mul_Lq (μ : Measure α) {p q : ℝ} (hpq : p.IsConjExponent q)
    {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
    (∫⁻ a, (f * g) a ∂μ) ≤ (∫⁻ a, f a ^ p ∂μ) ^ (1 / p) * (∫⁻ a, g a ^ q ∂μ) ^ (1 / q)

{α : Type u_1}
[MeasurableSpace α]
(μ : MeasureTheory.Measure α)
{p q : ℝ}
(hpq : p.IsConjExponent q)
{f g : α → ENNReal}
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)


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

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


lemma tendsto_density_atTop_ae_of_antitone (hκν : fst κ ≤ ν) [IsFiniteKernel ν] (a : α)
    (seq : ℕ → Set β) (hseq : Antitone seq) (hseq_iInter : ⋂ i, seq i = ∅)
    (hseq_meas : ∀ m, MeasurableSet (seq m)) :
    ∀ᵐ x ∂(ν a), Tendsto (fun m ↦ density κ ν a x (seq m)) atTop (𝓝 0)

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

(hseq_meas : ∀ (m : ℕ), MeasurableSet (seq m))

∀ᵐ (x : γ) ∂ν a, Filter.Tendsto (fun m => κ.density ν a x (seq m)) Filter.atTop (𝓝 0)


/-- This is a version of **Hall's Marriage Theorem** in terms of a relation
between types `α` and `β` such that `α` is finite and the image of
each `x : α` is finite (it suffices for `β` to be finite; see
`Fintype.all_card_le_filter_rel_iff_exists_injective`).  There is
a transversal of the relation (an injective function `α → β` whose graph is
a subrelation of the relation) iff every subset of
`k` terms of `α` is related to at least `k` terms of `β`.

Note: if `[Fintype β]`, then there exist instances for `[∀ (a : α), Fintype (Rel.image r {a})]`.
-/
theorem Fintype.all_card_le_rel_image_card_iff_exists_injective {α : Type u} {β : Type v}
    [DecidableEq β] (r : α → β → Prop) [∀ a : α, Fintype (Rel.image r {a})] :
    (∀ A : Finset α, A.card ≤ Fintype.card (Rel.image r A)) ↔
      ∃ f : α → β, Function.Injective f ∧ ∀ x, r x (f x)

{α : Type u}
{β : Type v}
[DecidableEq β]
(r : α → β → Prop)
[(a : α) → Fintype ↑(Rel.image r {a})]

(∀ (A : Finset α), A.card ≤ Fintype.card ↑(Rel.image r ↑A)) ↔ ∃ f, Function.Injective f ∧ ∀ (x : α), r x (f x)


theorem order_ofForallLtEqZero [Zero Γ] (f : Γ → R) (hf : f ≠ 0) (n : Γ)
    (hn : ∀(m : Γ), m < n → f m = 0) :
    n ≤ order (ofSuppBddBelow f (forallLTEqZero_supp_BddBelow f n hn))

{Γ : Type u_1}
{R : Type u_2}
[Zero R]
[LinearOrder Γ]
[LocallyFiniteOrder Γ]
[Zero Γ]
(f : Γ → R)
(hf : f ≠ 0)
(n : Γ)
(hn : ∀ m < n, f m = 0)

n ≤ (HahnSeries.ofSuppBddBelow f ⋯).order


/-- The natural isomorphism `(K⟦n⟧).sc' i j k ≅ K.sc' i' j' k'` when `n + i = i'`,
`n + j = j'` and `n + k = k'`. -/
@[simps!]
def shiftShortComplexFunctor' (n i j k i' j' k' : ℤ)
    (hi : n + i = i') (hj : n + j = j') (hk : n + k = k') :
    (CategoryTheory.shiftFunctor (CochainComplex C ℤ) n) ⋙ shortComplexFunctor' C _ i j k ≅
      shortComplexFunctor' C _ i' j' k'

(C : Type u_1)
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(n i j k i' j' k' : ℤ)
(hi : n + i = i')
(hj : n + j = j')
(hk : n + k = k')
(X : CochainComplex C ℤ)

((CochainComplex.shiftShortComplexFunctor' C n i j k i' j' k' hi hj hk).hom.app X).τ₁ =
  n.negOnePow • (HomologicalComplex.XIsoOfEq X ⋯).hom


theorem Injective.ne_iff' (hf : Injective f) {x y : α} {z : β} (h : f y = z) : f x ≠ z ↔ x ≠ y

{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
(hf : Function.Injective f)
{x y : α}
{z : β}
(h : f y = z)


theorem map_iSup₂ [SupSet α] [SupSet β] [sSupHomClass F α β] (f : F) (g : ∀ i, κ i → α) :
    f (⨆ (i) (j), g i j) = ⨆ (i) (j), f (g i j)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
{ι : Sort u_6}
{κ : ι → Sort u_7}
[FunLike F α β]
[SupSet α]
[SupSet β]
[sSupHomClass F α β]
(f : F)
(g : (i : ι) → κ i → α)

f (⨆ i, ⨆ j, g i j) = ⨆ i, ⨆ j, f (g i j)


theorem openEmbedding_inr : OpenEmbedding (@inr X Y)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]


@[to_additive (attr := simp)]
theorem coe_submonoidMap_apply (e : M ≃* N) (S : Submonoid M) (g : S) :
    ((submonoidMap e S g : S.map (e : M →* N)) : N) = e g

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
(e : M ≃* N)
(S : Submonoid M)
(g : ↥S)


theorem Mem.ext : ∀ {x y : PSet.{u}}, (∀ w : PSet.{u}, w ∈ x ↔ w ∈ y) → Equiv x y

(∀ (w : PSet), w ∈ x ↔ w ∈ y) → x.Equiv y


∀ {α : Type u_1} {a : α} {β : Type u_2} {b : β}, Sum.inl a ≠ Sum.inr b


@[simp]
theorem bot_covBy_iff : ⊥ ⋖ a ↔ IsAtom a

{α : Type u_2}
[PartialOrder α]
[OrderBot α]
{a : α}


@[to_additive]
theorem op_inf (S₁ S₂ : Submonoid M) : (S₁ ⊓ S₂).op = S₁.op ⊓ S₂.op

{M : Type u_2}
[AddZeroClass M]
(S₁ S₂ : AddSubmonoid M)


@[simp] theorem size_modify (a : Array α) (i : Nat) (f : α → α) : (a.modify i f).size = a.size

{α : Type u_1}
(a : Array α)
(i : Nat)
(f : α → α)


@[simp]
theorem image_emetric_closedBall (h : α ≃ᵢ β) (x : α) (r : ℝ≥0∞) :
    h '' EMetric.closedBall x r = EMetric.closedBall (h x) r

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(h : α ≃ᵢ β)
(x : α)
(r : ℝ≥0∞)

⇑h '' EMetric.closedBall x r = EMetric.closedBall (h x) r


@[simp, mfld_simps]
theorem coe_trans : (e.trans e' : X → Z) = e' ∘ e

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


@[simp]
theorem lift_tmul (f : A →ₐ[S] C) (g : B →ₐ[R] C) (hfg : ∀ x y, Commute (f x) (g y))
    (a : A) (b : B) :
    lift f g hfg (a ⊗ₜ b) = f a * g b

(hfg : ∀ (x : A) (y : B), Commute (f x) (g y))

(Algebra.TensorProduct.lift f g hfg) (a ⊗ₜ[R] b) = f a * g b


theorem SemilatInfCat_dual_comp_forget_to_partOrd :
    SemilatInfCat.dual ⋙ forget₂ SemilatSupCat PartOrd =
      forget₂ SemilatInfCat PartOrd ⋙ PartOrd.dual

SemilatInfCat.dual ⋙ CategoryTheory.forget₂ SemilatSupCat PartOrd =
  CategoryTheory.forget₂ SemilatInfCat PartOrd ⋙ PartOrd.dual


theorem integral_union_ae (hst : AEDisjoint μ s t) (ht : NullMeasurableSet t μ)
    (hfs : IntegrableOn f s μ) (hft : IntegrableOn f t μ) :
    ∫ x in s ∪ t, f x ∂μ = ∫ x in s, f x ∂μ + ∫ x in t, f x ∂μ

(ht : MeasureTheory.NullMeasurableSet t μ)

(hfs : MeasureTheory.IntegrableOn f s μ)

(hft : MeasureTheory.IntegrableOn f t μ)

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


/-- The additive version of `AddMonoidAlgebra.addMonoidAlgebraEquivDirectSum`.  -/
@[simps (config := .asFn)]
def addMonoidAlgebraAddEquivDirectSum [DecidableEq ι] [Semiring M] [∀ m : M, Decidable (m ≠ 0)] :
    AddMonoidAlgebra M ι ≃+ ⨁ _ : ι, M

{ι : Type u_1}
{M : Type u_3}
[DecidableEq ι]
[Semiring M]
[(m : M) → Decidable (m ≠ 0)]


/-- If `f` maps `s` to `t` and `s` is non-empty, `t` is non-empty. -/
theorem MapsTo.nonempty (h : MapsTo f s t) (hs : s.Nonempty) : t.Nonempty

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
(h : Set.MapsTo f s t)
(hs : s.Nonempty)


/-- If `f` and `g` are independent random variables with values in `ℝ≥0∞`,
   then `E[f * g] = E[f] * E[g]`. -/
theorem lintegral_mul_eq_lintegral_mul_lintegral_of_indepFun (h_meas_f : Measurable f)
    (h_meas_g : Measurable g) (h_indep_fun : IndepFun f g μ) :
    (∫⁻ ω, (f * g) ω ∂μ) = (∫⁻ ω, f ω ∂μ) * ∫⁻ ω, g ω ∂μ

(h_indep_fun : ProbabilityTheory.IndepFun f g μ)

∫⁻ (ω : Ω), (f * g) ω ∂μ = (∫⁻ (ω : Ω), f ω ∂μ) * ∫⁻ (ω : Ω), g ω ∂μ


@[simp]
theorem foldl_add (f : β → α → β) (H b s t) : foldl f H b (s + t) = foldl f H (foldl f H b s) t

{α : Type u_1}
{β : Type v}
(f : β → α → β)
(H : RightCommutative f)
(b : β)
(s t : Multiset α)

Multiset.foldl f H b (s + t) = Multiset.foldl f H (Multiset.foldl f H b s) t


@[to_additive]
protected theorem map_mul [FunLike F α β] [MulHomClass F α β] (m : F) :
    (f₁ * f₂).map m = f₁.map m * f₂.map m

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Mul α]
[Mul β]
{f₁ f₂ : Filter α}
[FunLike F α β]
[MulHomClass F α β]
(m : F)

Filter.map (⇑m) (f₁ * f₂) = Filter.map (⇑m) f₁ * Filter.map (⇑m) f₂


/-- Equivalence between `Fin (n + 1) → β` and `β × (Fin n → β)` which separates out the last
element of the tuple. -/
@[simps! (config := .asFn)]
def Equiv.piFinCastSucc (n : ℕ) (β : Type u) : (Fin (n + 1) → β) ≃ β × (Fin n → β)

⇑(Equiv.piFinCastSucc n β) = fun f => (f (Fin.last n), Fin.init f)


@[simp]
theorem id_f (S : Split C) (n : ℕ) : (𝟙 S : S ⟶ S).f n = 𝟙 (S.s.N n)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
(S : SimplicialObject.Split C)
(n : ℕ)


@[simp]
theorem pullbackIsoPullback_inv_fst :
    (pullbackIsoPullback f g).inv ≫ pullback.fst _ _ = fun p => (p.1 : X × Y).fst

{X Y Z : Type u}
(f : X ⟶ Z)
(g : Y ⟶ Z)

(CategoryTheory.Limits.Types.pullbackIsoPullback f g).inv ≫ CategoryTheory.Limits.pullback.fst f g = fun p => (↑p).1


@[to_additive (attr := simp)]
theorem subgroupOf_eq_bot {H K : Subgroup G} : H.subgroupOf K = ⊥ ↔ Disjoint H K

{G : Type u_1}
[Group G]
{H K : Subgroup G}


/-- The functor defined by the under categories.-/
@[simps] def mapFunctor : Tᵒᵖ  ⥤ Cat

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

∀ {X Y : Tᵒᵖ} (f : X ⟶ Y), (CategoryTheory.Under.mapFunctor T).map f = CategoryTheory.Under.map f.unop


theorem OptionT.goto_mkLabel {α β : Type _} (x : Label (Option.{u} α) m β) (i : α) :
    goto (OptionT.mkLabel x) i = OptionT.mk (goto x (some i) >>= fun a => pure (some a))

{m : Type u → Type v}
[Monad m]
{α β : Type u}
(x : ContT.Label (Option α) m β)
(i : α)

ContT.goto (OptionT.mkLabel x) i =
  OptionT.mk do
    let a ← ContT.goto x (some i)
    pure (some a)


@[simp 1100]
theorem ρ_one {G : MonCat.{u}} (A : Action V G) : A.ρ 1 = 𝟙 A.V

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{G : MonCat}
(A : Action V G)


theorem Perm.count_eq [DecidableEq α] {l₁ l₂ : List α} (p : l₁ ~ l₂) (a) :
    count a l₁ = count a l₂

{α : Type u_1}
[DecidableEq α]
{l₁ l₂ : List α}
(p : l₁ ~ l₂)
(a : α)


theorem binomial_apply_self (p : ℝ≥0∞) (h : p ≤ 1) (n : ℕ) :
    binomial p h n n = p^n


theorem GradesBy.decompose_single (m : M) (r : R) :
    DirectSum.decompose (gradeBy R f) (Finsupp.single m r : R[M]) =
      DirectSum.of (fun i : ι => gradeBy R f i) (f m)
        ⟨Finsupp.single m r, single_mem_gradeBy _ _ _⟩

{M : Type u_1}
{ι : Type u_2}
{R : Type u_3}
[AddMonoid M]
[DecidableEq ι]
[AddMonoid ι]
[CommSemiring R]
(f : M →+ ι)
(m : M)
(r : R)

(DirectSum.decompose (AddMonoidAlgebra.gradeBy R ⇑f)) (Finsupp.single m r) =
  (DirectSum.of (fun i => ↥(AddMonoidAlgebra.gradeBy R (⇑f) i)) (f m)) ⟨Finsupp.single m r, ⋯⟩


/-- If `E` is an `F`-algebra, and there exists a bijective `F`-linear map from `F` to `E`,
then the algebra map from `F` to `E` is also bijective.

NOTE: The same result can also be obtained if there are two `F`-linear maps from `F` to `E`,
one is injective, the other one is surjective. In this case, use
`injective_algebraMap_of_linearMap` and `surjective_algebraMap_of_linearMap` separately. -/
theorem bijective_algebraMap_of_linearMap (hb : Function.Bijective b) :
    Function.Bijective (algebraMap F E)

{F : Type u_1}
{E : Type u_2}
[CommSemiring F]
[Semiring E]
[Algebra F E]
(b : F →ₗ[F] E)
(hb : Function.Bijective ⇑b)


theorem LipschitzOnWith.comp_locallyBoundedVariationOn {f : E → F} {C : ℝ≥0} {t : Set E}
    (hf : LipschitzOnWith C f t) {g : α → E} {s : Set α} (hg : MapsTo g s t)
    (h : LocallyBoundedVariationOn g s) : LocallyBoundedVariationOn (f ∘ g) s

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
{F : Type u_3}
[PseudoEMetricSpace F]
{f : E → F}
{C : ℝ≥0}
{t : Set E}
(hf : LipschitzOnWith C f t)
{g : α → E}
{s : Set α}
(hg : Set.MapsTo g s t)
(h : LocallyBoundedVariationOn g s)


theorem Filter.EventuallyEq.hasDerivAtFilter_iff (h₀ : f₀ =ᶠ[L] f₁) (hx : f₀ x = f₁ x)
    (h₁ : f₀' = f₁') : HasDerivAtFilter f₀ f₀' x L ↔ HasDerivAtFilter f₁ f₁' x L

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f₀ f₁ : 𝕜 → F}
{f₀' f₁' : F}
{x : 𝕜}
{L : Filter 𝕜}
(h₀ : f₀ =ᶠ[L] f₁)
(hx : f₀ x = f₁ x)
(h₁ : f₀' = f₁')


theorem coe_closure_eq_range_term_realize :
    (closure L s : Set M) = range (@Term.realize L _ _ _ ((↑) : s → M))

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{s : Set M}

↑((FirstOrder.Language.Substructure.closure L).toFun s) = Set.range (FirstOrder.Language.Term.realize Subtype.val)


@[simp]
theorem coe_neg : (neg R : E → E) = fun x => -x

{R : Type u_1}
{E : Type u_5}
[Semiring R]
[SeminormedAddCommGroup E]
[Module R E]

⇑(LinearIsometryEquiv.neg R) = fun x => -x


@[to_additive (attr := measurability)]
theorem Measurable.smul_const (hf : Measurable f) (y : β) : Measurable fun x => f x • y

{M : Type u_2}
{β : Type u_3}
{α : Type u_4}
[MeasurableSpace M]
[MeasurableSpace β]
[SMul M β]
{m : MeasurableSpace α}
{f : α → M}
[MeasurableSMul M β]
(hf : Measurable f)
(y : β)


theorem MapsTo.subset_preimage {f : α → β} {s : Set α} {t : Set β} (hf : MapsTo f s t) :
    s ⊆ f ⁻¹' t

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


theorem isClosed_connectedComponent {x : α} : IsClosed (connectedComponent x)

{α : Type u}
[TopologicalSpace α]
{x : α}


@[simp]
lemma variableChange_b₈ : (W.variableChange C).b₈ = C.u⁻¹ ^ 8 *
    (W.b₈ + 3 * C.r * W.b₆ + 3 * C.r ^ 2 * W.b₄ + C.r ^ 3 * W.b₂ + 3 * C.r ^ 4)

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

(W.variableChange C).b₈ = ↑C.u⁻¹ ^ 8 * (W.b₈ + 3 * C.r * W.b₆ + 3 * C.r ^ 2 * W.b₄ + C.r ^ 3 * W.b₂ + 3 * C.r ^ 4)


@[to_additive]
theorem torsionMulEquiv_symm_apply_coe (tG : IsTorsion G) (a : G) :
    tG.torsionMulEquiv.symm a = ⟨Submonoid.topEquiv.symm a, tG _⟩

{G : Type u_1}
[CommMonoid G]
(tG : Monoid.IsTorsion G)
(a : G)

tG.torsionMulEquiv.symm a = ⟨↑(Submonoid.topEquiv.symm a), ⋯⟩


@[simp]
theorem _root_.aestronglyMeasurable_sum_measure_iff [PseudoMetrizableSpace β]
    {_m : MeasurableSpace α} {μ : ι → Measure α} :
    AEStronglyMeasurable f (sum μ) ↔ ∀ i, AEStronglyMeasurable f (μ i)

MeasureTheory.AEStronglyMeasurable f (MeasureTheory.Measure.sum μ) ↔
  ∀ (i : ι), MeasureTheory.AEStronglyMeasurable f (μ i)


theorem Directed.mono {s : α → α → Prop} {ι} {f : ι → α} (H : ∀ a b, r a b → s a b)
    (h : Directed r f) : Directed s f

{α : Type u}
{r s : α → α → Prop}
{ι : Sort u_1}
{f : ι → α}
(H : ∀ (a b : α), r a b → s a b)
(h : Directed r f)


@[to_additive]
theorem MonoidHom.map_finprod_Prop {p : Prop} (f : M →* N) (g : p → M) :
    f (∏ᶠ x, g x) = ∏ᶠ x, f (g x)

{M : Type u_2}
{N : Type u_3}
[CommMonoid M]
[CommMonoid N]
{p : Prop}
(f : M →* N)
(g : p → M)

f (∏ᶠ (x : p), g x) = ∏ᶠ (x : p), f (g x)


@[reassoc (attr := simp)]
theorem pentagon_hom_hom_inv_hom_hom :
    (α_ (W ⊗ X) Y Z).hom ≫ (α_ W X (Y ⊗ Z)).hom ≫ W ◁ (α_ X Y Z).inv =
      (α_ W X Y).hom ▷ Z ≫ (α_ W (X ⊗ Y) Z).hom

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

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


theorem of_mul_nat (m : ℕ) (h : Irrational (x * m)) : Irrational x

{x : ℝ}
(m : ℕ)
(h : Irrational (x * ↑m))


/-- If `f` is a partition of unity that is subordinate to a family of open sets `U i` and
`g : ι → X → E` is a family of functions such that each `g i` is continuous on `U i`, then the sum
`fun x ↦ ∑ᶠ i, f i x • g i x` is a continuous function. -/
theorem IsSubordinate.continuous_finsum_smul [ContinuousAdd E] {U : ι → Set X}
    (ho : ∀ i, IsOpen (U i)) (hf : f.IsSubordinate U) {g : ι → X → E}
    (hg : ∀ i, ContinuousOn (g i) (U i)) : Continuous fun x => ∑ᶠ i, f i x • g i x

(hg : ∀ (i : ι), ContinuousOn (g i) (U i))

Continuous fun x => ∑ᶠ (i : ι), (f i) x • g i x


theorem wSameSide_of_left_mem {s : AffineSubspace R P} {x : P} (y : P) (hx : x ∈ s) :
    s.WSameSide x y

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


theorem logb_nonneg (hx : 1 ≤ x) : 0 ≤ logb b x


theorem Convex.combo_interior_self_mem_interior {s : Set E} (hs : Convex 𝕜 s) {x y : E}
    (hx : x ∈ interior s) (hy : y ∈ s) {a b : 𝕜} (ha : 0 < a) (hb : 0 ≤ b) (hab : a + b = 1) :
    a • x + b • y ∈ interior s

{𝕜 : Type u_2}
{E : Type u_3}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
{s : Set E}
(hs : Convex 𝕜 s)
{x y : E}
(hx : x ∈ interior s)
(hy : y ∈ s)
{a b : 𝕜}
(ha : 0 < a)
(hb : 0 ≤ b)
(hab : a + b = 1)


@[simp]
lemma map_obj (j : J) (X : C (g j)) : (Sigma.map C g).obj ⟨j, X⟩ = ⟨g j, X⟩

[(i : I) → CategoryTheory.Category.{v₁, u₁} (C i)]

(CategoryTheory.Sigma.map C g).obj ⟨j, X⟩ = ⟨g j, X⟩


@[simp, norm_cast]
theorem cast_nnratCast {K} [DivisionRing K] (q : ℚ≥0) :
    ((q : ℚ) : K) = (q : K)

{K : Type u_2}
[DivisionRing K]
(q : ℚ≥0)


theorem mul_mem_mul {M N : AddSubmonoid R} {m n : R} (hm : m ∈ M) (hn : n ∈ N) : m * n ∈ M * N

{R : Type u_4}
[NonUnitalNonAssocSemiring R]
{M N : AddSubmonoid R}
{m n : R}
(hm : m ∈ M)
(hn : n ∈ N)


@[to_additive]
theorem of_image_filter [DecidableEq H]
    (f : G →ₙ* H) {A B : Finset G} {aG bG : G} {aH bH : H} (hae : f aG = aH) (hbe : f bG = bH)
    (huH : UniqueMul (A.image f) (B.image f) aH bH)
    (huG : UniqueMul (A.filter (f · = aH)) (B.filter (f · = bH)) aG bG) :
    UniqueMul A B aG bG

(huH : UniqueAdd (Finset.image (⇑f) A) (Finset.image (⇑f) B) aH bH)

(huG : UniqueAdd (Finset.filter (fun x => f x = aH) A) (Finset.filter (fun x => f x = bH) B) aG bG)


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

[(i : ι) → (x : γ i) → Decidable (x ≠ 0)]


lemma monotone_inclusion_lt_lt_of_le [Preorder α] {k j : α} (hkj : k ≤ j) :
    Monotone (fun ⟨i, hi⟩ => ⟨i, lt_of_lt_of_le hi hkj⟩ : { i // i < k } → { i // i < j})

{α : Type u}
[Preorder α]
{k j : α}
(hkj : k ≤ j)

Monotone fun x =>
  match x with
  | ⟨i, hi⟩ => ⟨i, ⋯⟩


theorem generateFrom_iInter (f : ι → TopologicalSpace α) :
    generateFrom (⋂ i, { s | IsOpen[f i] s }) = ⨆ i, f i

{α : Type u}
{ι : Sort v}
(f : ι → TopologicalSpace α)

TopologicalSpace.generateFrom (⋂ i, {s | IsOpen s}) = ⨆ i, f i


@[simp]
lemma ofReal_le_natCast {r : ℝ} {n : ℕ} : ENNReal.ofReal r ≤ n ↔ r ≤ n


theorem Nonempty.sigma_fst : (s.sigma t).Nonempty → s.Nonempty

{ι : Type u_1}
{α : ι → Type u_3}
{s : Set ι}
{t : (i : ι) → Set (α i)}


@[simp, norm_cast]
theorem intCast_imI (z : ℤ) : (z : ℍ[R,c₁,c₂]).imI = 0

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(z : ℤ)


@[simp]
theorem cons_one {α : Fin (n + 2) → Type*} (x : α 0) (p : ∀ i : Fin n.succ, α i.succ) :
    cons x p 1 = p 0

{n : ℕ}
{α : Fin (n + 2) → Type u_1}
(x : α 0)
(p : (i : Fin n.succ) → α i.succ)


theorem isUnit_of_sub_one_mem_jacobson_bot (r : R) (h : r - 1 ∈ jacobson (⊥ : Ideal R)) :
    IsUnit r

{R : Type u}
[CommRing R]
(r : R)
(h : r - 1 ∈ ⊥.jacobson)


protected theorem Subsingleton.elim {α : Sort u} [h : Subsingleton α] : (a b : α) → a = b

{α : Sort u}
[h : Subsingleton α]
(a b : α)


/-- `cyclotomic' n R` is different from `0`. -/
theorem cyclotomic'_ne_zero (n : ℕ) (R : Type*) [CommRing R] [IsDomain R] : cyclotomic' n R ≠ 0

(n : ℕ)
(R : Type u_2)
[CommRing R]
[IsDomain R]


@[simp]
lemma finsuppScalarRight_apply_tmul_apply (m : M) (p : ι →₀ R) (i : ι) :
    finsuppScalarRight R M ι (m ⊗ₜ[R] p) i = p i • m

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{ι : Type u_4}
[DecidableEq ι]
(m : M)
(p : ι →₀ R)
(i : ι)

((TensorProduct.finsuppScalarRight R M ι) (m ⊗ₜ[R] p)) i = p i • m


theorem inv_def (x : α) (y : β) : r.inv y x ↔ r x y

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


theorem has_limits_of_finite_and_cofiltered [HasFiniteLimits C]
    [HasCofilteredLimitsOfSize.{w, w} C] : HasLimitsOfSize.{w, w} C

[CategoryTheory.Limits.HasCofilteredLimitsOfSize.{w, w, v, u} C]

CategoryTheory.Limits.HasLimitsOfSize.{w, w, v, u} C


@[to_additive]
theorem mk_mul (a c : M) (b d : S) : mk a b * mk c d = mk (a * c) (b * d)

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
(a c : M)
(b d : ↥S)

Localization.mk a b * Localization.mk c d = Localization.mk (a * c) (b * d)


/-- If `I` and `I'` are initial, they are isomorphic. -/
@[simps]
def IsInitial.uniqueUpToIso {I I' : C} (hI : IsInitial I) (hI' : IsInitial I') : I ≅ I'

(hI : CategoryTheory.Limits.IsInitial I)

(hI' : CategoryTheory.Limits.IsInitial I')


@[to_additive]
theorem CauchySeq.mul {ι : Type*} [Preorder ι] {u v : ι → α} (hu : CauchySeq u)
    (hv : CauchySeq v) : CauchySeq (u * v)

{α : Type u_1}
[UniformSpace α]
[Group α]
[UniformGroup α]
{ι : Type u_3}
[Preorder ι]
{u v : ι → α}
(hu : CauchySeq u)
(hv : CauchySeq v)


/-- If a function is at least `C^1`, its bundled derivative (mapping `(x, v)` to `Df(x) v`) is
continuous. -/
theorem ContDiffOn.continuousOn_fderivWithin_apply (hf : ContDiffOn 𝕜 n f s) (hs : UniqueDiffOn 𝕜 s)
    (hn : 1 ≤ n) :
    ContinuousOn (fun p : E × E => (fderivWithin 𝕜 f s p.1 : E → F) p.2) (s ×ˢ univ)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{n : ℕ∞}
(hf : ContDiffOn 𝕜 n f s)
(hs : UniqueDiffOn 𝕜 s)
(hn : 1 ≤ n)

ContinuousOn (fun p => (fderivWithin 𝕜 f s p.1) p.2) (s ×ˢ Set.univ)


theorem forall₂_cons_left_iff {a l u} :
    Forall₂ R (a :: l) u ↔ ∃ b u', R a b ∧ Forall₂ R l u' ∧ u = b :: u'

{α : Type u_1}
{β : Type u_2}
{R : α → β → Prop}
{a : α}
{l : List α}
{u : List β}

List.Forall₂ R (a :: l) u ↔ ∃ b u', R a b ∧ List.Forall₂ R l u' ∧ u = b :: u'


theorem and_le_left : ∀ x y : Bool, (x && y) ≤ x


theorem choose_succ_succ' (n k : ℕ) : choose (n + 1) (k + 1) = choose n k + choose n (k + 1)

(n + 1).choose (k + 1) = n.choose k + n.choose (k + 1)


theorem image_update_Ioc_right (f : ∀ i, α i) (i : ι) (b : α i) :
    update f i '' Ioc (f i) b = Ioc f (update f i b)

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

Function.update f i '' Set.Ioc (f i) b = Set.Ioc f (Function.update f i b)


theorem mk {s t : Set α} (hs : μ s = 0) (ht : ν t = 0) (hst : univ ⊆ s ∪ t) :
    MutuallySingular μ ν

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
{s t : Set α}
(hs : μ s = 0)
(ht : ν t = 0)
(hst : Set.univ ⊆ s ∪ t)


@[simp]
theorem lift_mul (a b : Cardinal.{u}) : lift.{v} (a * b) = lift.{v} a * lift.{v} b

Cardinal.lift.{v, u} (a * b) = Cardinal.lift.{v, u} a * Cardinal.lift.{v, u} b


theorem isOpen_def {T : Set (WithLawson α)} :
    IsOpen T ↔ (lawson α).IsOpen (toLawson ⁻¹' T)

{α : Type u_1}
[Preorder α]
{T : Set (Topology.WithLawson α)}

IsOpen T ↔ TopologicalSpace.IsOpen (⇑Topology.WithLawson.toLawson ⁻¹' T)


lemma div {f g : 𝕜 → 𝕜} {x : 𝕜} (hf : MeromorphicAt f x) (hg : MeromorphicAt g x) :
    MeromorphicAt (f / g) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{f g : 𝕜 → 𝕜}
{x : 𝕜}
(hf : MeromorphicAt f x)
(hg : MeromorphicAt g x)


/-- A version of `Cocones.ext` for `Cofan`s. -/
@[simps!]
def Cofan.ext {f : β → C} {c₁ c₂ : Cofan f} (e : c₁.pt ≅ c₂.pt)
    (w : ∀ (b : β), c₁.inj b ≫ e.hom = c₂.inj b := by aesop_cat) : c₁ ≅ c₂

(CategoryTheory.Limits.Cofan.ext e w).hom.hom = e.hom


nonrec theorem sSup_of_not_bddAbove {s : Set ℝ≥0} (hs : ¬BddAbove s) : SupSet.sSup s = 0


@[simp]
theorem head_pure (a : α) : head (pure a) = some a


/-- The `weightedTotalDegree'` of the zero polynomial is `⊥`. -/
theorem weightedTotalDegree'_zero (w : σ → M) :
    weightedTotalDegree' w (0 : MvPolynomial σ R) = ⊥

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
{σ : Type u_3}
[AddCommMonoid M]
[SemilatticeSup M]
(w : σ → M)

MvPolynomial.weightedTotalDegree' w 0 = ⊥


@[simp]
theorem RightExactFunctor.ofExact_obj (F : C ⥤ₑ D) :
    (RightExactFunctor.ofExact C D).obj F = ⟨F.1, F.2.2⟩

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : C ⥤ₑ D)

(CategoryTheory.RightExactFunctor.ofExact C D).obj F = { obj := F.obj, property := ⋯ }


/-- `BoundedLatticeHomClass F α β` states that `F` is a type of bounded lattice morphisms.

You should extend this class when you extend `BoundedLatticeHom`. -/
class BoundedLatticeHomClass (F α β : Type*) [Lattice α] [Lattice β] [BoundedOrder α]
  [BoundedOrder β] [FunLike F α β] extends LatticeHomClass F α β : Prop where
  /-- A `BoundedLatticeHomClass` morphism preserves the top element. -/
  map_top (f : F) : f ⊤ = ⊤
  /-- A `BoundedLatticeHomClass` morphism preserves the bottom element. -/
  map_bot (f : F) : f ⊥ = ⊥

{F : Type u_7}
{α : Type u_8}
{β : Type u_9}
[Lattice α]
[Lattice β]
[BoundedOrder α]
[BoundedOrder β]
[FunLike F α β]
[self : BoundedLatticeHomClass F α β]
(f : F)


theorem not_isUnit (hp : p.IsUnitTrinomial) : ¬IsUnit p

{p : Polynomial ℤ}
(hp : p.IsUnitTrinomial)


theorem comp_hasFDerivAt_iff {f : G → E} {x : G} {f' : G →L[𝕜] E} :
    HasFDerivAt (iso ∘ f) ((iso : E →L[𝕜] F).comp f') x ↔ HasFDerivAt f f' x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
(iso : E ≃ₗᵢ[𝕜] F)
{f : G → E}
{x : G}
{f' : G →L[𝕜] E}

HasFDerivAt (⇑iso ∘ f)
    ((↑{ toLinearEquiv := iso.toLinearEquiv, continuous_toFun := ⋯, continuous_invFun := ⋯ }).comp f') x ↔
  HasFDerivAt f f' x


/-- A continuous image of a Lindelöf set is a Lindelöf set within the codomain. -/
theorem IsLindelof.image {f : X → Y} (hs : IsLindelof s) (hf : Continuous f) :
    IsLindelof (f '' s)

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


theorem isAtom_iff' [OrderBot α] [IsAtomic α] [OrderBot β] {l : α → β} {u : β → α}
    (gi : GaloisInsertion l u) (hbot : u ⊥ = ⊥) (h_atom : ∀ a, IsAtom a → u (l a) = a) (b : β) :
    IsAtom (u b) ↔ IsAtom b

(h_atom : ∀ (a : α), IsAtom a → u (l a) = a)


/-- The canonical extension of a functor `C ⥤ Karoubi D` to a functor
`Karoubi C ⥤ Karoubi D` -/
@[simps]
def obj (F : C ⥤ Karoubi D) : Karoubi C ⥤ Karoubi D

(F : CategoryTheory.Functor C (CategoryTheory.Idempotents.Karoubi D))

(P : CategoryTheory.Idempotents.Karoubi C)

((CategoryTheory.Idempotents.FunctorExtension₁.obj F).obj P).p = (F.map P.p).f


theorem _root_.Filter.Eventually.volume_pos_of_nhds_real {p : ℝ → Prop} {a : ℝ}
    (h : ∀ᶠ x in 𝓝 a, p x) : (0 : ℝ≥0∞) < volume { x | p x }

{p : ℝ → Prop}
{a : ℝ}
(h : ∀ᶠ (x : ℝ) in 𝓝 a, p x)


@[simp]
theorem factorThru_eq_zero [HasZeroMorphisms C] {X Y : C} {P : Subobject Y} {f : X ⟶ Y}
    {h : Factors P f} : P.factorThru f h = 0 ↔ f = 0


@[simp] theorem countable_singleton (a : α) : ({a} : Set α).Countable


theorem IsPreconnected.intermediate_value_Ioc {s : Set X} (hs : IsPreconnected s) {a : X}
    {l : Filter X} (ha : a ∈ s) [NeBot l] (hl : l ≤ 𝓟 s) {f : X → α} (hf : ContinuousOn f s) {v : α}
    (ht : Tendsto f l (𝓝 v)) : Ioc v (f a) ⊆ f '' s

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


@[continuity, fun_prop]
theorem continuous_cos : Continuous cos


theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{pf : FormalMultilinearSeries 𝕜 E F}
{x : E}
(hf : HasFPowerSeriesAt f pf x)


@[simp]
theorem adjoin_self (K : IntermediateField F E) :
    adjoin F K = K

(F : Type u_1)
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
(K : IntermediateField F E)


theorem apply_mem_iff (h : e.IsImage s t) (hx : x ∈ e.source) : e x ∈ t ↔ x ∈ s

{α : Type u_1}
{β : Type u_2}
{e : PartialEquiv α β}
{s : Set α}
{t : Set β}
{x : α}
(h : e.IsImage s t)
(hx : x ∈ e.source)


/-- Appending a one-tuple to the right is the same as `Fin.snoc`. -/
theorem append_right_eq_snoc {α : Type*} {n : ℕ} (x : Fin n → α) (x₀ : Fin 1 → α) :
    Fin.append x x₀ = Fin.snoc x (x₀ 0)

{α : Type u_1}
{n : ℕ}
(x : Fin n → α)
(x₀ : Fin 1 → α)


@[to_additive existing]
theorem div_mem_div (ha : a ∈ s) (hb : b ∈ t) : a / b ∈ s / t

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


@[simp]
theorem sInf_toSubalgebra (S : Set (StarSubalgebra R A)) :
    (sInf S).toSubalgebra = sInf (StarSubalgebra.toSubalgebra '' S)

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
(S : Set (StarSubalgebra R A))


/-- A category has strong epi-mono factorisations if every morphism admits a strong epi-mono
    factorisation. -/
class HasStrongEpiMonoFactorisations : Prop where mk' ::
  has_fac : ∀ {X Y : C} (f : X ⟶ Y), Nonempty (StrongEpiMonoFactorisation f)

[self : CategoryTheory.Limits.HasStrongEpiMonoFactorisations C]


theorem contMDiffAt_top : SmoothAt I I' f x ↔ ∀ n : ℕ, ContMDiffAt I I' n f x

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

SmoothAt I I' f x ↔ ∀ (n : ℕ), ContMDiffAt I I' (↑n) f x


@[fun_prop, aesop safe 100 apply (rule_sets := [Measurable])]
theorem measurable_pi_apply (a : δ) : Measurable fun f : ∀ a, π a => f a

{δ : Type u_4}
{π : δ → Type u_6}
[(a : δ) → MeasurableSpace (π a)]
(a : δ)


/-- This expresses the difference between the values of a multilinear map
at two points "close to `x`" in terms of the "derivative" of the multilinear map at `x`
and of "second-order" terms. -/
lemma map_add_sub_map_add_sub_linearDeriv [DecidableEq ι] [Fintype ι] (x h h' : (i : ι) → M₁ i) :
    f (x + h) - f (x + h') - f.linearDeriv x (h - h') =
    ∑ s ∈ univ.powerset.filter (2 ≤ ·.card), (f (s.piecewise h x) - f (s.piecewise h' x))

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[Semiring R]
[(i : ι) → AddCommGroup (M₁ i)]
[AddCommGroup M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
(f : MultilinearMap R M₁ M₂)
[DecidableEq ι]
[Fintype ι]
(x h h' : (i : ι) → M₁ i)

f (x + h) - f (x + h') - (f.linearDeriv x) (h - h') =
  ∑ s ∈ Finset.filter (fun x => 2 ≤ x.card) Finset.univ.powerset, (f (s.piecewise h x) - f (s.piecewise h' x))


theorem algebraMap₀_eq_smul_one (r : R) : (algebraMap₀ r : (⨂[R]^0) M) = r • ₜ1

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

TensorPower.algebraMap₀ r = r • GradedMonoid.GOne.one


@[to_additive]
theorem inv_some [Inv α] (a : α) : (some a)⁻¹ = some a⁻¹


/-- The identity is proper. -/
@[simp] lemma isProperMap_id : IsProperMap (id : X → X)


lemma homMk_eq_hom_mk {X Y : C} (f : W.LeftFraction X Y) : homMk f = Hom.mk f

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

CategoryTheory.MorphismProperty.LeftFraction.Localization.homMk f =
  CategoryTheory.MorphismProperty.LeftFraction.Localization.Hom.mk f


protected theorem comp (hg : IsClosedMap g) (hf : IsClosedMap f) : IsClosedMap (g ∘ f)

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


@[to_additive (attr := simp)]
lemma insertNth_mul [∀ j, Mul (α j)] (i : Fin (n + 1)) (x y : α i) (p q : ∀ j, α (i.succAbove j)) :
    i.insertNth (x * y) (p * q) = i.insertNth x p * i.insertNth y q

{n : ℕ}
{α : Fin (n + 1) → Type u_1}
[(j : Fin (n + 1)) → Mul (α j)]
(i : Fin (n + 1))
(x y : α i)
(p q : (j : Fin n) → α (i.succAbove j))


lemma cfcₙ_nonpos_iff (f : R → R) (a : A) (hf : ContinuousOn f (σₙ R a) := by cfc_cont_tac)
    (h0 : f 0 = 0 := by cfc_zero_tac) (ha : p a := by cfc_tac) :
    cfcₙ f a ≤ 0 ↔ ∀ x ∈ σₙ R a, f x ≤ 0

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


theorem smul_mk' (x y : R) (m : M) : x • mk' S y m = mk' S (x * y) m

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
(x y : R)
(m : ↥M)

x • IsLocalization.mk' S y m = IsLocalization.mk' S (x * y) m


theorem IsBoundedUnder.bddAbove_range_of_cofinite [Preorder β] [IsDirected β (· ≤ ·)] {f : α → β}
    (hf : IsBoundedUnder (· ≤ ·) cofinite f) : BddAbove (range f)

(hf : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) Filter.cofinite f)


theorem ne_neg_self {n : ℕ} (hn : Odd n) {a : ZMod n} (ha : a ≠ 0) : a ≠ -a


theorem grundyValue_eq_iff_equiv_nim {G : PGame} [G.Impartial] {o : Ordinal} :
    grundyValue G = o ↔ (G ≈ nim o)

{G : SetTheory.PGame}
[G.Impartial]
{o : Ordinal.{u_1}}

G.grundyValue = o ↔ G ≈ SetTheory.PGame.nim o


theorem tendsto_nhds_infty {α : Type*} {f : OnePoint X → α} {l : Filter α} :
    Tendsto f (𝓝 ∞) l ↔
      ∀ s ∈ l, f ∞ ∈ s ∧ ∃ t : Set X, IsClosed t ∧ IsCompact t ∧ MapsTo (f ∘ (↑)) tᶜ s

{X : Type u_1}
[TopologicalSpace X]
{α : Type u_2}
{f : OnePoint X → α}
{l : Filter α}

Filter.Tendsto f (𝓝 OnePoint.infty) l ↔
  ∀ s ∈ l, f OnePoint.infty ∈ s ∧ ∃ t, IsClosed t ∧ IsCompact t ∧ Set.MapsTo (f ∘ OnePoint.some) tᶜ s


lemma lt_coe_succ_iff_le {x : PartENat} {n : ℕ} (hx : x ≠ ⊤) : x < n.succ ↔ x ≤ n


@[simp]
theorem reverse_map : (p.map f).reverse = p.reverse.map f

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

(SimpleGraph.Walk.map f p).reverse = SimpleGraph.Walk.map f p.reverse


theorem lt_power_cof {c : Cardinal.{u}} : ℵ₀ ≤ c → c < (c^cof c.ord)


@[simp]
theorem algebraMap_comp_C : (algebraMap K[X] (RatFunc K)).comp Polynomial.C = C

(algebraMap (Polynomial K) (RatFunc K)).comp Polynomial.C = RatFunc.C


theorem Ico_union_Ico' (h₁ : c ≤ b) (h₂ : a ≤ d) : Ico a b ∪ Ico c d = Ico (min a c) (max b d)

{α : Type u_1}
[LinearOrder α]
{a b c d : α}
(h₁ : c ≤ b)
(h₂ : a ≤ d)

Set.Ico a b ∪ Set.Ico c d = Set.Ico (min a c) (max b d)


theorem disjoint_of_erase_left (ha : a ∉ t) (hst : Disjoint (s.erase a) t) : Disjoint s t

{α : Type u_1}
[DecidableEq α]
{s t : Finset α}
{a : α}
(ha : a ∉ t)
(hst : Disjoint (s.erase a) t)


@[simp]
theorem ofNat_mul_aleph0 {n : ℕ} [Nat.AtLeastTwo n] : no_index (OfNat.ofNat n) * ℵ₀ = ℵ₀

OfNat.ofNat n * Cardinal.aleph0 = Cardinal.aleph0


@[simp] lemma div_modEq_div (hc : c ≠ 0) : a / c ≡ b / c [PMOD p] ↔ a ≡ b [PMOD (p * c)]

{α : Type u_1}
[DivisionRing α]
{a b c p : α}
(hc : c ≠ 0)

a / c ≡ b / c [PMOD p] ↔ a ≡ b [PMOD p * c]


theorem take_cons (n) (a : α) (l : List α) : take (succ n) (a :: l) = a :: take n l

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

List.take n.succ (a :: l) = a :: List.take n l


protected theorem mul_inv_cancel {x : tsze R M} (hx : fst x ≠ 0) : x * x⁻¹ = 1

{R : Type u}
{M : Type v}
[DivisionSemiring R]
[AddCommGroup M]
[Module Rᵐᵒᵖ M]
[Module R M]
[SMulCommClass R Rᵐᵒᵖ M]
{x : tsze R M}
(hx : x.fst ≠ 0)


/-- A content is an additive function on compact sets taking values in `ℝ≥0`. It is a device
from which one can define a measure. -/
structure Content (G : Type w) [TopologicalSpace G] where
  toFun : Compacts G → ℝ≥0
  mono' : ∀ K₁ K₂ : Compacts G, (K₁ : Set G) ⊆ K₂ → toFun K₁ ≤ toFun K₂
  sup_disjoint' :
    ∀ K₁ K₂ : Compacts G, Disjoint (K₁ : Set G) K₂ → IsClosed (K₁ : Set G) → IsClosed (K₂ : Set G)
      → toFun (K₁ ⊔ K₂) = toFun K₁ + toFun K₂
  sup_le' : ∀ K₁ K₂ : Compacts G, toFun (K₁ ⊔ K₂) ≤ toFun K₁ + toFun K₂

{G : Type w}
[TopologicalSpace G]
(self : MeasureTheory.Content G)
(K₁ K₂ : TopologicalSpace.Compacts G)

self.toFun (K₁ ⊔ K₂) ≤ self.toFun K₁ + self.toFun K₂


@[to_additive]
theorem MeasurePreserving.mul_right (μ : Measure G) [IsMulRightInvariant μ] (g : G) {X : Type*}
    [MeasurableSpace X] {μ' : Measure X} {f : X → G} (hf : MeasurePreserving f μ' μ) :
    MeasurePreserving (fun x => f x * g) μ' μ

(hf : MeasureTheory.MeasurePreserving f μ' μ)

MeasureTheory.MeasurePreserving (fun x => f x * g) μ' μ


theorem unop {Z X Y P : Cᵒᵖ} {f : Z ⟶ X} {g : Z ⟶ Y} {inl : X ⟶ P} {inr : Y ⟶ P}
    (h : IsPushout f g inl inr) : IsPullback inr.unop inl.unop g.unop f.unop

(h : CategoryTheory.IsPushout f g inl inr)

CategoryTheory.IsPullback inr.unop inl.unop g.unop f.unop


@[simp]
theorem X_divMonomial (i : σ) : (X i : MvPolynomial σ R) /ᵐᵒⁿᵒᵐⁱᵃˡ Finsupp.single i 1 = 1

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
(i : σ)

(MvPolynomial.X i).divMonomial (Finsupp.single i 1) = 1


theorem lt.dest {a b : Int} (h : a < b) : ∃ n : Nat, a + Nat.succ n = b


@[simp]
theorem map_map (g : β ≃o γ) (f : α ≃o β) : map g (map f s) = map (f.trans g) s

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Preorder α]
[Preorder β]
[Preorder γ]
{s : LowerSet α}
(g : β ≃o γ)
(f : α ≃o β)

(LowerSet.map g) ((LowerSet.map f) s) = (LowerSet.map (f.trans g)) s


/-- If `p` is prime and `J(a | p) = 1`, then `a` is a square mod `p`. -/
theorem isSquare_of_jacobiSym_eq_one {a : ℤ} {p : ℕ} [Fact p.Prime] (h : J(a | p) = 1) :
    IsSquare (a : ZMod p)

{a : ℤ}
{p : ℕ}
[Fact (Nat.Prime p)]
(h : jacobiSym a p = 1)


theorem val_neg_of_ne_zero {n : ℕ} [nz : NeZero n] (a : ZMod n) [na : NeZero a] :
    (- a).val = n - a.val


theorem Basis.mk_eq_rank'' {ι : Type v} (v : Basis ι R M) : #ι = Module.rank R M

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


theorem toReal_injective : Function.Injective toReal


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

Batteries.LECmp fun x x_1 => compareOfLessAndEq x x_1


/-- `t ∈ ∂⁺^k 𝒜` iff `t` is exactly `k` elements less than something in `𝒜`.

See also `Finset.mem_upShadow_iterate_iff_exists_sdiff`. -/
lemma mem_upShadow_iterate_iff_exists_mem_card_add :
    t ∈ ∂⁺^[k] 𝒜 ↔ ∃ s ∈ 𝒜, s ⊆ t ∧ t.card = s.card + k

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{𝒜 : Finset (Finset α)}
{t : Finset α}
{k : ℕ}

t ∈ Finset.upShadow^[k] 𝒜 ↔ ∃ s ∈ 𝒜, s ⊆ t ∧ t.card = s.card + k


/-- Homotopy between morphisms of short complexes is compatible with the scalar multiplication. -/
@[simps]
def Homotopy.smul {φ₁ φ₂ : S₁ ⟶ S₂} (h : Homotopy φ₁ φ₂) (a : R) :
    Homotopy (a • φ₁) (a • φ₂)

{φ₁ φ₂ : S₁ ⟶ S₂}

(h : CategoryTheory.ShortComplex.Homotopy φ₁ φ₂)


theorem irreducible_pow_sup (hI : I ≠ ⊥) (hJ : Irreducible J) (n : ℕ) :
    J ^ n ⊔ I = J ^ min ((normalizedFactors I).count J) n

{T : Type u_4}
[CommRing T]
[IsDedekindDomain T]
{I J : Ideal T}
(hI : I ≠ ⊥)
(hJ : Irreducible J)
(n : ℕ)

J ^ n ⊔ I = J ^ min (Multiset.count J (UniqueFactorizationMonoid.normalizedFactors I)) n


@[simp]
theorem realize_neg (x : ring.Term α) (v : α → R) :
    Term.realize v (-x) = -Term.realize v x

{α : Type u_1}
{R : Type u_2}
[Add R]
[Mul R]
[Neg R]
[One R]
[Zero R]
[FirstOrder.Ring.CompatibleRing R]
(x : FirstOrder.Language.ring.Term α)
(v : α → R)

FirstOrder.Language.Term.realize v (-x) = -FirstOrder.Language.Term.realize v x


theorem mk_range_le_lift {α : Type u} {β : Type v} {f : α → β} :
    lift.{u} #(range f) ≤ lift.{v} #α

Cardinal.lift.{u, v} (Cardinal.mk ↑(Set.range f)) ≤ Cardinal.lift.{v, u} (Cardinal.mk α)


@[simp]
theorem isUnit_of_map_unit (f : R →+* S) [IsLocalRingHom f] (a) (h : IsUnit (f a)) : IsUnit a

{R : Type u_1}
{S : Type u_2}
[Semiring R]
[Semiring S]
(f : R →+* S)
[IsLocalRingHom f]
(a : R)
(h : IsUnit (f a))


theorem eventually_lt_of_lt_liminf {f : Filter α} [ConditionallyCompleteLinearOrder β] {u : α → β}
    {b : β} (h : b < liminf u f)
    (hu : f.IsBoundedUnder (· ≥ ·) u := by isBoundedDefault) :
    ∀ᶠ a in f, b < u a

(hu : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f u := by isBoundedDefault)


theorem tendsto_integral_cos_pow_mul_div {f : ℝ → ℂ} (hf : ContinuousOn f (Icc 0 (π / 2))) :
    Tendsto
      (fun n : ℕ => (∫ x in (0 : ℝ)..π / 2, (cos x : ℂ) ^ n * f x) /
        (∫ x in (0 : ℝ)..π / 2, cos x ^ n : ℝ))
      atTop (𝓝 <| f 0)

(hf : ContinuousOn f (Set.Icc 0 (π / 2)))

Filter.Tendsto (fun n => (∫ (x : ℝ) in 0 ..π / 2, ↑(Real.cos x) ^ n * f x) / ↑(∫ (x : ℝ) in 0 ..π / 2, Real.cos x ^ n))
  Filter.atTop (𝓝 (f 0))


theorem blockTriangular_blockDiagonal [DecidableEq α] (d : α → Matrix m m R) :
    BlockTriangular (blockDiagonal d) Prod.snd

{α : Type u_1}
{m : Type u_3}
{R : Type v}
[CommRing R]
[Preorder α]
[DecidableEq α]
(d : α → Matrix m m R)


/-- The canonical isomorphism `(𝟭 C).mapTriangle ≅ 𝟭 (Triangle C)`. -/
@[simps!]
def mapTriangleIdIso : (𝟭 C).mapTriangle ≅ 𝟭 _

(X : CategoryTheory.Pretriangulated.Triangle C)

((CategoryTheory.Functor.mapTriangleIdIso C).hom.app X).hom₃ = CategoryTheory.CategoryStruct.id X.obj₃


theorem dvd_prime {p m : ℕ+} (pp : p.Prime) : m ∣ p ↔ m = 1 ∨ m = p


theorem computable_of_oneOneReducible {p : α → Prop} {q : β → Prop} (h : p ≤₁ q) :
    ComputablePred q → ComputablePred p

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{p : α → Prop}
{q : β → Prop}
(h : p ≤₁ q)


@[simp]
theorem restrict_zero {i : Set α} : (0 : VectorMeasure α M).restrict i = 0

{α : Type u_1}
[MeasurableSpace α]
{M : Type u_3}
[AddCommMonoid M]
[TopologicalSpace M]
{i : Set α}

MeasureTheory.VectorMeasure.restrict 0 i = 0


@[simp]
theorem div_one (a : Ordinal) : a / 1 = a


@[ext]
theorem ext {f g : M₁ →SL[σ₁₂] M₂} (h : ∀ x, f x = g x) : f = g

{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 g : M₁ →SL[σ₁₂] M₂}
(h : ∀ (x : M₁), f x = g x)


lemma leRec_succ_left {motive : (m : ℕ) → n ≤ m → Sort*}
    (refl le_succ_of_le) {m} (h1 : n ≤ m) (h2 : n + 1 ≤ m) :
    -- the `@` is needed for this to elaborate, even though we only provide explicit arguments!
    @leRec _ _ (le_succ_of_le le_rfl refl) (fun k h ih => le_succ_of_le (le_of_succ_le h) ih) _ h2 =
      leRec (motive := motive) refl le_succ_of_le h1

(le_succ_of_le : ⦃k : ℕ⦄ → (h : n ≤ k) → motive k h → motive (k + 1) ⋯)

Nat.leRec (le_succ_of_le ⋯ refl) (fun k h ih => le_succ_of_le ⋯ ih) h2 = Nat.leRec refl le_succ_of_le h1


theorem extend_congr {β : Type*} {Pb : β → Prop} {mb : ∀ s : β, Pb s → ℝ≥0∞} {sa : α} {sb : β}
    (hP : P sa ↔ Pb sb) (hm : ∀ (ha : P sa) (hb : Pb sb), m sa ha = mb sb hb) :
    extend m sa = extend mb sb

MeasureTheory.extend m sa = MeasureTheory.extend mb sb


lemma Module.mem_support_iff_exists_annihilator :
    p ∈ Module.support R M ↔ ∃ m : M, (R ∙ m).annihilator ≤ p.asIdeal

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{p : PrimeSpectrum R}

p ∈ Module.support R M ↔ ∃ m, (Submodule.span R {m}).annihilator ≤ p.asIdeal


/-- If one of the measures `μ i` has no atoms, them `Measure.pi µ`
has no atoms. The instance below assumes that all `μ i` have no atoms. -/
theorem pi_noAtoms (i : ι) [NoAtoms (μ i)] : NoAtoms (Measure.pi μ)

{μ : (i : ι) → MeasureTheory.Measure (α i)}

[∀ (i : ι), MeasureTheory.SigmaFinite (μ i)]


theorem linfty_opNNNorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖₊ ≤ ‖A‖₊ * ‖B‖₊

{l : Type u_2}
{m : Type u_3}
{n : Type u_4}
{α : Type u_5}
[Fintype l]
[Fintype m]
[Fintype n]
[NonUnitalSeminormedRing α]
(A : Matrix l m α)
(B : Matrix m n α)

‖A * B‖₊ ≤ ‖A‖₊ * ‖B‖₊


/-- `rel` is self-dual: The map that swaps the argument order of a
    relation induces an equivalence between `rel` and its opposite. -/
@[simps]
def opEquivalence : Equivalence RelCat RelCatᵒᵖ

CategoryTheory.RelCat.opEquivalence.counitIso =
  CategoryTheory.Iso.refl (CategoryTheory.RelCat.unopFunctor.comp CategoryTheory.RelCat.opFunctor)


/--
Congruence in the function argument: if `a₁ = a₂` then `f a₁ = f a₂` for
any (nondependent) function `f`. This is more powerful than it might look at first, because
you can also use a lambda expression for `f` to prove that
`<something containing a₁> = <something containing a₂>`. This function is used
internally by tactics like `congr` and `simp` to apply equalities inside
subterms.

For more information: [Equality](https://lean-lang.org/theorem_proving_in_lean4/quantifiers_and_equality.html#equality)
-/
theorem congrArg {α : Sort u} {β : Sort v} {a₁ a₂ : α} (f : α → β) (h : Eq a₁ a₂) : Eq (f a₁) (f a₂)


theorem injective_πs' {o₁ o₂ : Ordinal} (h : o₁ ≤ o₂) : Function.Injective (πs' C h)

{I : Type u}
[LinearOrder I]
[IsWellOrder I fun x x_1 => x < x_1]
(C : Set (I → Bool))
{o₁ o₂ : Ordinal.{u}}
(h : o₁ ≤ o₂)

Function.Injective ⇑(Profinite.NobelingProof.πs' C h)


@[to_additive]
theorem Equiv.multipliable_iff_of_mulSupport {g : γ → α} (e : mulSupport f ≃ mulSupport g)
    (he : ∀ x : mulSupport f, g (e x) = f x) : Multipliable f ↔ Multipliable g

(e : ↑(Function.mulSupport f) ≃ ↑(Function.mulSupport g))

(he : ∀ (x : ↑(Function.mulSupport f)), g ↑(e x) = f ↑x)


/-- If `s` and `t` are compact sets in a T₂ space, then the set neighborhoods filter of `s ∩ t`
is the infimum of set neighborhoods filters for `s` and `t`.

For general sets, only the `≤` inequality holds, see `nhdsSet_inter_le`. -/
theorem IsCompact.nhdsSet_inter_eq [T2Space X] {s t : Set X} (hs : IsCompact s) (ht : IsCompact t) :
    𝓝ˢ (s ∩ t) = 𝓝ˢ s ⊓ 𝓝ˢ t

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]
{s t : Set X}
(hs : IsCompact s)
(ht : IsCompact t)

𝓝ˢ (s ∩ t) = 𝓝ˢ s ⊓ 𝓝ˢ t


/-- Given a functor `F : I ⥤ C`, a cocone `c` on `F ⋙ yoneda : I ⥤ Cᵒᵖ ⥤ Type v₁` induces a
    functor `I ⥤ CostructuredArrow yoneda c.pt` which maps `i : I` to the leg
    `yoneda.obj (F.obj i) ⟶ c.pt`. If `c` is a colimit cocone, then that functor is
    final.

    Proposition 2.6.3(ii) in [Kashiwara2006] -/
theorem final_toCostructuredArrow_comp_pre {c : Cocone (F ⋙ yoneda)} (hc : IsColimit c) :
    Functor.Final (c.toCostructuredArrow ⋙ CostructuredArrow.pre F yoneda c.pt)

{c : CategoryTheory.Limits.Cocone (F.comp CategoryTheory.yoneda)}

(hc : CategoryTheory.Limits.IsColimit c)

(c.toCostructuredArrow.comp (CategoryTheory.CostructuredArrow.pre F CategoryTheory.yoneda c.pt)).Final


theorem Bijective.existsUnique_iff {f : α → β} (hf : Bijective f) {p : β → Prop} :
    (∃! y, p y) ↔ ∃! x, p (f x)

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


theorem count_prod {ι} (s : Finset ι) (I : ι → FractionalIdeal R⁰ K) (hS : ∀ i ∈ s, I i ≠ 0) :
    count K v (∏ i ∈ s, I i) = ∑ i ∈ s, count K v (I i)

(v : IsDedekindDomain.HeightOneSpectrum R)

FractionalIdeal.count K v (∏ i ∈ s, I i) = ∑ i ∈ s, FractionalIdeal.count K v (I i)


/-- The predicate asserting that the result of `modifyP` is safe to construct. -/
class ModifyWF (t : RBSet α cmp) (cut : α → Ordering) (f : α → α) : Prop where
  /-- The resulting tree is well formed. -/
  wf : (t.1.modify cut f).WF cmp

{α : Type u_1}
{cmp : α → α → Ordering}
{t : Batteries.RBSet α cmp}
{cut : α → Ordering}
{f : α → α}
[self : t.ModifyWF cut f]

Batteries.RBNode.WF cmp (Batteries.RBNode.modify cut f t.val)


/-- The type of bounded lattice homomorphisms from `α` to `β`. -/
structure BoundedLatticeHom (α β : Type*) [Lattice α] [Lattice β] [BoundedOrder α]
  [BoundedOrder β] extends LatticeHom α β where
  /-- A `BoundedLatticeHom` preserves the top element. -/
  map_top' : toFun ⊤ = ⊤
  /-- A `BoundedLatticeHom` preserves the bottom element. -/
  map_bot' : toFun ⊥ = ⊥

{α : Type u_7}
{β : Type u_8}
[Lattice α]
[Lattice β]
[BoundedOrder α]
[BoundedOrder β]
(self : BoundedLatticeHom α β)


theorem over_right (U : Over X) : U.right = ⟨⟨⟩⟩

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{X : T}
(U : CategoryTheory.Over X)


@[simp]
theorem inf_toSubsemiring (S T : Subalgebra R A) :
    (S ⊓ T).toSubsemiring = S.toSubsemiring ⊓ T.toSubsemiring

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


theorem zeroLocus_anti_mono_ideal {s t : Ideal A} (h : s ≤ t) :
    zeroLocus 𝒜 (t : Set A) ⊆ zeroLocus 𝒜 (s : Set A)

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

ProjectiveSpectrum.zeroLocus 𝒜 ↑t ⊆ ProjectiveSpectrum.zeroLocus 𝒜 ↑s


/-- If `p` is prime, `J(a | p) = -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 : J(a | p) = -1) {x y : ℤ}
    (hxy : ↑p ∣ (x ^ 2 - a * y ^ 2 : ℤ)) : ↑p ∣ x ∧ ↑p ∣ y

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

↑p ∣ x ∧ ↑p ∣ y


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

[MeasureTheory.VAddInvariantMeasure G α μ]

(h : MeasureTheory.IsAddFundamentalDomain G s μ)

(hν : ν ≪ μ)

∫ (x : α), f x ∂ν = ∑' (g : G), ∫ (x : α) in g +ᵥ s, f x ∂ν


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

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
{G : K ⥤ C}
(e : K ≌ J)
(α : e.functor ⋙ F ≅ G)

(CategoryTheory.Limits.Cones.equivalenceOfReindexing e α).counitIso =
  CategoryTheory.isoWhiskerLeft (CategoryTheory.Limits.Cones.postcompose α.inv)
      (CategoryTheory.isoWhiskerRight
        (CategoryTheory.NatIso.ofComponents (fun s => CategoryTheory.Limits.Cones.ext (CategoryTheory.Iso.refl s.pt) ⋯)
          ⋯)
        (CategoryTheory.Limits.Cones.postcompose α.hom)) ≪≫
    CategoryTheory.NatIso.ofComponents (fun s => CategoryTheory.Limits.Cones.ext (CategoryTheory.Iso.refl s.pt) ⋯) ⋯


theorem indexOf_getElem [DecidableEq α] {l : List α} (H : Nodup l) (i : Nat) (h : i < l.length) :
    indexOf l[i] l = i

{α : Type u}
[DecidableEq α]
{l : List α}
(H : l.Nodup)
(i : ℕ)
(h : i < l.length)


theorem lt_top (K : Compacts G) : μ K < ∞

{G : Type w}
[TopologicalSpace G]
(μ : MeasureTheory.Content G)
(K : TopologicalSpace.Compacts G)


theorem commutator_le_left [H₁.Normal] : ⁅H₁, H₂⁆ ≤ H₁

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

⁅H₁, H₂⁆ ≤ H₁


/-- A weighted subtraction with `weightedVSubVSubWeights` gives the result of subtracting the
specified points. -/
@[simp]
theorem weightedVSub_weightedVSubVSubWeights [DecidableEq ι] (p : ι → P) {i j : ι} (hi : i ∈ s)
    (hj : j ∈ s) : s.weightedVSub p (weightedVSubVSubWeights k i j) = p i -ᵥ p j

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
[DecidableEq ι]
(p : ι → P)
{i j : ι}
(hi : i ∈ s)
(hj : j ∈ s)

(s.weightedVSub p) (Finset.weightedVSubVSubWeights k i j) = p i -ᵥ p j


theorem covolume_eq_det_mul_measure {ι : Type*} [Fintype ι] [DecidableEq ι] (b : Basis ι ℤ L)
    (b₀ : Basis ι ℝ E) :
    covolume L μ = |b₀.det ((↑) ∘ b)| * (μ (Zspan.fundamentalDomain b₀)).toReal

(μ : MeasureTheory.Measure E := by volume_tac)

Zlattice.covolume L μ = |b₀.det (Subtype.val ∘ ⇑b)| * (μ (Zspan.fundamentalDomain b₀)).toReal