theorem castPred_lt_iff {j : Fin n} {i : Fin (n + 1)} (hi : i ≠ last n) :
    castPred i hi < j ↔ i < castSucc j

{n : ℕ}
{j : Fin n}
{i : Fin (n + 1)}
(hi : i ≠ Fin.last n)


@[simp] lemma graphOn_empty (f : α → β) : graphOn f ∅ = ∅

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


lemma inter_biUnion (t : Finset β) (s : Finset α) (f : α → Finset β) :
    t ∩ s.biUnion f = s.biUnion fun x ↦ t ∩ f x

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(t : Finset β)
(s : Finset α)
(f : α → Finset β)

t ∩ s.biUnion f = s.biUnion fun x => t ∩ f x


theorem mem_colon {r} : r ∈ N.colon P ↔ ∀ p ∈ P, r • p ∈ N

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{N P : Submodule R M}
{r : R}


theorem differentiableWithinAt_pow :
    DifferentiableWithinAt 𝕜 (fun x : 𝕜 => x ^ n) s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{s : Set 𝕜}
(n : ℕ)

DifferentiableWithinAt 𝕜 (fun x => x ^ n) s x


@[simp]
theorem idZeroEquivIsoZero_apply_hom (X : C) (h : 𝟙 X = 0) : ((idZeroEquivIsoZero X) h).hom = 0

((CategoryTheory.Limits.idZeroEquivIsoZero X) h).hom = 0


@[simp]
theorem lookup_union_left {a} {s₁ s₂ : Finmap β} : a ∈ s₁ → lookup a (s₁ ∪ s₂) = lookup a s₁

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{s₁ s₂ : Finmap β}

a ∈ s₁ → Finmap.lookup a (s₁ ∪ s₂) = Finmap.lookup a s₁


@[to_additive (attr := simp)]
theorem toGroupSeminorm_eq_coe : ⇑p.toGroupSeminorm = p

{E : Type u_4}
[AddGroup E]
{p : AddGroupNorm E}


@[simp] theorem findSome?_cons_of_isSome (l) (h : (f a).isSome) : findSome? f (a :: l) = f a

∀ {α : Type u_1} {α_1 : Type u_2} {f : α → Option α_1} {a : α} (l : List α),
  (f a).isSome = true → List.findSome? f (a :: l) = f a


/-- A valuation subring of a field `K` is a subring `A` such that for every `x : K`,
either `x ∈ A` or `x⁻¹ ∈ A`. -/
structure ValuationSubring extends Subring K where
  mem_or_inv_mem' : ∀ x : K, x ∈ carrier ∨ x⁻¹ ∈ carrier

{K : Type u}
[Field K]
(self : ValuationSubring K)
(x : K)


theorem Nat.eq_of_beq_eq_true : {n m : Nat} → Eq (beq n m) true → Eq n m


/-- Nonzero fractional ideals in a Dedekind domain are units.

This is also available as `_root_.mul_inv_cancel`, using the
`Semifield` instance defined below.
-/
protected theorem mul_inv_cancel [IsDedekindDomain A] {I : FractionalIdeal A⁰ K} (hne : I ≠ 0) :
    I * I⁻¹ = 1

{A : Type u_2}
{K : Type u_3}
[CommRing A]
[Field K]
[Algebra A K]
[IsFractionRing A K]
[IsDedekindDomain A]
{I : FractionalIdeal A⁰ K}
(hne : I ≠ 0)


theorem setToL1_eq_setToL1SCLM (hT : DominatedFinMeasAdditive μ T C) (f : α →₁ₛ[μ] E) :
    setToL1 hT f = setToL1SCLM α E μ hT f

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(f : ↥(MeasureTheory.Lp.simpleFunc E 1 μ))

(MeasureTheory.L1.setToL1 hT) ↑f = (MeasureTheory.L1.SimpleFunc.setToL1SCLM α E μ hT) f


/-- Assumes left covariance. -/
theorem Left.mul_pos [PosMulStrictMono α] (ha : 0 < a) (hb : 0 < b) : 0 < a * b

{α : Type u_1}
{a b : α}
[MulZeroClass α]
[Preorder α]
[PosMulStrictMono α]
(ha : 0 < a)
(hb : 0 < b)


lemma ideal_eq_bot_of_isLieAbelian [IsDomain R] [IsPrincipalIdealRing R]
    (I : LieIdeal R L) [IsLieAbelian I] : I = ⊥

{R : Type u_1}
{L : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[Module.Free R L]
[Module.Finite R L]
[LieAlgebra.IsKilling R L]
[IsDomain R]
[IsPrincipalIdealRing R]
(I : LieIdeal R L)
[IsLieAbelian ↥↑I]


/-- Negating the orientation negates the value of `oangle`. -/
theorem oangle_neg_orientation_eq_neg (x y : V) : (-o).oangle x y = -o.oangle x y

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


@[simp]
theorem subtypeQuotientEquivQuotientSubtype_mk (p₁ : α → Prop)
    [s₁ : Setoid α] [s₂ : Setoid (Subtype p₁)] (p₂ : Quotient s₁ → Prop) (hp₂ : ∀ a, p₁ a ↔ p₂ ⟦a⟧)
    (h : ∀ x y : Subtype p₁, @Setoid.r _ s₂ x y ↔ (x : α) ≈ y)
    (x hx) : subtypeQuotientEquivQuotientSubtype p₁ p₂ hp₂ h ⟨⟦x⟧, hx⟩ = ⟦⟨x, (hp₂ _).2 hx⟩⟧

(h : ∀ (x y : Subtype p₁), Setoid.r x y ↔ ↑x ≈ ↑y)

(Equiv.subtypeQuotientEquivQuotientSubtype p₁ p₂ hp₂ h) ⟨⟦x⟧, hx⟩ = ⟦⟨x, ⋯⟩⟧


/-- The counit isomorphism of the auto-equivalence of categories `triangleRotation C` of
`Triangle C` given by the rotation of triangles. -/
@[simps!]
def invRotCompRot : invRotate C ⋙ rotate C ≅ 𝟭 (Triangle C)

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

(X : CategoryTheory.Pretriangulated.Triangle C)

(CategoryTheory.Pretriangulated.invRotCompRot.inv.app X).hom₃ =
  (CategoryTheory.shiftFunctorCompIsoId C (-1) 1 ⋯).inv.app X.obj₃


theorem closure_sUnion (s : Set (Set R)) : closure (⋃₀ s) = ⨆ t ∈ s, closure t

{R : Type u}
[NonUnitalNonAssocRing R]
(s : Set (Set R))

NonUnitalSubring.closure (⋃₀ s) = ⨆ t ∈ s, NonUnitalSubring.closure t


/-- Two algebra morphisms from the even subalgebra are equal if they agree on pairs of generators.

See note [partially-applied ext lemmas]. -/
@[ext high]
theorem even.algHom_ext ⦃f g : even Q →ₐ[R] A⦄ (h : (even.ι Q).compr₂ f = (even.ι Q).compr₂ g) :
    f = g

⦃f g : ↥(CliffordAlgebra.even Q) →ₐ[R] A⦄

(h : (CliffordAlgebra.even.ι Q).compr₂ f = (CliffordAlgebra.even.ι Q).compr₂ g)


@[to_additive (attr := norm_cast)] -- Porting note (#10618): simp can prove this (so removed simp)
lemma orderOf_coe (a : H) : orderOf (a : G) = orderOf a

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}
(a : ↥H)


@[gcongr]
theorem ball_subset_ball (h : ε₁ ≤ ε₂) : ball x ε₁ ⊆ ball x ε₂

{α : Type u}
[PseudoEMetricSpace α]
{x : α}
{ε₁ ε₂ : ℝ≥0∞}
(h : ε₁ ≤ ε₂)


theorem disjoint_atBot_principal_Ici [Preorder α] [NoMinOrder α] (x : α) :
    Disjoint atBot (𝓟 (Ici x))

{α : Type u_3}
[Preorder α]
[NoMinOrder α]
(x : α)


@[simp]
theorem hermite_zero : hermite 0 = C 1


/-- Let `G` be a Type with addition. `TwoUniqueSums G` asserts that any two non-empty
finite subsets of `G`, at least one of which is not a singleton, possesses at least two pairs
of elements satisfying the `UniqueAdd` property. -/
class TwoUniqueSums (G) [Add G] : Prop where
/-- For `A B` two finite sets whose product has cardinality at least 2,
  we can find at least two unique pairs. -/
  uniqueAdd_of_one_lt_card : ∀ {A B : Finset G}, 1 < A.card * B.card →
    ∃ p1 ∈ A ×ˢ B, ∃ p2 ∈ A ×ˢ B, p1 ≠ p2 ∧ UniqueAdd A B p1.1 p1.2 ∧ UniqueAdd A B p2.1 p2.2

{G : Type u_1}
[Add G]
[self : TwoUniqueSums G]
{A B : Finset G}


theorem pullback_monotone (f : Y ⟶ X) : Monotone (Sieve.pullback f)

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


@[to_additive]
theorem mulSupport_update_eq_ite [DecidableEq α] [DecidableEq M] (f : α → M) (x : α) (y : M) :
    mulSupport (update f x y) = if y = 1 then mulSupport f \ {x} else insert x (mulSupport f)

{α : Type u_1}
{M : Type u_5}
[Zero M]
[DecidableEq α]
[DecidableEq M]
(f : α → M)
(x : α)
(y : M)

Function.support (Function.update f x y) = if y = 0 then Function.support f \ {x} else insert x (Function.support f)


theorem unpaired' {f : ℕ → ℕ →. ℕ} : Nat.Partrec (Nat.unpaired f) ↔ Partrec₂ f

{f : ℕ → ℕ →. ℕ}


theorem lift_comp_map (h : MultilinearMap R t E) :
    lift h ∘ₗ map f = lift (h.compLinearMap f)

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
{E : Type u_9}
[AddCommMonoid E]
[Module R E]
{t : ι → Type u_11}
[(i : ι) → AddCommMonoid (t i)]
[(i : ι) → Module R (t i)]
(f : (i : ι) → s i →ₗ[R] t i)
(h : MultilinearMap R t E)

PiTensorProduct.lift h ∘ₗ PiTensorProduct.map f = PiTensorProduct.lift (h.compLinearMap f)


protected theorem Inducing.regularSpace [TopologicalSpace Y] {f : Y → X} (hf : Inducing f) :
    RegularSpace Y

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


/-- The top subgroup is isomorphic to the group.

This is the group version of `Submonoid.topEquiv`. -/
@[to_additive (attr := simps!)
      "The top additive subgroup is isomorphic to the additive group.

      This is the additive group version of `AddSubmonoid.topEquiv`."]
def topEquiv : (⊤ : Subgroup G) ≃* G


/-- A seminormed group is a group endowed with a norm for which `dist x y = ‖x / y‖` defines a
pseudometric space structure. -/
@[to_additive]
class SeminormedGroup (E : Type*) extends Norm E, Group E, PseudoMetricSpace E where
  dist := fun x y => ‖x / y‖
  /-- The distance function is induced by the norm. -/
  dist_eq : ∀ x y, dist x y = ‖x / y‖ := by aesop

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


/-- The left homology map data associated to the zero morphism between two short complexes. -/
@[simps]
def zero (h₁ : S₁.LeftHomologyData) (h₂ : S₂.LeftHomologyData) :
    LeftHomologyMapData 0 h₁ h₂

(CategoryTheory.ShortComplex.LeftHomologyMapData.zero h₁ h₂).φK = 0


@[ext]
lemma cycles_ext {A : C} (f₁ f₂ : A ⟶ S.cycles) (h : f₁ ≫ S.iCycles = f₂ ≫ S.iCycles) :
    f₁ = f₂

(h : CategoryTheory.CategoryStruct.comp f₁ S.iCycles = CategoryTheory.CategoryStruct.comp f₂ S.iCycles)


@[ext] theorem UInt16.ext : {x y : UInt16} → x.toNat = y.toNat → x = y


/-- A homomorphism `f` of seminormed groups is Lipschitz, if there exists a constant `C` such that
for all `x`, one has `‖f x‖ ≤ C * ‖x‖`. The analogous condition for a linear map of
(semi)normed spaces is in `Mathlib/Analysis/NormedSpace/OperatorNorm.lean`. -/
@[to_additive "A homomorphism `f` of seminormed groups is Lipschitz, if there exists a constant
`C` such that for all `x`, one has `‖f x‖ ≤ C * ‖x‖`. The analogous condition for a linear map of
(semi)normed spaces is in `Mathlib/Analysis/NormedSpace/OperatorNorm.lean`."]
theorem MonoidHomClass.lipschitz_of_bound [MonoidHomClass 𝓕 E F] (f : 𝓕) (C : ℝ)
    (h : ∀ x, ‖f x‖ ≤ C * ‖x‖) : LipschitzWith (Real.toNNReal C) f

{𝓕 : Type u_1}
{E : Type u_3}
{F : Type u_4}
[SeminormedAddGroup E]
[SeminormedAddGroup F]
[FunLike 𝓕 E F]
[AddMonoidHomClass 𝓕 E F]
(f : 𝓕)
(C : ℝ)
(h : ∀ (x : E), ‖f x‖ ≤ C * ‖x‖)


@[simp]
theorem ofZNum_toNat : ∀ n : ZNum, (ofZNum n : ℕ) = Int.toNat n


theorem nim_add_nim_equiv {n m : ℕ} : nim n + nim m ≈ nim (n ^^^ m)

SetTheory.PGame.nim ↑n + SetTheory.PGame.nim ↑m ≈ SetTheory.PGame.nim ↑(n ^^^ m)


/-- Auxiliary definition for `unopEquivalence`. -/
@[simps]
def unopInverse : HomologicalComplex V c.symm ⥤ (HomologicalComplex Vᵒᵖ c)ᵒᵖ

∀ {X Y : HomologicalComplex V c.symm} (f : X ⟶ Y),
  (HomologicalComplex.unopInverse V c).map f = Quiver.Hom.op { f := fun i => (f.f i).op, comm' := ⋯ }


@[simp] theorem bne_right_inj : ∀ (x y z : Bool), (x != z) = (y != z) ↔ x = y


/-- The functor `Square C ⥤ Square D` induced by a functor `C ⥤ D`. -/
@[simps]
def mapSquare (F : C ⥤ D) : Square C ⥤ Square D

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

∀ {X Y : CategoryTheory.Square C} (φ : X ⟶ Y), ((CategoryTheory.Functor.mapSquare C F).map φ).τ₃ = F.map φ.τ₃


theorem natDegree_of_b_eq_zero' : (toPoly ⟨0, 0, c, d⟩).natDegree ≤ 1

{ a := 0, b := 0, c := c, d := d }.toPoly.natDegree ≤ 1


theorem pairwise_disjoint_Ico_add_intCast :
    Pairwise (Disjoint on fun n : ℤ => Ico (a + n) (a + n + 1))

Pairwise (Disjoint on fun n => Set.Ico (a + ↑n) (a + ↑n + 1))


@[to_additive (attr := simp)]
theorem top_toSubmonoid : (⊤ : Subgroup G).toSubmonoid = ⊤


/-- A `NormedOrderedGroup` is a group that is both a `NormedCommGroup` and an
`OrderedCommGroup`. This class is necessary to avoid diamonds caused by both classes
carrying their own group structure. -/
@[to_additive]
class NormedOrderedGroup (α : Type*) extends OrderedCommGroup α, Norm α, MetricSpace α where
  /-- The distance function is induced by the norm. -/
  dist_eq : ∀ x y, dist x y = ‖x / y‖ := by aesop

{α : Type u_2}
[self : NormedOrderedGroup α]
(x y : α)


@[simp]
theorem smeval_sub : (p - q).smeval x = p.smeval x - q.smeval x

(R : Type u_1)
[Ring R]
{S : Type u_2}
[AddCommGroup S]
[Pow S ℕ]
[Module R S]
(p q : Polynomial R)
(x : S)


/-- The `i + j`-th element of a list coincides with the `j`-th element of the list obtained by
dropping the first `i` elements. Version designed to rewrite from the big list to the small list. -/
@[deprecated getElem_drop (since := "2024-06-12")]
theorem get_drop (L : List α) {i j : Nat} (h : i + j < L.length) :
    get L ⟨i + j, h⟩ = get (L.drop i) ⟨j, lt_length_drop L h⟩

{α : Type u_1}
(L : List α)
{i j : Nat}
(h : i + j < L.length)

L.get ⟨i + j, h⟩ = (List.drop i L).get ⟨j, ⋯⟩


@[to_additive]
protected theorem NeBot.div : NeBot f → NeBot g → NeBot (f / g)


theorem setToFun_measure_zero (hT : DominatedFinMeasAdditive μ T C) (h : μ = 0) :
    setToFun μ T hT f = 0

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)


@[fun_prop]
theorem DifferentiableAt.neg (h : DifferentiableAt 𝕜 f x) : DifferentiableAt 𝕜 (fun y => -f y) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
(h : DifferentiableAt 𝕜 f x)


theorem neighborSet_subset_verts (G' : Subgraph G) (v : V) : G'.neighborSet v ⊆ G'.verts

{V : Type u}
{G : SimpleGraph V}
(G' : G.Subgraph)
(v : V)


/-- A point with a finite neighborhood has to be isolated. -/
theorem isOpen_singleton_of_finite_mem_nhds [T1Space X] (x : X)
    {s : Set X} (hs : s ∈ 𝓝 x) (hsf : s.Finite) : IsOpen ({x} : Set X)

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
(x : X)
{s : Set X}
(hs : s ∈ 𝓝 x)
(hsf : s.Finite)


@[simp]
lemma precomp_δ₀ {X : C} (f : X ⟶ F.left) : (F.precomp f).δ₀ = F

(F : CategoryTheory.ComposableArrows C n)


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

(partialFunEquivPointed.functor.obj X).X = Option X


/-- Two subsemirings are equal if they have the same elements. -/
@[ext]
theorem ext {S T : Subsemiring R} (h : ∀ x, x ∈ S ↔ x ∈ T) : S = T

{R : Type u}
[NonAssocSemiring R]
{S T : Subsemiring R}
(h : ∀ (x : R), x ∈ S ↔ x ∈ T)


theorem HasStrictDerivAt.mul_const (hc : HasStrictDerivAt c c' x) (d : 𝔸) :
    HasStrictDerivAt (fun y => c y * d) (c' * d) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{𝔸 : Type u_3}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{c : 𝕜 → 𝔸}
{c' : 𝔸}
(hc : HasStrictDerivAt c c' x)
(d : 𝔸)


theorem snd : Computable (@Prod.snd α β)

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


@[simp]
theorem deriv_const_mul_field' (u : 𝕜') : (deriv fun x => u * v x) = fun x => u * deriv v x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{𝕜' : Type u_2}
[NormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{v : 𝕜 → 𝕜'}
(u : 𝕜')


/-- If the square of the Gauss sum of a quadratic character is `χ(-1) * #R`,
then we get, for all `n : ℕ`, the relation `(χ(-1) * #R) ^ (p^n/2) = χ(p^n)`,
where `p` is the (odd) characteristic of the target ring `R'`.
This version can be used when `R` is not a field, e.g., `ℤ/8ℤ`. -/
theorem Char.card_pow_char_pow {χ : MulChar R R'} (hχ : IsQuadratic χ) (ψ : AddChar R R') (p n : ℕ)
    [fp : Fact p.Prime] [hch : CharP R' p] (hp : IsUnit (p : R)) (hp' : p ≠ 2)
    (hg : gaussSum χ ψ ^ 2 = χ (-1) * Fintype.card R) :
    (χ (-1) * Fintype.card R) ^ (p ^ n / 2) = χ ((p : R) ^ n)

(hg : gaussSum χ ψ ^ 2 = χ (-1) * ↑(Fintype.card R))

(χ (-1) * ↑(Fintype.card R)) ^ (p ^ n / 2) = χ (↑p ^ n)


@[simp]
theorem coe_bot : ((⊥ : NonUnitalStarSubalgebra R A) : Set A) = {0}

{R : Type u}
{A : Type v}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]


@[reassoc (attr := simp), elementwise (attr := simp)]
theorem appIso_inv_app (U) :
    (f.appIso U).inv ≫ f.app (f ''ᵁ U) = X.presheaf.map (eqToHom (preimage_image_eq f U)).op

[H : AlgebraicGeometry.IsOpenImmersion f]

(f.appIso U).inv ≫ f.app (f.opensFunctor.obj U) = X.presheaf.map (CategoryTheory.eqToHom ⋯).op


@[simp]
protected theorem range : LinearMap.range (e : M →ₛₗ[σ₁₂] M₂) = ⊤

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
{module_M : Module R M}
{module_M₂ : Module R₂ M₂}
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
{re₁₂ : RingHomInvPair σ₁₂ σ₂₁}
{re₂₁ : RingHomInvPair σ₂₁ σ₁₂}
(e : M ≃ₛₗ[σ₁₂] M₂)


@[simp] theorem getRight?_inl : (inl x : α ⊕ β).getRight? = none


@[simp] lemma comapSubmodule_le_comap :
    comapSubmodule R M a q ≤ (comapSubmodule R M a q).comap (Algebra.lsmul R R M a)

{q : Submodule R[X] (Module.AEval R M a)}

(Module.AEval.comapSubmodule R M a) q ≤
  Submodule.comap ((Algebra.lsmul R R M) a) ((Module.AEval.comapSubmodule R M a) q)


theorem logb_eq_iff_rpow_eq (hy : 0 < y) : logb b y = x ↔ b ^ x = y

{b x y : ℝ}
(b_pos : 0 < b)
(b_ne_one : b ≠ 1)
(hy : 0 < y)


@[simp]
theorem sub_apply (m : ι → M) : (g - g₂) m = g m - g₂ m

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N' : Type u_6}
[AddCommGroup N']
[Module R N']
{ι : Type u_7}
(g g₂ : M [⋀^ι]→ₗ[R] N')
(m : ι → M)


/-- This is the key lemma on the way to establishing spectral permanence for C⋆-algebras, which is
established in `StarSubalgebra.spectrum_eq`. This lemma is superseded by
`StarSubalgebra.coe_isUnit`, which does not require an `IsStarNormal` hypothesis and holds for
any closed star subalgebra. -/
theorem elementalStarAlgebra.isUnit_of_isUnit_of_isStarNormal (h : IsUnit a) :
    IsUnit (⟨a, self_mem ℂ a⟩ : elementalStarAlgebra ℂ a)

{A : Type u_1}
[NormedRing A]
[NormedAlgebra ℂ A]
[StarRing A]
[CstarRing A]
[StarModule ℂ A]
[CompleteSpace A]
{a : A}
[IsStarNormal a]
(h : IsUnit a)


theorem bsup_succ_eq_blsub {o : Ordinal.{u}} (f : ∀ a < o, Ordinal.{max u v}) :
    succ (bsup.{_, v} o f) = blsub.{_, v} o f ↔ ∃ i hi, f i hi = bsup.{_, v} o f

(f : (a : Ordinal.{u}) → a < o → Ordinal.{max u v})

Order.succ (o.bsup f) = o.blsub f ↔ ∃ i, ∃ (hi : i < o), f i hi = o.bsup f


theorem convexHull_sum {ι} (s : Finset ι) (t : ι → Set E) :
    convexHull R (∑ i ∈ s, t i) = ∑ i ∈ s, convexHull R (t i)

{R : Type u_1}
{E : Type u_3}
[LinearOrderedField R]
[AddCommGroup E]
[Module R E]
{ι : Type u_8}
(s : Finset ι)
(t : ι → Set E)

(convexHull R) (∑ i ∈ s, t i) = ∑ i ∈ s, (convexHull R) (t i)


theorem get_tails (l : List α) (n : Fin (length (tails l))) : (tails l).get n = l.drop n

{α : Type u_1}
(l : List α)
(n : Fin l.tails.length)


theorem withDensity_indicator {s : Set α} (hs : MeasurableSet s) (f : α → ℝ≥0∞) :
    μ.withDensity (s.indicator f) = (μ.restrict s).withDensity f

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(hs : MeasurableSet s)
(f : α → ℝ≥0∞)


@[simp] protected
theorem finrank_bot : finrank F (⊥ : IntermediateField F E) = 1

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


theorem div_conj_eq_sub_one : p / q = p - 1


theorem monomial_mem_lifts_and_degree_eq {s : S} {n : ℕ} (hl : monomial n s ∈ lifts f) :
    ∃ q : R[X], map f q = monomial n s ∧ q.degree = (monomial n s).degree

(hl : (Polynomial.monomial n) s ∈ Polynomial.lifts f)

∃ q, Polynomial.map f q = (Polynomial.monomial n) s ∧ q.degree = ((Polynomial.monomial n) s).degree


theorem absNorm_div_norm_eq_absNorm_div_norm {I : FractionalIdeal R⁰ K} (a : R⁰) (I₀ : Ideal R)
    (h : a • (I : Submodule R K) = Submodule.map (Algebra.linearMap R K) I₀) :
    (Ideal.absNorm I.num : ℚ) / |Algebra.norm ℤ (I.den : R)| =
      (Ideal.absNorm I₀ : ℚ) / |Algebra.norm ℤ (a : R)|

{I : FractionalIdeal (nonZeroDivisors R) K}

(h : a • ↑I = Submodule.map (Algebra.linearMap R K) I₀)

↑(Ideal.absNorm I.num) / ↑|(Algebra.norm ℤ) ↑I.den| = ↑(Ideal.absNorm I₀) / ↑|(Algebra.norm ℤ) ↑a|


@[simp]
theorem εClosure_empty : M.εClosure ∅ = ∅

{α : Type u}
{σ : Type v}
(M : εNFA α σ)


theorem abs_sin_eq_of_two_zsmul_eq {θ ψ : Angle} (h : (2 : ℤ) • θ = (2 : ℤ) • ψ) :
    |sin θ| = |sin ψ|


theorem coeff_monomial (m n : ℕ) (a : R) : coeff R m (monomial R n a) = if m = n then a else 0

{R : Type u_1}
[Semiring R]
(m n : ℕ)
(a : R)

(PowerSeries.coeff R m) ((PowerSeries.monomial R n) a) = if m = n then a else 0


/-- The angle at a point does not depend on the order of the other two
points. -/
nonrec theorem angle_comm (p1 p2 p3 : P) : ∠ p1 p2 p3 = ∠ p3 p2 p1

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(p1 p2 p3 : P)

EuclideanGeometry.angle p1 p2 p3 = EuclideanGeometry.angle p3 p2 p1


theorem eventuallyEq_empty {s : Set α} {l : Filter α} : s =ᶠ[l] (∅ : Set α) ↔ ∀ᶠ x in l, x ∉ s


@[to_additive]
theorem lintegral_eq_tsum' (h : IsFundamentalDomain G s μ) (f : α → ℝ≥0∞) :
    ∫⁻ x, f x ∂μ = ∑' g : G, ∫⁻ x in s, f (g⁻¹ • x) ∂μ

[MeasureTheory.SMulInvariantMeasure G α μ]

(h : MeasureTheory.IsFundamentalDomain G s μ)

(f : α → ℝ≥0∞)

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


/-- A Lie ring module is an additive group, together with an additive action of a
Lie ring on this group, such that the Lie bracket acts as the commutator of endomorphisms.
(For representations of Lie *algebras* see `LieModule`.) -/
class LieRingModule (L : Type v) (M : Type w) [LieRing L] [AddCommGroup M] extends Bracket L M where
  /-- A Lie ring module bracket is additive in its first component. -/
  protected add_lie : ∀ (x y : L) (m : M), ⁅x + y, m⁆ = ⁅x, m⁆ + ⁅y, m⁆
  /-- A Lie ring module bracket is additive in its second component. -/
  protected lie_add : ∀ (x : L) (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆
  /-- A Lie ring module bracket satisfies a Leibniz / Jacobi identity. -/
  protected leibniz_lie : ∀ (x y : L) (m : M), ⁅x, ⁅y, m⁆⁆ = ⁅⁅x, y⁆, m⁆ + ⁅y, ⁅x, m⁆⁆

{L : Type v}
{M : Type w}
[LieRing L]
[AddCommGroup M]
[self : LieRingModule L M]
(x y : L)
(m : M)


@[simp]
theorem inf_sdiff_self_right : x ⊓ y \ x = ⊥

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


theorem SameCycle.exists_pow_eq [DecidableEq α] [Fintype α] (f : Perm α) (h : SameCycle f x y) :
    ∃ i : ℕ, 0 < i ∧ i ≤ (f.cycleOf x).support.card + 1 ∧ (f ^ i) x = y

{α : Type u_2}
{x y : α}
[DecidableEq α]
[Fintype α]
(f : Equiv.Perm α)
(h : f.SameCycle x y)

∃ i, 0 < i ∧ i ≤ (f.cycleOf x).support.card + 1 ∧ (f ^ i) x = y


/-- The category of cones on `F` is just the comma category `(Δ ↓ F)`, where `Δ` is the constant
    functor. -/
@[simps! (config := { notRecursive := [`PLift, `ULift] })]
def Cone.equivCostructuredArrow (F : J ⥤ C) : Cone F ≌ CostructuredArrow (const J) F

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

∀ {X Y : CategoryTheory.CostructuredArrow (CategoryTheory.Functor.const J) F} (f : X ⟶ Y),
  ((CategoryTheory.Limits.Cone.equivCostructuredArrow F).inverse.map f).hom = f.left


@[simp]
theorem fract_fract (a : α) : fract (fract a) = fract a

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(a : α)


theorem pairwiseDisjoint_sUnion {s : Set (Set ι)} (h : DirectedOn (· ⊆ ·) s) :
    (⋃₀ s).PairwiseDisjoint f ↔ ∀ ⦃a⦄, a ∈ s → Set.PairwiseDisjoint a f

(h : DirectedOn (fun x x_1 => x ⊆ x_1) s)

(⋃₀ s).PairwiseDisjoint f ↔ ∀ ⦃a : Set ι⦄, a ∈ s → a.PairwiseDisjoint f


/-- Show that `Nat.choose` is increasing for small values of the right argument. -/
theorem choose_le_succ_of_lt_half_left {r n : ℕ} (h : r < n / 2) :
    choose n r ≤ choose n (r + 1)


theorem monad_map_eq_map {α β : Type u} (f : α → β) (p : PMF α) : f <$> p = p.map f


theorem Finite.sInter {α : Type*} {s : Set (Set α)} {t : Set α} (ht : t ∈ s) (hf : t.Finite) :
    (⋂₀ s).Finite

{α : Type u_1}
{s : Set (Set α)}
{t : Set α}
(ht : t ∈ s)
(hf : t.Finite)


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

(K : TopologicalSpace.PositiveCompacts (G ⧸ Γ))

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

MeasureTheory.AddQuotientMeasureEqMeasurePreimage ν
  (ν (QuotientAddGroup.mk ⁻¹' ↑K ∩ 𝓕) • MeasureTheory.Measure.addHaarMeasure K)


theorem mem_cycleFactorsFinset_iff {f p : Perm α} :
    p ∈ cycleFactorsFinset f ↔ p.IsCycle ∧ ∀ a ∈ p.support, p a = f a

{α : Type u_2}
[DecidableEq α]
[Fintype α]
{f p : Equiv.Perm α}

p ∈ f.cycleFactorsFinset ↔ p.IsCycle ∧ ∀ a ∈ p.support, p a = f a


theorem natDegree_add_le_of_le (hp : natDegree p ≤ m) (hq : natDegree q ≤ n) :
    natDegree (p + q) ≤ max m n

{R : Type u}
{n m : ℕ}
[Semiring R]
{p q : R[X]}
(hp : p.natDegree ≤ m)
(hq : q.natDegree ≤ n)


@[to_additive]
theorem uniformContinuous_unop [UniformSpace α] : UniformContinuous (unop : αᵐᵒᵖ → α)


theorem IsCoprime.of_prod_right (H1 : IsCoprime x (∏ i ∈ t, s i)) (i : I) (hit : i ∈ t) :
    IsCoprime x (s i)

{R : Type u}
{I : Type v}
[CommSemiring R]
{x : R}
{s : I → R}
{t : Finset I}
(H1 : IsCoprime x (∏ i ∈ t, s i))
(i : I)
(hit : i ∈ t)


@[simps (config := .lemmasOnly) id comp]
noncomputable instance categoryAsType : SmallCategory (AsType α)

(α : Type u_1)
[Fintype α]
[CategoryTheory.SmallCategory α]
[CategoryTheory.FinCategory α]

∀ {X Y Z : CategoryTheory.FinCategory.AsType α} (f : X ⟶ Y) (g : Y ⟶ Z),
  CategoryTheory.CategoryStruct.comp f g =
    (Fintype.equivFin (X ⟶ Z))
      (CategoryTheory.CategoryStruct.comp ((Fintype.equivFin (X ⟶ Y)).symm f) ((Fintype.equivFin (Y ⟶ Z)).symm g))


@[simp, norm_cast]
theorem coe_closure (K : ConvexCone 𝕜 E) : (K.closure : Set E) = closure K

{𝕜 : Type u_1}
[OrderedSemiring 𝕜]
{E : Type u_2}
[AddCommMonoid E]
[TopologicalSpace E]
[ContinuousAdd E]
[SMul 𝕜 E]
[ContinuousConstSMul 𝕜 E]
(K : ConvexCone 𝕜 E)


theorem one_div_mul_sub_mul_one_div_eq_one_div_add_one_div (ha : a ≠ 0) (hb : b ≠ 0) :
    1 / a * (b - a) * (1 / b) = 1 / a - 1 / b

{K : Type u_3}
[DivisionRing K]
{a b : K}
(ha : a ≠ 0)
(hb : b ≠ 0)


theorem ext_iff {inst₁ inst₂ : NonUnitalSemiring R} :
    inst₁ = inst₂ ↔
      (local_hAdd[R, inst₁] = local_hAdd[R, inst₂]) ∧
      (local_hMul[R, inst₁] = local_hMul[R, inst₂])

{R : Type u}
{inst₁ inst₂ : NonUnitalSemiring R}

inst₁ = inst₂ ↔ HAdd.hAdd = HAdd.hAdd ∧ HMul.hMul = HMul.hMul


theorem div_re_ofReal {z : K} {r : ℝ} : re (z / r) = re z / r

{K : Type u_1}
[RCLike K]
{z : K}
{r : ℝ}


theorem neg_e0_mul_v (m : M) : -(e0 Q * v Q m) = v Q m * e0 Q

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
(m : M)

-(CliffordAlgebra.EquivEven.e0 Q * (CliffordAlgebra.EquivEven.v Q) m) =
  (CliffordAlgebra.EquivEven.v Q) m * CliffordAlgebra.EquivEven.e0 Q


lemma mul_nonpos_iff_pos_imp_nonpos [PosMulStrictMono α] [MulPosStrictMono α]
    [CovariantClass α α (· + ·) (· ≤ ·)] [ContravariantClass α α (· + ·) (· ≤ ·)] :
    a * b ≤ 0 ↔ (0 < a → b ≤ 0) ∧ (b < 0 → 0 ≤ a)

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

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


lemma tendstoLocallyUniformly_iff_forall_isCompact [LocallyCompactSpace α]  :
    TendstoLocallyUniformly F f p ↔ ∀ K : Set α, IsCompact K → TendstoUniformlyOn F f p K

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{p : Filter ι}
[TopologicalSpace α]
[LocallyCompactSpace α]

TendstoLocallyUniformly F f p ↔ ∀ (K : Set α), IsCompact K → TendstoUniformlyOn F f p K


@[to_additive (attr := simp)]
theorem prod_cons : (a :: l).prod = a * l.prod

{M : Type u_4}
[AddMonoid M]
{l : List M}
{a : M}


theorem mem_oneCocycles_of_addMonoidHom [A.IsTrivial] (f : Additive G →+ A) :
    f ∘ Additive.ofMul ∈ oneCocycles A

{k G : Type u}
[CommRing k]
[Group G]
{A : Rep k G}
[A.IsTrivial]
(f : Additive G →+ CoeSort.coe A)

⇑f ∘ ⇑Additive.ofMul ∈ groupCohomology.oneCocycles A


@[simp]
lemma eq_zero [CharZero R] : ringChar R = 0

{R : Type u_1}
[NonAssocSemiring R]
[CharZero R]


theorem abs_ne_one (z : 𝔻) : abs (z : ℂ) ≠ 1


theorem iff_of_arrow_iso_left {A B A' B' X Y : C} {i : A ⟶ B} {i' : A' ⟶ B'}
    (e : Arrow.mk i ≅ Arrow.mk i') (p : X ⟶ Y) :
    HasLiftingProperty i p ↔ HasLiftingProperty i' p

(e : CategoryTheory.Arrow.mk i ≅ CategoryTheory.Arrow.mk i')

CategoryTheory.HasLiftingProperty i p ↔ CategoryTheory.HasLiftingProperty i' p


/-- The `map` function preserves the order invariants if `f` is monotone. -/
protected theorem Ordered.map (f : α → β) [IsMonotone cmpα cmpβ f] :
    ∀ {t : RBNode α}, t.Ordered cmpα → (t.map f).Ordered cmpβ

[Batteries.RBSet.IsMonotone cmpα cmpβ f]

Batteries.RBNode.Ordered cmpα t → Batteries.RBNode.Ordered cmpβ (Batteries.RBNode.map f t)


/-- For a pair of functors `L : C ⥤ D`, `R : D ⥤ C`, an adjunction `h : L ⊣ R` induces a monad on
the category `C`.
-/
-- Porting note: Specifying simps projections manually to match mathlib3 behavior.
@[simps! coe η μ]
def toMonad (h : L ⊣ R) : Monad C

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{L : CategoryTheory.Functor C D}
{R : CategoryTheory.Functor D C}
(h : L ⊣ R)

h.toMonad.μ = CategoryTheory.whiskerRight (CategoryTheory.whiskerLeft L h.counit) R


theorem exists_mul_lt_of_lt_opNorm (f : E →SL[σ₁₂] F) {r : ℝ} (hr₀ : 0 ≤ r) (hr : r < ‖f‖) :
    ∃ x, r * ‖x‖ < ‖f x‖

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
(f : E →SL[σ₁₂] F)
{r : ℝ}
(hr₀ : 0 ≤ r)
(hr : r < ‖f‖)


@[simp]
theorem sqrt_eq_zero (h : 0 ≤ x) : √x = 0 ↔ x = 0


/-- Lemmas showing projection is the inverse of pi. -/
@[simp]
theorem proj_pi (i : ι) (paths : ∀ i, Path.Homotopic.Quotient (as i) (bs i)) :
    proj i (pi paths) = paths i

(paths : (i : ι) → Path.Homotopic.Quotient (as i) (bs i))

Path.Homotopic.proj i (Path.Homotopic.pi paths) = paths i


@[to_additive]
theorem closure_subset_iff {s t : Set G} (ht : IsSubgroup t) : closure s ⊆ t ↔ s ⊆ t

{G : Type u_1}
[AddGroup G]
{s t : Set G}
(ht : IsAddSubgroup t)


theorem interpolate_eq_sum_interpolate_insert_sdiff (hvt : Set.InjOn v t) (hs : s.Nonempty)
    (hst : s ⊆ t) :
    interpolate t v r = ∑ i ∈ s, interpolate (insert i (t \ s)) v r * Lagrange.basis s v i

{F : Type u_1}
[Field F]
{ι : Type u_2}
[DecidableEq ι]
{s t : Finset ι}
{v : ι → F}
(r : ι → F)
(hvt : Set.InjOn v ↑t)
(hs : s.Nonempty)
(hst : s ⊆ t)

(Lagrange.interpolate t v) r = ∑ i ∈ s, (Lagrange.interpolate (insert i (t \ s)) v) r * Lagrange.basis s v i


lemma LocalizedModule.subsingleton_iff_ker_eq_top {S : Submonoid R} :
    Subsingleton (LocalizedModule S M) ↔
      LinearMap.ker (LocalizedModule.mkLinearMap S M) = ⊤

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{S : Submonoid R}


/-- The 1-hypercover of `D.glued` in the big Zariski site that is given by the
open cover `D.U` from the glue data `D`.
The "covering of the intersection of two such open subsets" is the trivial
covering given by `D.V`. -/
@[simps]
noncomputable def oneHypercover : Scheme.zariskiTopology.OneHypercover D.glued


theorem eq_or_mem_of_mem_insert {x a : α} {s : Set α} : x ∈ insert a s → x = a ∨ x ∈ s


@[simp]
protected theorem countable : Set.Countable { x : A | IsAlgebraic R x }

(R : Type u)
(A : Type v)
[CommRing R]
[CommRing A]
[IsDomain A]
[Algebra R A]
[NoZeroSMulDivisors R A]
[Countable R]


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


@[simp] theorem getElem_enum (i) (h : i < (enum n).size) : (enum n)[i] = ⟨i, size_enum n ▸ h⟩

{n : Nat}
(i : Nat)
(h : i < (Fin.enum n).size)


/-- The left whiskering of an isomorphism is an isomorphism. -/
@[simps]
def whiskerLeftIso (X : C) {Y Z : C} (f : Y ≅ Z) : X ⊗ Y ≅ X ⊗ Z

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

(CategoryTheory.MonoidalCategory.whiskerLeftIso X f).inv = CategoryTheory.MonoidalCategory.whiskerLeft X f.inv


theorem isPerfectMatching_iff_forall_degree [∀ v, Fintype (M.neighborSet v)] :
    M.IsPerfectMatching ↔ ∀ v, M.degree v = 1

{V : Type u_1}
{G : SimpleGraph V}
{M : G.Subgraph}
[(v : V) → Fintype ↑(M.neighborSet v)]

M.IsPerfectMatching ↔ ∀ (v : V), M.degree v = 1


/-- The length of a hamiltonian cycle is the number of vertices. -/
lemma IsHamiltonianCycle.length_eq (hp : p.IsHamiltonianCycle) :
    p.length = Fintype.card α

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{G : SimpleGraph α}
{a : α}
{p : G.Walk a a}
(hp : p.IsHamiltonianCycle)


theorem completeSpace_iff (e : α ≃ᵢ β) : CompleteSpace α ↔ CompleteSpace β

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(e : α ≃ᵢ β)


theorem infDist_inter_closedBall_of_mem (h : y ∈ s) :
    infDist x (s ∩ closedBall x (dist y x)) = infDist x s

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{x y : α}
(h : y ∈ s)

Metric.infDist x (s ∩ Metric.closedBall x (dist y x)) = Metric.infDist x s


/-- Interpret a `Homeomorph` as a `PartialHomeomorph` by restricting it
to an open set `s` in the domain and to `t` in the codomain. -/
@[simps! (config := .asFn) apply symm_apply toPartialEquiv,
  simps! (config := .lemmasOnly) source target]
def _root_.Homeomorph.toPartialHomeomorphOfImageEq (e : X ≃ₜ Y) (s : Set X) (hs : IsOpen s)
    (t : Set Y) (h : e '' s = t) : PartialHomeomorph X Y

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : X ≃ₜ Y)
(s : Set X)
(hs : IsOpen s)
(t : Set Y)
(h : ⇑e '' s = t)

(e.toPartialHomeomorphOfImageEq s hs t h).source = s


/-- A typeclass encoding the fact that a given Lie module has linear weights, vanishing on the
derived ideal. -/
class LinearWeights [LieAlgebra.IsNilpotent R L] : Prop :=
  map_add : ∀ χ : L → R, weightSpace M χ ≠ ⊥ → ∀ x y, χ (x + y) = χ x + χ y
  map_smul : ∀ χ : L → R, weightSpace M χ ≠ ⊥ → ∀ (t : R) x, χ (t • x) = t • χ x
  map_lie : ∀ χ : L → R, weightSpace M χ ≠ ⊥ → ∀ x y : L, χ ⁅x, y⁆ = 0

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

LieModule.weightSpace M χ ≠ ⊥ → ∀ (x y : L), χ (x + y) = χ x + χ y


@[simp] lemma toAddCircle_eq_zero {j : ZMod N} : toAddCircle j = 0 ↔ j = 0


theorem pathConnectedSpace_iff_eq : PathConnectedSpace X ↔ ∃ x : X, pathComponent x = univ

PathConnectedSpace X ↔ ∃ x, pathComponent x = Set.univ


@[simp]
theorem inl_add [Add R] [AddZeroClass M] (r₁ r₂ : R) :
    (inl (r₁ + r₂) : tsze R M) = inl r₁ + inl r₂

{R : Type u}
(M : Type v)
[Add R]
[AddZeroClass M]
(r₁ r₂ : R)

TrivSqZeroExt.inl (r₁ + r₂) = TrivSqZeroExt.inl r₁ + TrivSqZeroExt.inl r₂


lemma Algebra.isIntegral_def : Algebra.IsIntegral R A ↔ ∀ x : A, IsIntegral R x

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

Algebra.IsIntegral R A ↔ ∀ (x : A), IsIntegral R x


/-- The symmetry of homotopy between morphisms of short complexes. -/
@[simps]
def symm (h : Homotopy φ₁ φ₂) : Homotopy φ₂ φ₁

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

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


theorem smoothOn_id : SmoothOn I I (id : M → M) s

{𝕜 : 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]
{s : Set M}


lemma fst_apply (x : α × β) : fst x = x.fst

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
(x : α × β)


theorem getD_rightInvSeq_mul_self (ω : List B) (j : ℕ) :
    ((ris ω).getD j 1) * ((ris ω).getD j 1) = 1

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(ω : List B)
(j : ℕ)

(cs.rightInvSeq ω).getD j 1 * (cs.rightInvSeq ω).getD j 1 = 1


@[to_additive]
theorem finprod_mem_def (s : Set α) (f : α → M) : ∏ᶠ a ∈ s, f a = ∏ᶠ a, mulIndicator s f a

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
(s : Set α)
(f : α → M)

∑ᶠ (a : α) (_ : a ∈ s), f a = ∑ᶠ (a : α), s.indicator f a


theorem HasLineDerivAt.of_comp {v : E'} (hf : HasLineDerivAt 𝕜 (f ∘ L) f' x v) :
    HasLineDerivAt 𝕜 f f' (L x) (L v)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{E' : Type u_4}
[AddCommGroup E']
[Module 𝕜 E']
{f : E → F}
{f' : F}
{x : E'}
{L : E' →ₗ[𝕜] E}
{v : E'}
(hf : HasLineDerivAt 𝕜 (f ∘ ⇑L) f' x v)


lemma mem_finsuppAntidiag' :
    f ∈ finsuppAntidiag s n ↔ f.sum (fun _ x ↦ x) = n ∧ f.support ⊆ s

{ι : Type u_1}
{μ : Type u_2}
[DecidableEq ι]
[AddCommMonoid μ]
[Finset.HasAntidiagonal μ]
[DecidableEq μ]
{s : Finset ι}
{n : μ}
{f : ι →₀ μ}

f ∈ s.finsuppAntidiag n ↔ (f.sum fun x x => x) = n ∧ f.support ⊆ s


theorem setToFun_const [IsFiniteMeasure μ] (hT : DominatedFinMeasAdditive μ T C) (x : E) :
    (setToFun μ T hT fun _ => x) = T univ x

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(MeasureTheory.setToFun μ T hT fun x_1 => x) = (T Set.univ) x


@[simp, norm_cast]
theorem coe_lt_coe {p q : Seminorm 𝕜 E} : (p : E → ℝ) < q ↔ p < q

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddGroup E]
[SMul 𝕜 E]
{p q : Seminorm 𝕜 E}


/-- If `μ` is a non-zero finite measure on `α`, `s` is a convex set in `E`, and `f` is an integrable
function sending `μ`-a.e. points to `s`, then the average value of `f` belongs to `closure s`:
`⨍ x, f x ∂μ ∈ s`. See also `Convex.centerMass_mem` for a finite sum version of this lemma. -/
theorem Convex.set_average_mem_closure (hs : Convex ℝ s) (h0 : μ t ≠ 0) (ht : μ t ≠ ∞)
    (hfs : ∀ᵐ x ∂μ.restrict t, f x ∈ s) (hfi : IntegrableOn f t μ) :
    (⨍ x in t, f x ∂μ) ∈ closure s

(hfs : ∀ᵐ (x : α) ∂μ.restrict t, f x ∈ s)

(hfi : MeasureTheory.IntegrableOn f t μ)


theorem bounds_bddBelow {f : ContinuousMultilinearMap 𝕜 E G} :
    BddBelow { c | 0 ≤ c ∧ ∀ m, ‖f m‖ ≤ c * ∏ i, ‖m i‖ }

[(i : ι) → SeminormedAddCommGroup (E i)]

BddBelow {c | 0 ≤ c ∧ ∀ (m : (i : ι) → E i), ‖f m‖ ≤ c * ∏ i : ι, ‖m i‖}


@[higher_order tfst_id]
theorem id_tfst : ∀ {α β} (x : t α β), tfst (F := Id) pure x = pure x

{t : Type u → Type u → Type u}
[Bitraversable t]
[LawfulBitraversable t]
{α β : Type u}


@[reassoc (attr := simp, nolint simpNF)]
theorem biproduct.eqToHom_comp_ι (f : J → C) [HasBiproduct f] {j j' : J} (w : j = j') :
    eqToHom (by simp [w]) ≫ biproduct.ι f j' = biproduct.ι f j

CategoryTheory.eqToHom ⋯ ≫ CategoryTheory.Limits.biproduct.ι f j' = CategoryTheory.Limits.biproduct.ι f j


/-- The ring isomorphism between multivariable polynomials in a single variable and
polynomials over the ground ring.
-/
@[simps]
def pUnitAlgEquiv : MvPolynomial PUnit R ≃ₐ[R] R[X]

(R : Type u)
[CommSemiring R]
(p : R[X])

(MvPolynomial.pUnitAlgEquiv R).symm p = Polynomial.eval₂ MvPolynomial.C (MvPolynomial.X PUnit.unit) p


theorem extract.go₁_cons_addChar (c : Char) (cs : List Char) (b e : Pos) :
    go₁ (c :: cs) 0 (b + c) (e + c) = go₁ cs 0 b e

(c : Char)
(cs : List Char)
(b e : String.Pos)

String.extract.go₁ (c :: cs) 0 (b + c) (e + c) = String.extract.go₁ cs 0 b e


theorem map_comap_eq_of_surjective (S : L.Substructure N) : (S.comap f).map f = S

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{f : L.Hom M N}
(hf : Function.Surjective ⇑f)
(S : L.Substructure N)

FirstOrder.Language.Substructure.map f (FirstOrder.Language.Substructure.comap f S) = S


theorem T_add_one (n : ℤ) : T R (n + 1) = 2 * X * T R n - T R (n - 1)

Polynomial.Chebyshev.T R (n + 1) = 2 * Polynomial.X * Polynomial.Chebyshev.T R n - Polynomial.Chebyshev.T R (n - 1)


theorem eval₂_eq_smeval (R : Type*) [Semiring R] {S : Type*} [Semiring S] (f : R →+* S) (p : R[X])
    (x : S) : letI : Module R S := RingHom.toModule f
    p.eval₂ f x = p.smeval x

(R : Type u_3)
[Semiring R]
{S : Type u_4}
[Semiring S]
(f : R →+* S)
(p : Polynomial R)
(x : S)


/-- **The Hahn decomposition theorem**: Given a signed measure `s`, there exist
complement measurable sets `i` and `j` such that `i` is positive, `j` is negative. -/
theorem exists_isCompl_positive_negative (s : SignedMeasure α) :
    ∃ i j : Set α, MeasurableSet i ∧ 0 ≤[i] s ∧ MeasurableSet j ∧ s ≤[j] 0 ∧ IsCompl i j

{α : Type u_1}
[MeasurableSpace α]
(s : MeasureTheory.SignedMeasure α)

∃ i j,
  MeasurableSet i ∧
    MeasureTheory.VectorMeasure.restrict 0 i ≤ MeasureTheory.VectorMeasure.restrict s i ∧
      MeasurableSet j ∧
        MeasureTheory.VectorMeasure.restrict s j ≤ MeasureTheory.VectorMeasure.restrict 0 j ∧ IsCompl i j


theorem domRestrict₂_apply (f : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P) (q : Submodule S N) (x : M) (y : q) :
    f.domRestrict₂ q x y = f x y

{R : Type u_1}
[Semiring R]
{S : Type u_2}
[Semiring S]
{R₂ : Type u_3}
[Semiring R₂]
{S₂ : Type u_4}
[Semiring S₂]
{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module S N]
[Module R₂ P]
[Module S₂ P]
[SMulCommClass S₂ R₂ P]
{ρ₁₂ : R →+* R₂}
{σ₁₂ : S →+* S₂}
(f : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P)
(q : Submodule S N)
(x : M)
(y : ↥q)


theorem blsub_eq_of_brange_eq {o o'} {f : ∀ a < o, Ordinal} {g : ∀ a < o', Ordinal}
    (h : { o | ∃ i hi, f i hi = o } = { o | ∃ i hi, g i hi = o }) :
    blsub.{u, max v w} o f = blsub.{v, max u w} o' g

{f : (a : Ordinal.{u}) → a < o → Ordinal.{max (max u v) w}}

{g : (a : Ordinal.{v}) → a < o' → Ordinal.{max (max u v) w}}


@[simp]
theorem walkingParallelPairOp_one : walkingParallelPairOp.obj one = op zero

CategoryTheory.Limits.walkingParallelPairOp.obj CategoryTheory.Limits.WalkingParallelPair.one =
  Opposite.op CategoryTheory.Limits.WalkingParallelPair.zero


/-- The same-universe version of `Algebra.lift_rank_le_of_injective_injective`. -/
theorem rank_le_of_injective_injective
    (i : R' →+* R) (j : S →+* S') (hi : Injective i) (hj : Injective j)
    (hc : (j.comp (algebraMap R S)).comp i = algebraMap R' S') :
    Module.rank R S ≤ Module.rank R' S'


@[simp]
theorem toFinsupp_mul (a b : R[X]) : (a * b).toFinsupp = a.toFinsupp * b.toFinsupp


theorem HasStrictDerivAt.complexToReal_fderiv' {f : ℂ → E} {x : ℂ} {f' : E}
    (h : HasStrictDerivAt f f' x) :
    HasStrictFDerivAt f (reCLM.smulRight f' + I • imCLM.smulRight f') x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : ℂ → E}
{x : ℂ}
{f' : E}
(h : HasStrictDerivAt f f' x)

HasStrictFDerivAt f (Complex.reCLM.smulRight f' + Complex.I • Complex.imCLM.smulRight f') x


@[simp] theorem toBaseChange_ofBaseChange (Q : QuadraticForm R V) (x : A ⊗[R] CliffordAlgebra Q) :
    toBaseChange A Q (ofBaseChange A Q x) = x

{R : Type u_1}
(A : Type u_2)
{V : Type u_3}
[CommRing R]
[CommRing A]
[AddCommGroup V]
[Algebra R A]
[Module R V]
[Invertible 2]
(Q : QuadraticForm R V)
(x : A ⊗[R] CliffordAlgebra Q)

(CliffordAlgebra.toBaseChange A Q) ((CliffordAlgebra.ofBaseChange A Q) x) = x


theorem FiberBundle.writtenInExtChartAt_trivializationAt_symm {x : TotalSpace F E} {y}
    (hy : y ∈ (extChartAt (IB.prod 𝓘(𝕜, F)) x).target) :
    writtenInExtChartAt (IB.prod 𝓘(𝕜, F)) (IB.prod 𝓘(𝕜, F)) (trivializationAt F E x.proj x)
      (trivializationAt F E x.proj).toPartialHomeomorph.symm y = y

[TopologicalSpace (Bundle.TotalSpace F E)]

writtenInExtChartAt (IB.prod 𝓘(𝕜, F)) (IB.prod 𝓘(𝕜, F)) (↑(trivializationAt F E x.proj) x)
    (↑(trivializationAt F E x.proj).symm) y =
  y


theorem is_decending_rev_series_of_is_ascending {H : ℕ → Subgroup G} {n : ℕ} (hn : H n = ⊤)
    (hasc : IsAscendingCentralSeries H) : IsDescendingCentralSeries fun m : ℕ => H (n - m)

(G : Type u_1)
[Group G]
{H : ℕ → Subgroup G}
{n : ℕ}
(hn : H n = ⊤)
(hasc : IsAscendingCentralSeries H)

IsDescendingCentralSeries fun m => H (n - m)


@[simp]
theorem toIcoDiv_sub' (a b : α) : toIcoDiv hp (a - p) b = toIcoDiv hp a b + 1

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


/-- The topology of the Lévy-Prokhorov metric on probability measures on a separable space
coincides with the topology of convergence in distribution. -/
theorem levyProkhorov_eq_convergenceInDistribution :
    (inferInstance : TopologicalSpace (ProbabilityMeasure Ω))
      = TopologicalSpace.coinduced (LevyProkhorov.toProbabilityMeasure (Ω := Ω)) inferInstance

{Ω : Type u_2}
[PseudoMetricSpace Ω]
[TopologicalSpace.SeparableSpace Ω]
[MeasurableSpace Ω]
[OpensMeasurableSpace Ω]

inferInstance = TopologicalSpace.coinduced MeasureTheory.LevyProkhorov.toProbabilityMeasure inferInstance


/-- The second part of the third simplicial identity -/
@[reassoc]
theorem δ_comp_σ_succ {n} {i : Fin (n + 1)} : X.σ i ≫ X.δ i.succ = 𝟙 _

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(X : CategoryTheory.SimplicialObject C)
{n : ℕ}
{i : Fin (n + 1)}

X.σ i ≫ X.δ i.succ = 𝟙 (X.obj (Opposite.op (SimplexCategory.mk n)))


lemma not_mem_uIcc_of_lt (ha : c < a) (hb : c < b) : c ∉ [[a, b]]

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


theorem IsUpperSet.mem_interior_of_forall_lt (hs : IsUpperSet s) (hx : x ∈ closure s)
    (h : ∀ i, x i < y i) : y ∈ interior s

{ι : Type u_2}
[Finite ι]
{s : Set (ι → ℝ)}
{x y : ι → ℝ}
(hs : IsUpperSet s)
(hx : x ∈ closure s)
(h : ∀ (i : ι), x i < y i)


@[simp, rclike_simps]
theorem re_add_im (z : K) : (re z : K) + im z * I = z

↑(RCLike.re z) + ↑(RCLike.im z) * RCLike.I = z


/-- A cone morphism between two cones for the same diagram is a morphism of the cone points which
commutes with the cone legs. -/
structure ConeMorphism (A B : Cone F) where
  /-- A morphism between the two vertex objects of the cones -/
  hom : A.pt ⟶ B.pt
  /-- The triangle consisting of the two natural transformations and `hom` commutes -/
  w : ∀ j : J, hom ≫ B.π.app j = A.π.app j := by aesop_cat

(self : CategoryTheory.Limits.ConeMorphism A B)


/-- For a pair of functors `L : C ⥤ D`, `R : D ⥤ C`, an adjunction `h : L ⊣ R` induces a comonad on
the category `D`.
-/
-- Porting note: Specifying simps projections manually to match mathlib3 behavior.
@[simps coe ε δ]
def toComonad (h : L ⊣ R) : Comonad D

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{L : CategoryTheory.Functor C D}
{R : CategoryTheory.Functor D C}
(h : L ⊣ R)


theorem reflTransGen_of_transitive_reflexive {r' : α → α → Prop} (hr : Reflexive r)
    (ht : Transitive r) (h : ∀ a b, r' a b → r a b) (h' : ReflTransGen r' a b) : r a b

{α : Type u_1}
{r : α → α → Prop}
{a b : α}
{r' : α → α → Prop}
(hr : Reflexive r)
(ht : Transitive r)
(h : ∀ (a b : α), r' a b → r a b)
(h' : Relation.ReflTransGen r' a b)


@[simp]
theorem ceil_eq_self_of_mem (m : E) (h : m ∈ span ℤ (Set.range b)) : (ceil b m : E) = m

(h : m ∈ Submodule.span ℤ (Set.range ⇑b))


@[simp]
theorem map_restriction {R : Type u} [CommRing R] (p : R[X]) :
    p.restriction.map (algebraMap _ _) = p

Polynomial.map (algebraMap (↥(Subring.closure ↑p.coeffs)) R) p.restriction = p


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

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


/-- Factoring through the coimage is a strong epi-mono factorisation. -/
@[simps]
def coimageStrongEpiMonoFactorisation : StrongEpiMonoFactorisation f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
{P Q : C}
(f : P ⟶ Q)

(CategoryTheory.Abelian.coimageStrongEpiMonoFactorisation f).I = CategoryTheory.Abelian.coimage f


theorem summable_norm_sum_mul_range_of_summable_norm {f g : ℕ → R} (hf : Summable fun x => ‖f x‖)
    (hg : Summable fun x => ‖g x‖) : Summable fun n => ‖∑ k ∈ range (n + 1), f k * g (n - k)‖

{R : Type u_1}
[NormedRing R]
{f g : ℕ → R}
(hf : Summable fun x => ‖f x‖)
(hg : Summable fun x => ‖g x‖)

Summable fun n => ‖∑ k ∈ Finset.range (n + 1), f k * g (n - k)‖


/-- If a reflexive relation `r : α → α → Prop` holds over `x y : α`,
then it holds whether or not `x ≠ y`. Unlike `Reflexive.ne_imp_iff`, this uses `[IsRefl α r]`. -/
theorem reflexive_ne_imp_iff [IsRefl α r] {x y : α} : x ≠ y → r x y ↔ r x y

{α : Type u_1}
{r : α → α → Prop}
[IsRefl α r]
{x y : α}


theorem append_assoc (s₁ s₂ s₃ : String) : (s₁ ++ s₂) ++ s₃ = s₁ ++ (s₂ ++ s₃)


/-- The group homomorphism from `RingAut R` to `RingAut k` where `k`
is the residue field of `R`. -/
@[simps]
def mapAut : RingAut R →* RingAut (LocalRing.ResidueField R)

{R : Type u_1}
[CommRing R]
[LocalRing R]
(f : R ≃+* R)

LocalRing.ResidueField.mapAut f = LocalRing.ResidueField.mapEquiv f


@[simp]
theorem coe_star (u : Rˣ) : ↑(star u) = (star ↑u : R)

{R : Type u}
[Monoid R]
[StarMul R]
(u : Rˣ)


@[deprecated (since := "2024-06-12")]
theorem permutations'Aux_get_zero (s : List α) (x : α)
    (hn : 0 < length (permutations'Aux x s) := (by simp)) :
    (permutations'Aux x s).get ⟨0, hn⟩ = x :: s

(hn : 0 < (List.permutations'Aux x s).length := ⋯)

(List.permutations'Aux x s).get ⟨0, hn⟩ = x :: s


theorem indexOf_le_length {a : α} {l : List α} : indexOf a l ≤ length l

{α : Type u}
[DecidableEq α]
{a : α}
{l : List α}


@[reassoc (attr := simp)]
lemma π_leftRightHomologyComparison'_ι :
    h₁.π ≫ leftRightHomologyComparison' h₁ h₂ ≫ h₂.ι = h₁.i ≫ h₂.p

CategoryTheory.CategoryStruct.comp h₁.π
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.leftRightHomologyComparison' h₁ h₂) h₂.ι) =
  CategoryTheory.CategoryStruct.comp h₁.i h₂.p


@[to_additive]
theorem pow_subset_pow (hst : s ⊆ t) : ∀ n : ℕ, s ^ n ⊆ t ^ n

{α : Type u_2}
[DecidableEq α]
[Monoid α]
{s t : Finset α}
(hst : s ⊆ t)
(n : ℕ)


@[simp]
protected theorem diff (hs : NullMeasurableSet s μ) (ht : NullMeasurableSet t μ) :
    NullMeasurableSet (s \ t) μ

(hs : MeasureTheory.NullMeasurableSet s μ)

(ht : MeasureTheory.NullMeasurableSet t μ)

MeasureTheory.NullMeasurableSet (s \ t) μ


@[simp]
theorem lcm_dedup (s : Multiset α) : (dedup s).lcm = s.lcm

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
[DecidableEq α]
(s : Multiset α)


@[simp]
theorem pderiv_monomial {i : σ} :
    pderiv i (monomial s a) = monomial (s - single i 1) (a * s i)

{R : Type u}
{σ : Type v}
{a : R}
{s : σ →₀ ℕ}
[CommSemiring R]
{i : σ}

(MvPolynomial.pderiv i) ((MvPolynomial.monomial s) a) = (MvPolynomial.monomial (s - Finsupp.single i 1)) (a * ↑(s i))


lemma IsLowerSet.sdiff (hs : IsLowerSet s) (ht : ∀ b ∈ s, ∀ c ∈ t, c ≤ b → b ∈ t) :
    IsLowerSet (s \ t)

{α : Type u_1}
[LE α]
{s t : Set α}
(hs : IsLowerSet s)
(ht : ∀ b ∈ s, ∀ c ∈ t, c ≤ b → b ∈ t)


/-- ```
 X ⊞ Y --fst--> X
   |            |
  snd           0
   |            |
   v            v
   Y -----0---> 0
```
is a bicartesian square.
-/
@[simp]
theorem of_has_biproduct₁ [HasBinaryBiproduct X Y] :
    BicartesianSq biprod.fst biprod.snd (0 : X ⟶ 0) (0 : Y ⟶ 0)

CategoryTheory.BicartesianSq CategoryTheory.Limits.biprod.fst CategoryTheory.Limits.biprod.snd 0 0


/-- For a reflective functor `i` (with left adjoint `L`), with unit `η`, we have `η_iL = iL η`.
-/
theorem unit_obj_eq_map_unit [Reflective i] (X : C) :
    (reflectorAdjunction i).unit.app (i.obj ((reflector i).obj X)) =
      i.map ((reflector i).map ((reflectorAdjunction i).unit.app X))

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

(CategoryTheory.reflectorAdjunction i).unit.app (i.obj ((CategoryTheory.reflector i).obj X)) =
  i.map ((CategoryTheory.reflector i).map ((CategoryTheory.reflectorAdjunction i).unit.app X))


lemma mor₁_eq_zero_iff_epi₃ : T.mor₁ = 0 ↔ Epi T.mor₃

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


@[simp]
theorem coe_comp (g : P₂ →ᵃⁱ[𝕜] P₃) (f : P →ᵃⁱ[𝕜] P₂) : ⇑(g.comp f) = g ∘ f

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


/-- The isomorphism `S₁.leftHomology ≅ S₂.leftHomology` induced by an isomorphism of
short complexes `S₁ ≅ S₂`. -/
@[simps]
noncomputable def leftHomologyMapIso (e : S₁ ≅ S₂) [S₁.HasLeftHomology]
    [S₂.HasLeftHomology] : S₁.leftHomology ≅ S₂.leftHomology

(CategoryTheory.ShortComplex.leftHomologyMapIso e).hom = CategoryTheory.ShortComplex.leftHomologyMap e.hom


lemma eq_of_dvd_of_div_eq_one (hab : a ∣ b) (h : b / a = 1) : a = b


theorem seqLeft_eq_bind [Monad m] [LawfulMonad m] (x : m α) (y : m β) : x <* y = x >>= fun a => y >>= fun _ => pure a

{m : Type u_1 → Type u_2}
{α β : Type u_1}
[Monad m]
[LawfulMonad m]
(x : m α)
(y : m β)

(SeqLeft.seqLeft x fun x => y) = do
  let a ← x
  let _ ← y
  pure a


@[to_additive (attr := simp)]
theorem lift_of (x) : lift f (of x) = f x

{α : Type u}
{β : Type v}
[Add β]
(f : α → β)
(x : α)

(FreeAddMagma.lift f) (FreeAddMagma.of x) = f x


@[simp]
theorem apply_wcovBy_apply_iff {E : Type*} [EquivLike E α β] [OrderIsoClass E α β] (e : E) :
    e a ⩿ e b ↔ a ⩿ b

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{a b : α}
{E : Type u_3}
[EquivLike E α β]
[OrderIsoClass E α β]
(e : E)


theorem mod_mul_right_mod (a b c : ℤ) : a % (b * c) % b = a % b


theorem mul_comp (g₁ g₂ : β →*₀o γ) (f : α →*₀o β) : (g₁ * g₂).comp f = g₁.comp f * g₂.comp f

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[LinearOrderedCommMonoidWithZero α]
[LinearOrderedCommMonoidWithZero β]
[LinearOrderedCommMonoidWithZero γ]
(g₁ g₂ : β →*₀o γ)
(f : α →*₀o β)


lemma CFC.spectrum_algebraMap_subset (r : R) : spectrum R (algebraMap R A r) ⊆ {r}

{R : Type u_1}
{A : Type u_2}
{p : A → Prop}
[CommSemiring R]
[StarRing R]
[MetricSpace R]
[TopologicalSemiring R]
[ContinuousStar R]
[TopologicalSpace A]
[Ring A]
[StarRing A]
[Algebra R A]
[ContinuousFunctionalCalculus R p]
(r : R)


@[simp]
theorem coe_mk' (f : M₁ →ₛₗ[σ₁₂] M₂) (h) : (mk f h : M₁ → M₂) = f

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
(f : M₁ →ₛₗ[σ₁₂] M₂)
(h : Continuous f.toFun)


@[simp]
theorem lmul'_apply_tmul (a b : S) : lmul' (S := S) R (a ⊗ₜ[R] b) = a * b

{R : Type uR}
{S : Type uS}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
(a b : S)

(Algebra.TensorProduct.lmul' R) (a ⊗ₜ[R] b) = a * b


lemma isNilpotent_pow_X_mul_C_of_isNilpotent (n : ℕ) (hnil : IsNilpotent r) :
    IsNilpotent (X ^ n * (C r))

{R : Type u_1}
{r : R}
[Semiring R]
(n : ℕ)
(hnil : IsNilpotent r)

IsNilpotent (Polynomial.X ^ n * Polynomial.C r)


@[to_additive nsmul_pos]
theorem one_lt_pow' {a : M} (ha : 1 < a) {k : ℕ} (hk : k ≠ 0) : 1 < a ^ k

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


theorem closure_of_rat_image_lt {q : ℚ} :
    closure (((↑) : ℚ → ℝ) '' { x | q < x }) = { r | ↑q ≤ r }

closure (Rat.cast '' {x | q < x}) = {r | ↑q ≤ r}


@[simp, norm_cast]
protected theorem coe_coe (φ : characterSpace 𝕜 A) : ⇑(φ : WeakDual 𝕜 A) = (φ : A → 𝕜)

{𝕜 : Type u_1}
{A : Type u_2}
[CommSemiring 𝕜]
[TopologicalSpace 𝕜]
[ContinuousAdd 𝕜]
[ContinuousConstSMul 𝕜 𝕜]
[NonUnitalNonAssocSemiring A]
[TopologicalSpace A]
[Module 𝕜 A]
(φ : ↑(WeakDual.characterSpace 𝕜 A))


lemma neg_pred (a : ℤ) : -pred a = succ (-a)


theorem im_exp (q : ℍ[ℝ]) : (exp ℝ q).im = (exp ℝ q.re * (Real.sin ‖q.im‖ / ‖q.im‖)) • q.im

(NormedSpace.exp ℝ q).im = (NormedSpace.exp ℝ q.re * (Real.sin ‖q.im‖ / ‖q.im‖)) • q.im


/-- The minimal polynomial of an element `x` of `E / F` of exponential characteristic `q` has
separable degree one if and only if `x ^ (q ^ n) ∈ F` for some `n : ℕ`. -/
theorem natSepDegree_eq_one_iff_pow_mem : (minpoly F x).natSepDegree = 1 ↔
    ∃ n : ℕ, x ^ q ^ n ∈ (algebraMap F E).range

{F : Type u}
{E : Type v}
[Field F]
[Field E]
[Algebra F E]
(q : ℕ)
[hF : ExpChar F q]
{x : E}

(minpoly F x).natSepDegree = 1 ↔ ∃ n, x ^ q ^ n ∈ (algebraMap F E).range


theorem restrict_apply_le (s t : Set α) : μ.restrict s t ≤ μ t

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(s t : Set α)


/-- Lebesgue integral against the composition-product of two kernels. -/
theorem lintegral_compProd' (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) {f : β → γ → ℝ≥0∞} (hf : Measurable (Function.uncurry f)) :
    ∫⁻ bc, f bc.1 bc.2 ∂(κ ⊗ₖ η) a = ∫⁻ b, ∫⁻ c, f b c ∂η (a, b) ∂κ a

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

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

∫⁻ (bc : β × γ), f bc.1 bc.2 ∂(κ.compProd η) a = ∫⁻ (b : β), ∫⁻ (c : γ), f b c ∂η (a, b) ∂κ a


@[reassoc]
lemma liftCycles_leftHomologyπ_eq_zero_of_boundary (x : A ⟶ S.X₁) (hx : k = x ≫ S.f) :
    S.liftCycles k (by rw [hx, assoc, S.zero, comp_zero]) ≫ S.leftHomologyπ = 0

(hx : k = CategoryTheory.CategoryStruct.comp x S.f)

CategoryTheory.CategoryStruct.comp (S.liftCycles k ⋯) S.leftHomologyπ = 0


theorem isClosed_iff [TopologicalSpace α] (F : Realizer α) {s : Set α} :
    IsClosed s ↔ ∀ a, (∀ b, a ∈ F.F b → ∃ z, z ∈ F.F b ∩ s) → a ∈ s

{α : Type u_1}
[TopologicalSpace α]
(F : Ctop.Realizer α)
{s : Set α}

IsClosed s ↔ ∀ (a : α), (∀ (b : F.σ), a ∈ F.F.f b → ∃ z, z ∈ F.F.f b ∩ s) → a ∈ s


theorem rank_range_le (f : M →ₗ[R] M₁) : Module.rank R (LinearMap.range f) ≤ Module.rank R M

{R : Type u}
{M M₁ : Type v}
[Ring R]
[AddCommGroup M]
[AddCommGroup M₁]
[Module R M]
[Module R M₁]
(f : M →ₗ[R] M₁)

Module.rank R ↥(LinearMap.range f) ≤ Module.rank R M


/-- The determinant formula `Aₙ * Bₙ₊₁ - Bₙ * Aₙ₊₁ = (-1)^(n + 1)`. -/
theorem determinant (not_terminatedAt_n : ¬(↑s : GenContFract K).TerminatedAt n) :
    (↑s : GenContFract K).nums n * (↑s : GenContFract K).dens (n + 1) -
      (↑s : GenContFract K).dens n * (↑s : GenContFract K).nums (n + 1) = (-1) ^ (n + 1)

(not_terminatedAt_n : ¬(↑s).TerminatedAt n)


/-- If `A₁` is equivalent to `A₂` and `A₁'` is equivalent to `A₂'`, then the type of maps
`A₁ ≃ₐ[R] A₁'` is equivalent to the type of maps `A₂ ≃ ₐ[R] A₂'`.

This is the `AlgEquiv` version of `AlgEquiv.arrowCongr`. -/
@[simps apply]
def equivCongr (e : A₁ ≃ₐ[R] A₂) (e' : A₁' ≃ₐ[R] A₂') : (A₁ ≃ₐ[R] A₁') ≃ A₂ ≃ₐ[R] A₂'

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
{A₁' : Type uA₁'}
{A₂' : Type uA₂'}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Semiring A₁']
[Semiring A₂']
[Algebra R A₁]
[Algebra R A₂]
[Algebra R A₁']
[Algebra R A₂']
(e : A₁ ≃ₐ[R] A₂)
(e' : A₁' ≃ₐ[R] A₂')
(ψ : A₁ ≃ₐ[R] A₁')

(e.equivCongr e') ψ = e.symm.trans (ψ.trans e')


theorem Prime.odd_of_ne_two {p : ℕ} (hp : p.Prime) (h_two : p ≠ 2) : Odd p

{p : ℕ}
(hp : Nat.Prime p)
(h_two : p ≠ 2)


@[to_additive]
theorem map_eq_comap_of_inverse {f : G →* N} {g : N →* G} (hl : Function.LeftInverse g f)
    (hr : Function.RightInverse g f) (H : Subgroup G) : map f H = comap g H

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{f : G →+ N}
{g : N →+ G}
(hl : Function.LeftInverse ⇑g ⇑f)
(hr : Function.RightInverse ⇑g ⇑f)
(H : AddSubgroup G)

AddSubgroup.map f H = AddSubgroup.comap g H


@[to_additive (attr := simp)]
theorem unbot_one' (d : α) : (1 : WithBot α).unbot' d = 1


@[simp]
theorem star_neg [AddGroup R] [StarAddMonoid R] (r : R) : star (-r) = -star r

{R : Type u}
[AddGroup R]
[StarAddMonoid R]
(r : R)


@[to_additive (attr := simp)]
theorem toLex_one [One α] : toLex (1 : α) = 1


protected theorem dist_triangle (x y z : ∀ n, E n) : dist x z ≤ dist x y + dist y z

{E : ℕ → Type u_1}
(x y z : (n : ℕ) → E n)


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

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

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


@[simp]
theorem quot_left_distrib (x y z : PGame) : (⟦x * (y + z)⟧ : Game) = ⟦x * y⟧ + ⟦x * z⟧


@[field_simps]
theorem divp_eq_divp_iff {x y : α} {ux uy : αˣ} : x /ₚ ux = y /ₚ uy ↔ x * uy = y * ux

{α : Type u}
[CommMonoid α]
{x y : α}
{ux uy : αˣ}


@[to_additive]
lemma pow_injOn_Iio_orderOf : (Set.Iio <| orderOf x).InjOn (x ^ ·)

Set.InjOn (fun x_1 => x ^ x_1) (Set.Iio (orderOf x))


theorem interior_preimage_re (s : Set ℝ) : interior (re ⁻¹' s) = re ⁻¹' interior s

interior (Complex.re ⁻¹' s) = Complex.re ⁻¹' interior s


@[simp]
theorem fold_sup_univ [SemilatticeSup α] [OrderTop α] (a : α) :
    -- Porting note: added `haveI`
    haveI : Std.Commutative (α := α) (· ⊔ ·) := inferInstance
    (Finset.univ.fold (· ⊔ ·) a fun x => x) = ⊤

{α : Type u_2}
[Fintype α]
[SemilatticeSup α]
[OrderTop α]
(a : α)

Finset.fold (fun x x_1 => x ⊔ x_1) a (fun x => x) Finset.univ = ⊤


theorem of_epi {X Y : C} (f : X ⟶ Y) [Epi f] (i : IsZero X) : IsZero Y


theorem le_add_order_smul_norm_of_isOfFinAddOrder {u : AddCircle p} (hu : IsOfFinAddOrder u)
    (hu' : u ≠ 0) : p ≤ addOrderOf u • ‖u‖

{p : ℝ}
[hp : Fact (0 < p)]
{u : AddCircle p}
(hu : IsOfFinAddOrder u)
(hu' : u ≠ 0)


lemma iIndepSets.meas_biInter (h : iIndepSets π κ μ) (s : Finset ι)
    {f : ι → Set Ω} (hf : ∀ i, i ∈ s → f i ∈ π i) :
    ∀ᵐ a ∂μ, κ a (⋂ i ∈ s, f i) = ∏ i ∈ s, κ a (f i)

(h : ProbabilityTheory.Kernel.iIndepSets π κ μ)

∀ᵐ (a : α) ∂μ, (κ a) (⋂ i ∈ s, f i) = ∏ i ∈ s, (κ a) (f i)


/-- See note [partially-applied ext lemmas]. -/
@[ext]
theorem hom_ext {f g : ExteriorAlgebra R M →ₐ[R] A}
    (h : f.toLinearMap.comp (ι R) = g.toLinearMap.comp (ι R)) : f = g

(h : f.toLinearMap ∘ₗ ExteriorAlgebra.ι R = g.toLinearMap ∘ₗ ExteriorAlgebra.ι R)


/-- The **Dyson e-transform**. Turns `(s, t)` into `(s ∪ e • t, t ∩ e⁻¹ • s)`. This reduces the
product of the two sets. -/
@[to_additive (attr := simps) "The **Dyson e-transform**.
Turns `(s, t)` into `(s ∪ e +ᵥ t, t ∩ -e +ᵥ s)`. This reduces the sum of the two sets."]
def mulDysonETransform : Finset α × Finset α

{α : Type u_1}
[DecidableEq α]
[CommGroup α]
(e : α)
(x : Finset α × Finset α)

(Finset.mulDysonETransform e x).1 = x.1 ∪ e • x.2


theorem upcrossingsBefore_le (f : ℕ → Ω → ℝ) (ω : Ω) (hab : a < b) :
    upcrossingsBefore a b f N ω ≤ N

{Ω : Type u_1}
{a b : ℝ}
{N : ℕ}
(f : ℕ → Ω → ℝ)
(ω : Ω)
(hab : a < b)

MeasureTheory.upcrossingsBefore a b f N ω ≤ N


theorem piPremeasure_pi' {s : ∀ i, Set (α i)} : piPremeasure m (pi univ s) = ∏ i, m i (s i)

{m : (i : ι) → MeasureTheory.OuterMeasure (α i)}

MeasureTheory.piPremeasure m (Set.univ.pi s) = ∏ i : ι, (m i) (s i)


@[simp]
theorem symm_apply_apply (e : L₁ ≃ₗ⁅R⁆ L₂) : ∀ x, e.symm (e x) = x

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


/-- Construct a `MonoOver X`. -/
@[simps]
def mk' {X A : C} (f : A ⟶ X) [hf : Mono f] : MonoOver X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X A : C}
(f : A ⟶ X)
[hf : CategoryTheory.Mono f]

(CategoryTheory.MonoOver.mk' f).obj = CategoryTheory.Over.mk f


theorem covBy_iff_wcovBy_and_not_le : a ⋖ b ↔ a ⩿ b ∧ ¬b ≤ a

a ⋖ b ↔ a ⩿ b ∧ ¬b ≤ a


@[simp]
theorem degree_eq_bot_iff {f : R[T;T⁻¹]} : f.degree = ⊥ ↔ f = 0

{R : Type u_1}
[Semiring R]
{f : R[T;T⁻¹]}


lemma castSucc_injective (n : ℕ) : Injective (@Fin.castSucc n)


theorem mem_nhdsSet_interior : s ∈ 𝓝ˢ (interior s)

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


@[simp]
theorem basis_repr_stdBasis [DecidableEq η] (s : ∀ j, Basis (ιs j) R (Ms j)) (j i) :
    (Pi.basis s).repr (stdBasis R _ j (s j i)) = Finsupp.single ⟨j, i⟩ 1

{R : Type u_1}
{η : Type u_2}
{ιs : η → Type u_3}
{Ms : η → Type u_4}
[Semiring R]
[(i : η) → AddCommMonoid (Ms i)]
[(i : η) → Module R (Ms i)]
[Fintype η]
[DecidableEq η]
(s : (j : η) → Basis (ιs j) R (Ms j))
(j : η)
(i : ιs j)

(Pi.basis s).repr ((LinearMap.stdBasis R Ms j) ((s j) i)) = Finsupp.single ⟨j, i⟩ 1


theorem InjOn.congr (h₁ : InjOn f₁ s) (h : EqOn f₁ f₂ s) : InjOn f₂ s

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{f₁ f₂ : α → β}
(h₁ : Set.InjOn f₁ s)
(h : Set.EqOn f₁ f₂ s)


theorem fval_ex (F A : Class.{u}) : F ′ A ∈ univ.{u}


@[simp]
theorem map₂'_mk'' (f : α → β → γ) (h) (x : α) :
    (Quotient.mk'' x : Quotient s₁).map₂' f h =
      (Quotient.map' (f x) (h (Setoid.refl x)) : Quotient s₂ → Quotient s₃)

(f : α → β → γ)

(h : (Setoid.r ⇒ Setoid.r ⇒ Setoid.r) f f)

Quotient.map₂' f h (Quotient.mk'' x) = Quotient.map' (f x) ⋯


/-- For a pair of functors `L : C ⥤ D`, `R : D ⥤ C`, an adjunction `h : L ⊣ R` induces a monad on
the category `C`.
-/
-- Porting note: Specifying simps projections manually to match mathlib3 behavior.
@[simps! coe η μ]
def toMonad (h : L ⊣ R) : Monad C

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{L : CategoryTheory.Functor C D}
{R : CategoryTheory.Functor D C}
(h : L ⊣ R)


/-- The ring isomorphism between the stalk of the structure sheaf of `R` at a point `p`
corresponding to a prime ideal in `R` and the localization of `R` at `p`. -/
@[simps]
def stalkIso (x : PrimeSpectrum.Top R) :
    (structureSheaf R).presheaf.stalk x ≅ CommRingCat.of (Localization.AtPrime x.asIdeal)

(x : ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

(AlgebraicGeometry.StructureSheaf.stalkIso R x).inv = AlgebraicGeometry.StructureSheaf.localizationToStalk R x


theorem coe_addEquiv_lpPiLp_symm (f : PiLp p E) :
    (AddEquiv.lpPiLp.symm f : ∀ i, E i) = f

{α : Type u_1}
{E : α → Type u_2}
[(i : α) → NormedAddCommGroup (E i)]
{p : ℝ≥0∞}
[Finite α]
(f : PiLp p E)


/-- Functoriality maps for `ComposableArrows.sc`. -/
@[simps!]
def scMap {S₁ S₂ : ComposableArrows C n} (φ : S₁ ⟶ S₂) (h₁ : S₁.IsComplex) (h₂ : S₂.IsComplex)
    (i : ℕ) (hi : i + 2 ≤ n := by omega) :
    S₁.sc h₁ i ⟶ S₂.sc h₂ i

{S₁ S₂ : CategoryTheory.ComposableArrows C n}

(CategoryTheory.ComposableArrows.scMap φ h₁ h₂ i hi).τ₂ = φ.app ⟨i + 1, ⋯⟩


@[simp 1100, norm_cast] lemma coe_ssubset_coe : (s : Set α) ⊂ t ↔ t < s

{α : Type u_1}
[LE α]
{s t : UpperSet α}


theorem rpow_add {x : ℝ≥0∞} (y z : ℝ) (hx : x ≠ 0) (h'x : x ≠ ⊤) : x ^ (y + z) = x ^ y * x ^ z


theorem DifferentiableAt.hasFDerivAt (h : DifferentiableAt 𝕜 f x) :
    HasFDerivAt f (fderiv 𝕜 f x) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
(h : DifferentiableAt 𝕜 f x)


theorem rootsOfUnity.integer_power_of_ringEquiv' (g : L ≃+* L) :
    ∃ m : ℤ, ∀ t ∈ rootsOfUnity n L, g (t : Lˣ) = (t ^ m : Lˣ)

{L : Type u}
[CommRing L]
[IsDomain L]
(n : ℕ+)
(g : L ≃+* L)

∃ m, ∀ t ∈ rootsOfUnity n L, g ↑t = ↑(t ^ m)


/-- A `C^n` local diffeomorphism on `s` is `C^n` on `s`. -/
lemma IsLocalDiffeomorphOn.contMDiffOn (hf : IsLocalDiffeomorphOn I J n f s) :
    ContMDiffOn I J n f s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_4}
[TopologicalSpace H]
{G : Type u_5}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_6}
[TopologicalSpace M]
[ChartedSpace H M]
{N : Type u_7}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}
{f : M → N}
{s : Set M}
(hf : IsLocalDiffeomorphOn I J n f s)


@[to_additive]
theorem eq_one_div_of_mul_eq_one_left (h : b * a = 1) : b = 1 / a

{α : Type u_1}
[SubtractionMonoid α]
{a b : α}
(h : b + a = 0)


@[simp]
theorem count_zero (hp : Irreducible p) : count p (0 : FactorSet α) = 0

[(p : Associates α) → Decidable (Irreducible p)]


/-- If `f : M₁ →⋆ M₂` is surjective, then the exponent of `M₂` divides the exponent of `M₁`. -/
@[to_additive]
theorem MonoidHom.exponent_dvd {F M₁ M₂ : Type*} [Monoid M₁] [Monoid M₂]
    [FunLike F M₁ M₂] [MonoidHomClass F M₁ M₂]
    {f : F} (hf : Function.Surjective f) : exponent M₂ ∣ exponent M₁

{F : Type u_1}
{M₁ : Type u_2}
{M₂ : Type u_3}
[Monoid M₁]
[Monoid M₂]
[FunLike F M₁ M₂]
[MonoidHomClass F M₁ M₂]
{f : F}
(hf : Function.Surjective ⇑f)


/-- The equivalence of functor categories given by currying/uncurrying.
-/
@[simps!]
def currying : C ⥤ D ⥤ E ≌ C × D ⥤ E

(F : CategoryTheory.Functor C (CategoryTheory.Functor D E))

(CategoryTheory.currying.functor.obj F).obj X = (F.obj X.1).obj X.2


lemma coprimes_lt (a : Fin m → ℕ) (i) : a i < coprimes a i


@[to_additive]
lemma _root_.map_multiset_prod [FunLike F α β] [MonoidHomClass F α β] (f : F) (s : Multiset α) :
    f s.prod = (s.map f).prod

{F : Type u_1}
{α : Type u_3}
{β : Type u_4}
[AddCommMonoid α]
[AddCommMonoid β]
[FunLike F α β]
[AddMonoidHomClass F α β]
(f : F)
(s : Multiset α)


theorem le_trailingDegree_mul : p.trailingDegree + q.trailingDegree ≤ (p * q).trailingDegree


@[to_additive (attr := simp)]
theorem Monoid.fg_iff_submonoid_fg (N : Submonoid M) : Monoid.FG N ↔ N.FG

{M : Type u_1}
[AddMonoid M]
(N : AddSubmonoid M)


@[simp]
theorem logb_neg_eq_logb (x : ℝ) : logb b (-x) = logb b x


@[to_additive]
theorem coe_subgroupOf (H K : Subgroup G) : (H.subgroupOf K : Set K) = K.subtype ⁻¹' H

{G : Type u_1}
[AddGroup G]
(H K : AddSubgroup G)

↑(H.addSubgroupOf K) = ⇑K.subtype ⁻¹' ↑H


theorem RelIso.preimage_eq_image_symm (e : r ≃r s) (t : Set β) : e ⁻¹' t = e.symm '' t

{α : Type u_5}
{β : Type u_6}
{r : α → α → Prop}
{s : β → β → Prop}
(e : r ≃r s)
(t : Set β)


/-- Coercion from `Subgraph G` to `SimpleGraph V`.  If `G'` is a spanning
subgraph, then `G'.spanningCoe` yields an isomorphic graph.
In general, this adds in all vertices from `V` as isolated vertices. -/
@[simps]
protected def spanningCoe (G' : Subgraph G) : SimpleGraph V

{V : Type u}
{G : SimpleGraph V}
(G' : G.Subgraph)

∀ (a a_1 : V), G'.spanningCoe.Adj a a_1 = G'.Adj a a_1


theorem dart_edge_fiber_card [DecidableEq V] (e : Sym2 V) (h : e ∈ G.edgeSet) :
    (univ.filter fun d : G.Dart => d.edge = e).card = 2

{V : Type u}
(G : SimpleGraph V)
[Fintype V]
[DecidableRel G.Adj]
[DecidableEq V]
(e : Sym2 V)
(h : e ∈ G.edgeSet)

(Finset.filter (fun d => d.edge = e) Finset.univ).card = 2


/-- We will apply the above step recursively.  The following result
 is used to ensure that the process terminates. -/
theorem step_wf (hr : u.r ≠ 0) : SizeOf.sizeOf u.step < SizeOf.sizeOf u


theorem peirce' {a : Prop} (H : ∀ b : Prop, (a → b) → a) : a

{a : Prop}
(H : ∀ (b : Prop), (a → b) → a)


/-- The colimit of a diagram `F : J ⥤ K ⥤ C` is isomorphic to the functor given by
the individual colimits on objects. -/
@[simps!]
def colimitIsoFlipCompColim [HasColimitsOfShape J C] (F : J ⥤ K ⥤ C) : colimit F ≅ F.flip ⋙ colim

(CategoryTheory.Limits.colimitIsoFlipCompColim F).inv.app X =
  (CategoryTheory.Limits.colimitObjIsoColimitCompEvaluation F X).inv


/-- A more general version of `MonoidHom.map_finprod_mem` that requires `s ∩ mulSupport f` rather
than `s` to be finite. -/
@[to_additive
      "A more general version of `AddMonoidHom.map_finsum_mem` that requires
      `s ∩ support f` rather than `s` to be finite."]
theorem MonoidHom.map_finprod_mem' {f : α → M} (g : M →* N) (h₀ : (s ∩ mulSupport f).Finite) :
    g (∏ᶠ j ∈ s, f j) = ∏ᶠ i ∈ s, g (f i)

(h₀ : (s ∩ Function.mulSupport f).Finite)


@[simp]
theorem equiv_zero : WithLp.equiv p V 0 = 0

(p : ℝ≥0∞)
{V : Type uV}
[AddCommGroup V]


theorem abv_inv (a : R) : abv a⁻¹ = (abv a)⁻¹

{S : Type u_5}
[LinearOrderedSemifield S]
{R : Type u_6}
[DivisionSemiring R]
(abv : R → S)
[IsAbsoluteValue abv]
(a : R)


@[simp]
theorem modEq_zero_iff : a ≡ b [ZMOD 0] ↔ a = b


theorem locPathConnected_of_isOpen [LocPathConnectedSpace X] {U : Set X} (h : IsOpen U) :
    LocPathConnectedSpace U

{X : Type u_1}
[TopologicalSpace X]
[LocPathConnectedSpace X]
{U : Set X}
(h : IsOpen U)


/-- Given a `p : R[X]` and a root `x : S`,
then `p.leadingCoeff • x : S` is integral over `R`. -/
theorem isIntegral_leadingCoeff_smul [Algebra R S] (h : aeval x p = 0) :
    IsIntegral R (p.leadingCoeff • x)

{R : Type u_1}
{S : Type u_4}
[CommRing R]
[CommRing S]
(p : R[X])
(x : S)
[Algebra R S]
(h : (Polynomial.aeval x) p = 0)


@[simp] theorem coe_bot : (↑(⊥ : L) : α) = ⊥

{α : Type u_1}
[CompleteLattice α]
{L : CompleteSublattice α}


theorem dist_le_of_forall {f₁ f₂ : FunSpace v} {d : ℝ} (h : ∀ t, dist (f₁ t) (f₂ t) ≤ d) :
    dist f₁ f₂ ≤ d

(h : ∀ (t : ↑(Set.Icc v.tMin v.tMax)), dist (f₁.toFun t) (f₂.toFun t) ≤ d)


protected theorem mul_left_cancel {n m k : Nat} (np : 0 < n) (h : n * m = n * k) : m = k


theorem mem_inv_pointwise_smul_iff₀ {a : α} (ha : a ≠ 0) (S : Submonoid M) (x : M) :
    x ∈ a⁻¹ • S ↔ a • x ∈ S

{α : Type u_1}
{M : Type u_3}
[Monoid M]
[GroupWithZero α]
[MulDistribMulAction α M]
{a : α}
(ha : a ≠ 0)
(S : Submonoid M)
(x : M)

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


@[simp]
theorem mem_core (x : α) (s : Set β) : x ∈ f.core s ↔ ∀ y, y ∈ f x → y ∈ s

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


theorem MeasurePreserving.integrableOn_image [MeasurableSpace β] {e : α → β} {ν}
    (h₁ : MeasurePreserving e μ ν) (h₂ : MeasurableEmbedding e) {f : β → E} {s : Set α} :
    IntegrableOn f (e '' s) ν ↔ IntegrableOn (f ∘ e) s μ

(h₁ : MeasureTheory.MeasurePreserving e μ ν)

MeasureTheory.IntegrableOn f (e '' s) ν ↔ MeasureTheory.IntegrableOn (f ∘ e) s μ


/-- The equivalence `Karoubi (HomologicalComplex C c) ≌ HomologicalComplex (Karoubi C) c`. -/
@[simps]
def karoubiHomologicalComplexEquivalence :
    Karoubi (HomologicalComplex C c) ≌ HomologicalComplex (Karoubi C) c

(C : Type u_1)
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{ι : Type u_2}
(c : ComplexShape ι)

(CategoryTheory.Idempotents.karoubiHomologicalComplexEquivalence C c).inverse =
  CategoryTheory.Idempotents.KaroubiHomologicalComplexEquivalence.inverse


@[simp]
theorem isoMk_inv_right {f g : Under X} (hr : f.right ≅ g.right) (hw : f.hom ≫ hr.hom = g.hom) :
    (isoMk hr hw).inv.right = hr.inv

(hw : CategoryTheory.CategoryStruct.comp f.hom hr.hom = g.hom)

(CategoryTheory.Under.isoMk hr hw).inv.right = hr.inv


/-- Reinterpret `Additive G ≃+ H` as `G ≃* Multiplicative H`. -/
@[simps]
def AddEquiv.toMultiplicative' [MulOneClass G] [AddZeroClass H] :
    Additive G ≃+ H ≃ (G ≃* Multiplicative H)

{G : Type u_1}
{H : Type u_2}
[MulOneClass G]
[AddZeroClass H]
(f : G ≃* Multiplicative H)
(a : H)

(AddEquiv.toMultiplicative'.symm f).symm a = (AddMonoidHom.toMultiplicative''.symm f.symm.toMonoidHom) a


@[simp]
theorem kerLiftAlg_toRingHom (f : A →ₐ[R₁] B) :
    (kerLiftAlg f : A ⧸ ker f →+* B) = RingHom.kerLift (f : A →+* B)

{R₁ : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R₁]
[CommRing A]
[Algebra R₁ A]
[Semiring B]
[Algebra R₁ B]
(f : A →ₐ[R₁] B)


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

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


theorem restrict_measure_eq (μ : FiniteMeasure Ω) (A : Set Ω) :
    (μ.restrict A : Measure Ω) = (μ : Measure Ω).restrict A

{Ω : Type u_1}
[MeasurableSpace Ω]
(μ : MeasureTheory.FiniteMeasure Ω)
(A : Set Ω)


theorem lt_iff_exists_coe_btwn [Preorder α] [DenselyOrdered α] [NoMaxOrder α] {a b : WithTop α} :
    a < b ↔ ∃ x : α, a < ↑x ∧ ↑x < b

{α : Type u_1}
[Preorder α]
[DenselyOrdered α]
[NoMaxOrder α]
{a b : WithTop α}


@[simp]
theorem AffineMap.map_midpoint (f : P →ᵃ[R] P') (a b : P) :
    f (midpoint R a b) = midpoint R (f a) (f b)

{R : Type u_1}
{V : Type u_2}
{V' : Type u_3}
{P : Type u_4}
{P' : Type u_5}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
[AddCommGroup V']
[Module R V']
[AddTorsor V' P']
(f : P →ᵃ[R] P')
(a b : P)


@[to_additive (attr := simp)] lemma mulDissociated_inv : MulDissociated s⁻¹ ↔ MulDissociated s

{α : Type u_1}
[CommGroup α]
{s : Set α}


@[simp]
theorem sdiff_sup_self (a b : α) : b \ a ⊔ a = b ⊔ a

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


@[to_additive] -- @[to_additive (attr := simp)] -- Porting note (#10618): simp can prove this
theorem aemeasurable_one [One β] : AEMeasurable (fun _ : α => (1 : β)) μ

{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
[Zero β]


theorem abs_sum_le_sum_abs {G : Type*} [LinearOrderedAddCommGroup G] (f : ι → G) (s : Finset ι) :
    |∑ i ∈ s, f i| ≤ ∑ i ∈ s, |f i|

{ι : Type u_1}
{G : Type u_9}
[LinearOrderedAddCommGroup G]
(f : ι → G)
(s : Finset ι)


theorem irreducible_sq_not_dvd_iff_eq_zero_and_no_irreducibles_or_squarefree (r : R) :
    (∀ x : R, Irreducible x → ¬x * x ∣ r) ↔ (r = 0 ∧ ∀ x : R, ¬Irreducible x) ∨ Squarefree r

{R : Type u_1}
[CommMonoidWithZero R]
[WfDvdMonoid R]
(r : R)

(∀ (x : R), Irreducible x → ¬x * x ∣ r) ↔ (r = 0 ∧ ∀ (x : R), ¬Irreducible x) ∨ Squarefree r


theorem _root_.Int.le_sub_one_of_not_le {a b : ℤ} (h : ¬b ≤ a) : a ≤ b - 1


/-- `rotateRight` equals the bit fiddling definition of `rotateRightAux` when the rotation amount is
smaller than the bitwidth. -/
theorem rotateRight_eq_rotateRightAux_of_lt {x : BitVec w} {r : Nat} (hr : r < w) :
    x.rotateRight r = x.rotateRightAux r

{w : Nat}
{x : BitVec w}
{r : Nat}
(hr : r < w)


theorem Set.Subsingleton.isPreirreducible (hs : s.Subsingleton) : IsPreirreducible s

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
(hs : s.Subsingleton)


lemma blimsup_eq_limsup {f : Filter β} {u : β → α} {p : β → Prop} :
    blimsup u f p = limsup u (f ⊓ 𝓟 {x | p x})

{α : Type u_1}
{β : Type u_2}
[ConditionallyCompleteLattice α]
{f : Filter β}
{u : β → α}
{p : β → Prop}

Filter.blimsup u f p = Filter.limsup u (f ⊓ 𝓟 {x | p x})


theorem base_mul_eq_succ {p n : ℕ} (hp : 1 < p) (hn : 0 < n) :
    p.maxPowDiv (p*n) = p.maxPowDiv n + 1


@[simp]
protected theorem inf_eq_top_iff (f : β → α) (S : Finset β) : S.inf f = ⊤ ↔ ∀ s ∈ S, f s = ⊤

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
[OrderTop α]
(f : β → α)
(S : Finset β)


theorem toIocDiv_eq_neg_floor (a b : α) : toIocDiv hp a b = -⌊(a + p - b) / p⌋

{α : Type u_1}
[LinearOrderedField α]
[FloorRing α]
{p : α}
(hp : 0 < p)
(a b : α)


theorem getElem?_inj
    (h₀ : i < xs.length) (h₁ : Nodup xs) (h₂ : xs[i]? = xs[j]?) : i = j

∀ {α : Type u_1} {xs : List α} {j : Nat}, i < xs.length → xs.Nodup → xs[i]? = xs[j]? → i = j


/-- The natural functor from `R`-coalgebras to comonoid objects in the category of `R`-modules. -/
@[simps]
def toComon : CoalgebraCat R ⥤ Comon_ (ModuleCat R)

∀ {X Y : CoalgebraCat R} (f : X ⟶ Y), ((CoalgebraCat.toComon R).map f).hom = ModuleCat.ofHom ↑f.toCoalgHom


@[mono] lemma algebraMap_strictMono : StrictMono (algebraMap α β)

{α : Type u_1}
(β : Type u_2)
[OrderedCommSemiring α]
[StrictOrderedSemiring β]
[Algebra α β]
[SMulPosStrictMono α β]


@[to_additive]
theorem mul_le_of_mul_le_left [CovariantClass α α (· * ·) (· ≤ ·)] {a b c d : α} (h : a * b ≤ c)
    (hle : d ≤ b) :
    a * d ≤ c

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


theorem archimedean_iff_nat_le : Archimedean α ↔ ∀ x : α, ∃ n : ℕ, x ≤ n


theorem symm_bijective : Function.Bijective (LieEquiv.symm : (L₁ ≃ₗ⁅R⁆ L₂) → L₂ ≃ₗ⁅R⁆ L₁)

{R : Type u}
{L₁ : Type v}
{L₂ : Type w}
[CommRing R]
[LieRing L₁]
[LieRing L₂]
[LieAlgebra R L₁]
[LieAlgebra R L₂]


theorem StrictConvexOn.sub (hf : StrictConvexOn 𝕜 s f) (hg : StrictConcaveOn 𝕜 s g) :
    StrictConvexOn 𝕜 s (f - g)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommGroup β]
[SMul 𝕜 E]
[Module 𝕜 β]
{s : Set E}
{f g : E → β}
(hf : StrictConvexOn 𝕜 s f)
(hg : StrictConcaveOn 𝕜 s g)


theorem tendsto_lift'_closure_nhds (hf : Continuous f) (x : X) :
    Tendsto f ((𝓝 x).lift' closure) ((𝓝 (f x)).lift' closure)

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

Filter.Tendsto f ((𝓝 x).lift' closure) ((𝓝 (f x)).lift' closure)


theorem logb_injOn_pos : Set.InjOn (logb b) (Set.Ioi 0)


@[to_additive]
theorem div_mul_eq_div_div_swap : a / (b * c) = a / c / b

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


@[simp]
theorem empty_vecMul (v : Fin 0 → α) (B : Matrix (Fin 0) o' α) : v ᵥ* B = 0

{α : Type u}
{o' : Type uₒ}
[NonUnitalNonAssocSemiring α]
(v : Fin 0 → α)
(B : Matrix (Fin 0) o' α)


/-- Specialisation of `Nat.ofNat_pos'`, which seems to be easier for Lean to use. -/
-- See note [no_index around OfNat.ofNat]
@[simp]
theorem ofNat_pos {α} [OrderedSemiring α] [Nontrivial α] {n : ℕ} [n.AtLeastTwo] :
    0 < (no_index (OfNat.ofNat n : α))

{α : Type u_3}
[OrderedSemiring α]
[Nontrivial α]
{n : ℕ}
[n.AtLeastTwo]


protected theorem image' {q : ℚ_[p]} : q ≠ 0 → ∃ n : ℤ, padicNormE q = (p : ℚ) ^ (-n)

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


theorem Convex.translate (hs : Convex 𝕜 s) (z : E) : Convex 𝕜 ((fun x => z + x) '' s)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{s : Set E}
(hs : Convex 𝕜 s)
(z : E)


/-- Two simplices with the same points have the same circumcenter. -/
theorem circumcenter_eq_of_range_eq {n : ℕ} {s₁ s₂ : Simplex ℝ P n}
    (h : Set.range s₁.points = Set.range s₂.points) : s₁.circumcenter = s₂.circumcenter


theorem edgeDensity_comm (s t : Finset α) : G.edgeDensity s t = G.edgeDensity t s

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


@[to_additive (attr := simp)]
lemma coe_nonempty (s : Subgroup G) : (s : Set G).Nonempty

{G : Type u_1}
[AddGroup G]
(s : AddSubgroup G)


@[simp]
theorem nhdsSet_singleton : 𝓝ˢ {x} = 𝓝 x

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


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


theorem sum_properDivisors_eq_one_iff_prime : ∑ x ∈ n.properDivisors, x = 1 ↔ n.Prime

∑ x ∈ n.properDivisors, x = 1 ↔ Nat.Prime n


/-- `f` is analytic within `s` at `x` iff some local extension of `f` is analytic at `x` -/
lemma analyticWithinAt_iff_exists_analyticAt [CompleteSpace F] {f : E → F} {s : Set E} {x : E} :
    AnalyticWithinAt 𝕜 f s x ↔
      ContinuousWithinAt f s x ∧ ∃ g, f =ᶠ[𝓝[s] x] g ∧ AnalyticAt 𝕜 g x

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{f : E → F}
{s : Set E}
{x : E}


@[to_additive]
theorem mul_div_left_comm : a * (b / c) = b * (a / c)

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


@[simp]
theorem ofBoolAlg_inf (a b : AsBoolAlg α) : ofBoolAlg (a ⊓ b) = ofBoolAlg a * ofBoolAlg b

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


theorem isLocalRingHom_of_comp (f : R →+* S) (g : S →+* T) [IsLocalRingHom (g.comp f)] :
    IsLocalRingHom f

{R : Type u_1}
{S : Type u_2}
{T : Type u_3}
[Semiring R]
[Semiring S]
[Semiring T]
(f : R →+* S)
(g : S →+* T)
[IsLocalRingHom (g.comp f)]


/-- The span of a union of sets is the sup of their spans. -/
theorem span_union (s t : Set P) : affineSpan k (s ∪ t) = affineSpan k s ⊔ affineSpan k t

(k : Type u_1)
(V : Type u_2)
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
(s t : Set P)


/-- An `InfiniteRk` matroid is one whose bases are infinite. -/
class InfiniteRk (M : Matroid α) : Prop where
  /-- There is an infinite base -/
  exists_infinite_base : ∃ B, M.Base B ∧ B.Infinite

{α : Type u_1}
{M : Matroid α}
[self : M.InfiniteRk]


/-- Two functions monovary iff the rearrangement inequality holds. -/
lemma monovary_iff_smul_rearrangement :
    Monovary f g ↔ ∀ i j, f i • g j + f j • g i ≤ f i • g i + f j • g j

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{f : ι → α}
{g : ι → β}

Monovary f g ↔ ∀ (i j : ι), f i • g j + f j • g i ≤ f i • g i + f j • g j


theorem invOf_exp (x : 𝔸) [Invertible (exp 𝕂 x)] : ⅟ (exp 𝕂 x) = exp 𝕂 (-x)

(𝕂 : Type u_1)
{𝔸 : Type u_2}
[RCLike 𝕂]
[NormedRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]
(x : 𝔸)
[Invertible (NormedSpace.exp 𝕂 x)]

⅟(NormedSpace.exp 𝕂 x) = NormedSpace.exp 𝕂 (-x)


@[simp] theorem or_iff_left_iff_imp  : (a ∨ b ↔ a) ↔ (b → a)


theorem coeNat_ofPrime (p : Nat.Primes) : (ofPrime p : Multiset ℕ) = {(p : ℕ)}

(PrimeMultiset.ofPrime p).toNatMultiset = {↑p}


/-- Assemble an `I`-indexed family of equivalences of categories
into a single equivalence. -/
@[simps]
def pi (E : ∀ i, C i ≌ D i) : (∀ i, C i) ≌ (∀ i, D i)

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

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

(CategoryTheory.Equivalence.pi E).counitIso = CategoryTheory.NatIso.pi fun i => (E i).counitIso


theorem emod_sub_cancel_right {m n k : Int} (i) : (m - i) % n = (k - i) % n ↔ m % n = k % n


@[simp]
theorem powersetCardAux_nil (n : ℕ) : powersetCardAux (n + 1) (@nil α) = []

Multiset.powersetCardAux (n + 1) [] = []


/-- Given `α : F ⟶ L ⋙ F'`, the property `F'.IsLeftKanExtension α` asserts that
`(F', α)` is an initial object in the category `LeftExtension L F`, i.e. that `(F', α)`
is a left Kan extension of `F` along `L`. -/
class IsLeftKanExtension : Prop where
  nonempty_isUniversal : Nonempty (LeftExtension.mk F' α).IsUniversal

{C : Type u_1}
{H : Type u_3}
{D : Type u_5}
[CategoryTheory.Category.{u_7, u_1} C]
[CategoryTheory.Category.{u_8, u_3} H]
[CategoryTheory.Category.{u_9, u_5} D]
{F' : CategoryTheory.Functor D H}
{L : CategoryTheory.Functor C D}
{F : CategoryTheory.Functor C H}
{α : F ⟶ L.comp F'}
[self : F'.IsLeftKanExtension α]

Nonempty (CategoryTheory.StructuredArrow.IsUniversal (CategoryTheory.Functor.LeftExtension.mk F' α))


@[simp]
theorem ofDual_symm_eq : (@ofDual α).symm = toDual


theorem LinearIndependent.iff_fractionRing {ι : Type*} {b : ι → V} :
    LinearIndependent R b ↔ LinearIndependent K b

(R : Type u_3)
(K : Type u_4)
[CommRing R]
[Field K]
[Algebra R K]
[IsFractionRing R K]
{V : Type u_5}
[AddCommGroup V]
[Module R V]
[Module K V]
[IsScalarTower R K V]
{ι : Type u_6}
{b : ι → V}


theorem carrier.asIdeal.prime : (carrier.asIdeal f_deg hm q).IsPrime

(q :
  ↑↑(AlgebraicGeometry.Spec.locallyRingedSpaceObj
          (CommRingCat.of (HomogeneousLocalization.Away 𝒜 f))).toPresheafedSpace)

(AlgebraicGeometry.ProjIsoSpecTopComponent.FromSpec.carrier.asIdeal f_deg hm q).IsPrime


theorem iff_true_intro (h : a) : a ↔ True


/-- Surjective monoid homomorphisms constant on a congruence relation `c`'s equivalence classes
    induce a surjective homomorphism on `c`'s quotient. -/
@[to_additive "Surjective `AddMonoid` homomorphisms constant on an additive congruence
relation `c`'s equivalence classes induce a surjective homomorphism on `c`'s quotient."]
theorem lift_surjective_of_surjective (h : c ≤ ker f) (hf : Surjective f) :
    Surjective (c.lift f h)

{M : Type u_1}
{P : Type u_3}
[AddZeroClass M]
[AddZeroClass P]
{c : AddCon M}
{f : M →+ P}
(h : c ≤ AddCon.ker f)
(hf : Function.Surjective ⇑f)


theorem lhopital_zero_right_on_Ioo (hff' : ∀ x ∈ Ioo a b, HasDerivAt f (f' x) x)
    (hgg' : ∀ x ∈ Ioo a b, HasDerivAt g (g' x) x) (hg' : ∀ x ∈ Ioo a b, g' x ≠ 0)
    (hfa : Tendsto f (𝓝[>] a) (𝓝 0)) (hga : Tendsto g (𝓝[>] a) (𝓝 0))
    (hdiv : Tendsto (fun x => f' x / g' x) (𝓝[>] a) l) :
    Tendsto (fun x => f x / g x) (𝓝[>] a) l

(hff' : ∀ x ∈ Set.Ioo a b, HasDerivAt f (f' x) x)

(hgg' : ∀ x ∈ Set.Ioo a b, HasDerivAt g (g' x) x)

(hdiv : Filter.Tendsto (fun x => f' x / g' x) (𝓝[>] a) l)

Filter.Tendsto (fun x => f x / g x) (𝓝[>] a) l


theorem isAdjointPair_iff_comp_eq_compl₂ : IsAdjointPair B B' f g ↔ B'.comp f = B.compl₂ g

{R : Type u_1}
{M : Type u_5}
{M₁ : Type u_6}
{M₃ : Type u_8}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid M₁]
[Module R M₁]
[AddCommMonoid M₃]
[Module R M₃]
{I : R →+* R}
{B : M →ₗ[R] M →ₛₗ[I] M₃}
{B' : M₁ →ₗ[R] M₁ →ₛₗ[I] M₃}
{f : M →ₗ[R] M₁}
{g : M₁ →ₗ[R] M}

B.IsAdjointPair B' f g ↔ B' ∘ₗ f = B.compl₂ g


@[simp]
theorem lift'_nhds_interior (x : X) : (𝓝 x).lift' interior = 𝓝 x

{X : Type u}
[TopologicalSpace X]
(x : X)


theorem pair_unpair' {n a b} (H : unpair n = (a, b)) : pair a b = n


/-- Predicate for an ordered topological space to be equipped with its Scott-Hausdorff topology.

A set `u` is open in the Scott-Hausdorff topology iff when the least upper bound of a directed set
`d` lies in `u` then there is a tail of `d` which is a subset of `u`. -/
class IsScottHausdorff : Prop where
  topology_eq_scottHausdorff : ‹TopologicalSpace α› = scottHausdorff α

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]
[self : Topology.IsScottHausdorff α]


lemma Monovary.mul_left₀ (hf₁ : 0 ≤ f₁) (hf₂ : 0 ≤ f₂) (h₁ : Monovary f₁ g) (h₂ : Monovary f₂ g) :
    Monovary (f₁ * f₂) g

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedSemiring α]
[OrderedSemiring β]
{f₁ f₂ : ι → α}
{g : ι → β}
(hf₁ : 0 ≤ f₁)
(hf₂ : 0 ≤ f₂)
(h₁ : Monovary f₁ g)
(h₂ : Monovary f₂ g)


@[simp]
theorem mem_iUnion {x : α} {s : ι → Set α} : (x ∈ ⋃ i, s i) ↔ ∃ i, x ∈ s i

{α : Type u}
{ι : Sort v}
{x : α}
{s : ι → Set α}


@[simp] theorem ofFin_le (x : Fin (2^n)) (y : BitVec n) :
  BitVec.ofFin x ≤ y ↔ x ≤ y.toFin

{n : Nat}
(x : Fin (2 ^ n))
(y : BitVec n)


/-- Note this takes an explicit `Fintype ((ZMod n)ˣ)` argument to avoid trouble with instance
diamonds. -/
@[simp]
theorem _root_.ZMod.card_units_eq_totient (n : ℕ) [NeZero n] [Fintype (ZMod n)ˣ] :
    Fintype.card (ZMod n)ˣ = φ n


theorem mem_classes (r : Setoid α) (y) : { x | r.Rel x y } ∈ r.classes


theorem B_mem_nhdsWithin_Ioi {K : Set F} {r s ε x : ℝ} (hx : x ∈ B f K r s ε) :
    B f K r s ε ∈ 𝓝[>] x

(hx : x ∈ RightDerivMeasurableAux.B f K r s ε)

RightDerivMeasurableAux.B f K r s ε ∈ 𝓝[>] x


theorem rTensor_comp : (g.comp f).rTensor M = (g.rTensor M).comp (f.rTensor M)

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

LinearMap.rTensor M (g ∘ₗ f) = LinearMap.rTensor M g ∘ₗ LinearMap.rTensor M f


theorem M.dest_corec {α : TypeVec n} {β : Type u} (g : β → P (α.append1 β)) (x : β) :
    M.dest P (M.corec P g x) = appendFun id (M.corec P g) <$$> g x

{n : ℕ}
(P : MvPFunctor.{u} (n + 1))
{α : TypeVec.{u} n}
{β : Type u}
(g : β → ↑P (α ::: β))
(x : β)

MvPFunctor.M.dest P (MvPFunctor.M.corec P g x) = (TypeVec.id ::: MvPFunctor.M.corec P g) <$$> g x


theorem apply_mem_span_image_iff_mem_span [RingHomSurjective σ₁₂] {f : F} {x : M}
    {s : Set M} (hf : Function.Injective f) :
    f x ∈ Submodule.span R₂ (f '' s) ↔ x ∈ Submodule.span R s

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_4}
{M₂ : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[AddCommMonoid M₂]
[Module R₂ M₂]
{F : Type u_8}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
[RingHomSurjective σ₁₂]
{f : F}
{x : M}
{s : Set M}
(hf : Function.Injective ⇑f)

f x ∈ Submodule.span R₂ (⇑f '' s) ↔ x ∈ Submodule.span R s


theorem ConvolutionExistsAt.integrable [Sub G] {x : G} (h : ConvolutionExistsAt f g x L μ) :
    Integrable (fun t => L (f t) (g (x - t))) μ

(h : MeasureTheory.ConvolutionExistsAt f g x L μ)

MeasureTheory.Integrable (fun t => (L (f t)) (g (x - t))) μ


theorem card_Ioi_eq_card_Ici_sub_one (a : α) : (Ioi a).card = (Ici a).card - 1

{α : Type u_2}
[PartialOrder α]
[LocallyFiniteOrderTop α]
(a : α)

(Finset.Ioi a).card = (Finset.Ici a).card - 1


theorem derivedSeries_eq_top (n : ℕ) (h : derivedSeries R L 1 = ⊤) :
    derivedSeries R L n = ⊤

(h : LieAlgebra.derivedSeries R L 1 = ⊤)


theorem sublists'Aux_eq_array_foldl (a : α) : ∀ (r₁ r₂ : List (List α)),
    sublists'Aux a r₁ r₂ = ((r₁.toArray).foldl (init := r₂.toArray)
      (fun r l => r.push (a :: l))).toList

{α : Type u}
(a : α)
(r₁ r₂ : List (List α))

List.sublists'Aux a r₁ r₂ = (Array.foldl (fun r l => r.push (a :: l)) (List.toArray r₂) (List.toArray r₁) 0).toList


@[to_additive]
theorem lift.of_eq (x : FreeGroup α) : lift FreeGroup.of x = x

(FreeAddGroup.lift FreeAddGroup.of) x = x


theorem natTrailingDegree_mul [NoZeroDivisors R] (hp : p ≠ 0) (hq : q ≠ 0) :
    (p * q).natTrailingDegree = p.natTrailingDegree + q.natTrailingDegree

{R : Type u}
[Semiring R]
{p q : R[X]}
[NoZeroDivisors R]
(hp : p ≠ 0)
(hq : q ≠ 0)


theorem integral_congr {f g : ℂ → E} {c : ℂ} {R : ℝ} (hR : 0 ≤ R) (h : EqOn f g (sphere c R)) :
    (∮ z in C(c, R), f z) = ∮ z in C(c, R), g z

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f g : ℂ → E}
{c : ℂ}
{R : ℝ}
(hR : 0 ≤ R)
(h : Set.EqOn f g (Metric.sphere c R))

(∮ (z : ℂ) in C(c, R), f z) = ∮ (z : ℂ) in C(c, R), g z


/-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/
theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop}
    (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I

(hgt : ∀ (I : Submodule R M), (∀ J > I, P J) → P I)


@[simp] lemma FGModuleCatDual_obj : (FGModuleCatDual K V).obj = ModuleCat.of K (Module.Dual K V)

(K : Type u)
[Field K]
(V : FGModuleCat K)

(FGModuleCat.FGModuleCatDual K V).obj = ModuleCat.of K (Module.Dual K ↑V)


lemma IsUnramifiedAtInfinitePlaces.trans
    [h₁ : IsUnramifiedAtInfinitePlaces k K] [h₂ : IsUnramifiedAtInfinitePlaces K F] :
    IsUnramifiedAtInfinitePlaces k F

(k : Type u_1)
[Field k]
(K : Type u_2)
[Field K]
(F : Type u_3)
[Field F]
[Algebra k K]
[Algebra k F]
[Algebra K F]
[IsScalarTower k K F]
[h₁ : IsUnramifiedAtInfinitePlaces k K]
[h₂ : IsUnramifiedAtInfinitePlaces K F]


theorem getElem_splitWrtCompositionAux (l : List α) (ns : List ℕ) {i : ℕ}
    (hi : i < (l.splitWrtCompositionAux ns).length) :
    (l.splitWrtCompositionAux ns)[i] =
      (l.take (ns.take (i + 1)).sum).drop (ns.take i).sum

(l.splitWrtCompositionAux ns)[i] = List.drop (List.take i ns).sum (List.take (List.take (i + 1) ns).sum l)


lemma dist_inr (a b : A) : dist (a : Unitization 𝕜 A) (b : Unitization 𝕜 A) = dist a b

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


theorem subsingleton_iff_exists_singleton_mem [Nonempty α] : l.Subsingleton ↔ ∃ a, {a} ∈ l

{α : Type u_1}
{l : Filter α}
[Nonempty α]


/-- If `f` is a smooth partition of unity on a set `s : Set M` subordinate to a family of open sets
`U : ι → Set M` and `g : ι → M → F` is a family of functions such that `g i` is smooth on `U i`,
then the sum `fun x ↦ ∑ᶠ i, f i x • g i x` is smooth on the whole manifold. -/
theorem IsSubordinate.smooth_finsum_smul {g : ι → M → F} (hf : f.IsSubordinate U)
    (ho : ∀ i, IsOpen (U i)) (hg : ∀ i, SmoothOn I 𝓘(ℝ, F) (g i) (U i)) :
    Smooth I 𝓘(ℝ, F) fun x => ∑ᶠ i, f i x • g i x

(hg : ∀ (i : ι), SmoothOn I 𝓘(ℝ, F) (g i) (U i))

Smooth I 𝓘(ℝ, F) fun x => ∑ᶠ (i : ι), (f i) x • g i x


theorem multiplicity_add_eq_min {p a b : α} (h : multiplicity p a ≠ multiplicity p b) :
    multiplicity p (a + b) = min (multiplicity p a) (multiplicity p b)


@[simp] theorem snd_smul [∀ i, SMul α (A i)] (a : α) (x : GradedMonoid A) :
    (a • x).snd = a • x.snd

{ι : Type u_1}
{α : Type u_3}
{A : ι → Type u_2}
[(i : ι) → SMul α (A i)]
(a : α)
(x : GradedMonoid A)


theorem _root_.AlgebraicGeometry.isIso_iff_stalk_iso {X Y : Scheme.{u}} (f : X ⟶ Y) :
    IsIso f ↔ IsIso f.1.base ∧ ∀ x, IsIso (f.stalkMap x)

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)

CategoryTheory.IsIso f ↔
  CategoryTheory.IsIso f.val.base ∧
    ∀ (x : ↑↑X.toPresheafedSpace), CategoryTheory.IsIso (AlgebraicGeometry.Scheme.Hom.stalkMap f x)


@[simp]
lemma lift_comp_eqToHom_iff {R S S' : 𝒮} {a b : 𝒳} (f : R ⟶ S) (φ : a ⟶ b) (h : S = S') :
    p.IsHomLift (f ≫ eqToHom h) φ ↔ p.IsHomLift f φ

{𝒮 : Type u₁}
{𝒳 : Type u₂}
[CategoryTheory.Category.{v₁, u₂} 𝒳]
[CategoryTheory.Category.{v₂, u₁} 𝒮]
(p : 𝒳 ⥤ 𝒮)
{R S S' : 𝒮}
{a b : 𝒳}
(f : R ⟶ S)
(φ : a ⟶ b)
(h : S = S')

p.IsHomLift (f ≫ CategoryTheory.eqToHom h) φ ↔ p.IsHomLift f φ


theorem WalkingParallelPairHom.comp_id
    {X Y : WalkingParallelPair} (f : WalkingParallelPairHom X Y) : comp f (id Y) = f

{X Y : CategoryTheory.Limits.WalkingParallelPair}

(f : CategoryTheory.Limits.WalkingParallelPairHom X Y)

f.comp (CategoryTheory.Limits.WalkingParallelPairHom.id Y) = f


@[simp, norm_cast]
theorem coe_add : ((φ + ψ : MvPolynomial σ R) : MvPowerSeries σ R) = φ + ψ

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
(φ ψ : MvPolynomial σ R)

↑(φ + ψ) = ↑φ + ↑ψ


lemma isSemisimpleModule_biSup_of_isSemisimpleModule_submodule {s : Set ι} {p : ι → Submodule R M}
    (hp : ∀ i ∈ s, IsSemisimpleModule R (p i)) :
    IsSemisimpleModule R ↥(⨆ i ∈ s, p i)

(hp : ∀ i ∈ s, IsSemisimpleModule R ↥(p i))


theorem foldr_range_eq_of_range_eq {f : β → α → α} {g : γ → α → α} (hfg : Set.range f = Set.range g)
    (a : α) : Set.range (foldr f a) = Set.range (foldr g a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : β → α → α}
{g : γ → α → α}
(hfg : Set.range f = Set.range g)
(a : α)

Set.range (List.foldr f a) = Set.range (List.foldr g a)


@[simp]
theorem zipRight'_nil_right : zipRight' as ([] : List β) = ([], as)


theorem inter_empty_of_inter_sUnion_empty {s t : Set α} {S : Set (Set α)} (hs : t ∈ S)
    (h : s ∩ ⋃₀S = ∅) : s ∩ t = ∅

{α : Type u_1}
{s t : Set α}
{S : Set (Set α)}
(hs : t ∈ S)
(h : s ∩ ⋃₀ S = ∅)


theorem filter_eq_nil {s} : filter p s = 0 ↔ ∀ a ∈ s, ¬p a

{α : Type u_1}
{p : α → Prop}
[DecidablePred p]
{s : Multiset α}


/-- If `A` and `B` are subalgebras of a commutative `R`-algebra `S`, both of them are
free `R`-algebras, then the `FiniteDimensional.finrank` of `A ⊔ B` is less than or equal to
the product of that of `A` and `B`. -/
theorem finrank_sup_le_of_free [Module.Free R A] [Module.Free R B] :
    finrank R ↥(A ⊔ B) ≤ finrank R A * finrank R B

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
(A B : Subalgebra R S)
[Module.Free R ↥A]
[Module.Free R ↥B]

FiniteDimensional.finrank R ↥(A ⊔ B) ≤ FiniteDimensional.finrank R ↥A * FiniteDimensional.finrank R ↥B


/--
A `ProjectiveResolution Z` consists of a bundled `ℕ`-indexed chain complex of projective objects,
along with a quasi-isomorphism to the complex consisting of just `Z` supported in degree `0`.
-/
structure ProjectiveResolution (Z : C) where
  /-- the chain complex involved in the resolution -/
  complex : ChainComplex C ℕ
  /-- the chain complex must be degreewise projective -/
  projective : ∀ n, Projective (complex.X n) := by infer_instance
  /-- the chain complex must have homology -/
  [hasHomology : ∀ i, complex.HasHomology i]
  /-- the morphism to the single chain complex with `Z` in degree `0` -/
  π : complex ⟶ (ChainComplex.single₀ C).obj Z
  /-- the morphism to the single chain complex with `Z` in degree `0` is a quasi-isomorphism -/
  quasiIso : QuasiIso π := by infer_instance

(self : CategoryTheory.ProjectiveResolution Z)


@[simp]
theorem support_rotate {u v : V} (c : G.Walk v v) (h : u ∈ c.support) :
    (c.rotate h).support.tail ~r c.support.tail

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


@[simp]
theorem associatesEquivIsPrincipal_symm_apply {I : Ideal R} (hI : IsPrincipal I) :
    (associatesEquivIsPrincipal R).symm ⟨I, hI⟩ = .mk hI.generator

{R : Type u_1}
[CommRing R]
[IsDomain R]
{I : Ideal R}
(hI : Submodule.IsPrincipal I)

(Ideal.associatesEquivIsPrincipal R).symm ⟨I, hI⟩ = Associates.mk (Submodule.IsPrincipal.generator I)


theorem absNorm_dvd_norm_of_mem {I : Ideal S} {x : S} (h : x ∈ I) :
    ↑(Ideal.absNorm I) ∣ Algebra.norm ℤ x

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