/-- If we take `J = I.comap f` then `QuotientMap` is injective automatically. -/
theorem quotientMap_injective {I : Ideal S} {f : R →+* S} :
    Function.Injective (quotientMap I f le_rfl)

{R : Type u}
[CommRing R]
{S : Type v}
[CommRing S]
{I : Ideal S}
{f : R →+* S}

Function.Injective ⇑(Ideal.quotientMap I f ⋯)


/-- A `c : ComplexShape ι` describes the shape of a chain complex,
with chain groups indexed by `ι`.
Typically `ι` will be `ℕ`, `ℤ`, or `Fin n`.

There is a relation `Rel : ι → ι → Prop`,
and we will only allow a non-zero differential from `i` to `j` when `Rel i j`.

There are axioms which imply `{ j // c.Rel i j }` and `{ i // c.Rel i j }` are subsingletons.
This means that the shape consists of some union of lines, rays, intervals, and circles.

Below we define `c.next` and `c.prev` which provide these related elements.
-/
@[ext]
structure ComplexShape (ι : Type*) where
  /-- Nonzero differentials `X i ⟶ X j` shall be allowed
    on homological complexes when `Rel i j` holds. -/
  Rel : ι → ι → Prop
  /-- There is at most one nonzero differential from `X i`. -/
  next_eq : ∀ {i j j'}, Rel i j → Rel i j' → j = j'
  /-- There is at most one nonzero differential to `X j`. -/
  prev_eq : ∀ {i i' j}, Rel i j → Rel i' j → i = i'

{ι : Type u_1}
(self : ComplexShape ι)
{i j j' : ι}


theorem one_def : (1 : α →ᵈ α) = Dilation.id α


lemma ShortExact.map (h : S.ShortExact) (F : C ⥤ D)
    [F.PreservesZeroMorphisms] [F.PreservesLeftHomologyOf S]
    [F.PreservesRightHomologyOf S] [Mono (F.map S.f)] [Epi (F.map S.g)] :
    (S.map F).ShortExact


@[simp]
theorem toSemiring_coe_addMonoidHom (f : ∀ i, A i →+ R) (hone hmul) :
    (toSemiring f hone hmul : (⨁ i, A i) →+ R) = toAddMonoid f

(hone : (f 0) GradedMonoid.GOne.one = 1)

(hmul : ∀ {i j : ι} (ai : A i) (aj : A j), (f (i + j)) (GradedMonoid.GMul.mul ai aj) = (f i) ai * (f j) aj)

↑(DirectSum.toSemiring f hone hmul) = DirectSum.toAddMonoid f


@[simp]
protected theorem zero_lt_one : (0 : PGame) < 1


theorem eq_of_abs_sub_nonpos (h : |a - b| ≤ 0) : a = b

{α : Type u_1}
[LinearOrderedAddCommGroup α]
{a b : α}
(h : |a - b| ≤ 0)


@[ext]
lemma ext {X : TopCat} {P Q : Presheaf C X} {f g : P ⟶ Q}
    (w : ∀ U : Opens X, f.app (op U) = g.app (op U)) :
    f = g

(w : ∀ (U : TopologicalSpace.Opens ↑X), f.app (Opposite.op U) = g.app (Opposite.op U))


theorem Monotone.quasilinearOn (hf : Monotone f) : QuasilinearOn 𝕜 univ f

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{f : E → β}
(hf : Monotone f)


@[simp] theorem coe_fn_mk (f : α → β) (g l r) : (Equiv.mk f g l r : α → β) = f

{α : Sort u}
{β : Sort v}
(f : α → β)
(g : β → α)
(l : Function.LeftInverse g f)
(r : Function.RightInverse g f)

⇑{ toFun := f, invFun := g, left_inv := l, right_inv := r } = f


protected lemma sum_div (hf : ∀ i ∈ s, n ∣ f i) : (∑ i ∈ s, f i) / n = ∑ i ∈ s, f i / n

{ι : Type u_6}
{s : Finset ι}
{f : ι → ℕ}
{n : ℕ}
(hf : ∀ i ∈ s, n ∣ f i)


@[simp] lemma mapEmbedding_ground_eq (M : Matroid α) (f : α ↪ β) :
    (M.mapEmbedding f).E = f '' M.E

{α : Type u_1}
{β : Type u_2}
(M : Matroid α)
(f : α ↪ β)


@[simp]
theorem card_Ioo : (Ioo a b).card = b - a - 1


theorem normalize : PythagoreanTriple (x / Int.gcd x y) (y / Int.gcd x y) (z / Int.gcd x y)

{x y z : ℤ}
(h : PythagoreanTriple x y z)

PythagoreanTriple (x / ↑(x.gcd y)) (y / ↑(x.gcd y)) (z / ↑(x.gcd y))


/-- A well-founded relation. Not to be confused with `IsWellOrder`. -/
@[mk_iff] class IsWellFounded (α : Type u) (r : α → α → Prop) : Prop where
  /-- The relation is `WellFounded`, as a proposition. -/
  wf : WellFounded r

{α : Type u}
{r : α → α → Prop}
[self : IsWellFounded α r]


@[simp]
theorem filter_single_of_pos {a : α} {b : M} (h : p a) : (single a b).filter p = single a b

{α : Type u_1}
{M : Type u_5}
[Zero M]
(p : α → Prop)
[DecidablePred p]
{a : α}
{b : M}
(h : p a)

Finsupp.filter p (Finsupp.single a b) = Finsupp.single a b


lemma self_le_wellOrderSucc (a : α) : a ≤ wellOrderSucc a

{α : Type u_1}
[LinearOrder α]
[IsWellOrder α fun x x_1 => x < x_1]
(a : α)


@[simp]
theorem append_nil (w : Vector3 α n) : [] +-+ w = w

{α : Type u_1}
{n : ℕ}
(w : Vector3 α n)


@[to_additive]
theorem relindex_dvd_index_of_le (h : H ≤ K) : H.relindex K ∣ H.index

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


@[simp]
protected theorem map_neg (f : α → β) (x : FreeAbelianGroup α) : f <$> (-x) = -f <$> x

{α β : Type u}
(f : α → β)
(x : FreeAbelianGroup α)


theorem aeval_comp {A : Type*} [Semiring A] [Algebra R A] (x : A) :
    aeval x (p.comp q) = aeval (aeval x q) p

{R : Type u}
[CommSemiring R]
{p q : R[X]}
{A : Type u_3}
[Semiring A]
[Algebra R A]
(x : A)

(Polynomial.aeval x) (p.comp q) = (Polynomial.aeval ((Polynomial.aeval x) q)) p


theorem mul_div_mul_cancel {a b c : R} (ha : a ≠ 0) (hcb : c ∣ b) : a * b / (a * c) = b / c

{R : Type u}
[EuclideanDomain R]
{a b c : R}
(ha : a ≠ 0)
(hcb : c ∣ b)


/-- The bijection `orderEmbOfFin s h` sends `0` to the minimum of `s`. -/
theorem orderEmbOfFin_zero {s : Finset α} {k : ℕ} (h : s.card = k) (hz : 0 < k) :
    orderEmbOfFin s h ⟨0, hz⟩ = s.min' (card_pos.mp (h.symm ▸ hz))

{α : Type u_1}
[LinearOrder α]
{s : Finset α}
{k : ℕ}
(h : s.card = k)
(hz : 0 < k)


lemma weightSpace_chainTopCoeff_add_one_zsmul_add :
    weightSpace M ((chainTopCoeff α β + 1 : ℤ) • α + β : L → R) = ⊥

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

LieModule.weightSpace M ((↑(LieModule.chainTopCoeff α β) + 1) • α + ⇑β) = ⊥


@[gcongr]
theorem Ico_subset_Ico_left (h : a₁ ≤ a₂) : Ico a₂ b ⊆ Ico a₁ b

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


theorem mem_iInf₂_iff {f : ∀ i, κ i → UpperSet α} : (a ∈ ⨅ (i) (j), f i j) ↔ ∃ i j, a ∈ f i j

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


theorem congr (hf : AEStronglyMeasurable f μ) (h : f =ᵐ[μ] g) : AEStronglyMeasurable g μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)


/-- The rotation by 90 degrees on an oriented real inner product space of dimension 2 can be
evaluated in terms of a complex-number representation of the space. -/
theorem rightAngleRotation_map_complex (f : E ≃ₗᵢ[ℝ] ℂ)
    (hf : Orientation.map (Fin 2) f.toLinearEquiv o = Complex.orientation) (x : E) :
    f (J x) = I * f x

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

(hf : (Orientation.map (Fin 2) f.toLinearEquiv) o = Complex.orientation)

f (o.rightAngleRotation x) = Complex.I * f x


@[simp]
theorem exposedPoints_empty : (∅ : Set E).exposedPoints 𝕜 = ∅

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


@[reassoc] theorem associator_hom_fst (X Y Z : C) :
    (α_ X Y Z).hom ≫ prod.fst = prod.fst ≫ prod.fst

CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator X Y Z).hom
    CategoryTheory.Limits.prod.fst =
  CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.fst CategoryTheory.Limits.prod.fst


/-- Functor translating a commutative monoid object in a functor category
to a functor into the category of commutative monoid objects.
-/
@[simps!]
def functor : CommMon_ (C ⥤ D) ⥤ C ⥤ CommMon_ D

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

((CategoryTheory.Monoidal.CommMonFunctorCategoryEquivalence.functor.obj A).obj X).one = A.one.app X


@[to_additive]
theorem prod_induction (p : α → Prop) (s : Multiset α) (p_mul : ∀ a b, p a → p b → p (a * b))
    (p_one : p 1) (p_s : ∀ a ∈ s, p a) : p s.prod

(p_mul : ∀ (a b : α), p a → p b → p (a * b))


/-- Multiplicative congruence relations preserve inversion. -/
@[to_additive "Additive congruence relations preserve negation."]
protected theorem inv {x y} (h : c x y) : c x⁻¹ y⁻¹

{M : Type u_1}
[Group M]
(c : Con M)
{x y : M}
(h : c x y)


/-- **Wilson's Lemma**: the product of `1`, ..., `p-1` is `-1` modulo `p`. -/
@[simp]
theorem wilsons_lemma : ((p - 1)! : ZMod p) = -1


theorem mk_le_of_surjective {α β : Type u} {f : α → β} (hf : Surjective f) : #β ≤ #α

{α β : Type u}
{f : α → β}
(hf : Function.Surjective f)


/-- If `f : X → Y` is Hölder continuous in a neighborhood of every point `x : X` with the same
positive exponent `r` but possibly different coefficients, then the Hausdorff dimension of the range
of `f` is at most the Hausdorff dimension of `X` divided by `r`. -/
theorem dimH_range_le_of_locally_holder_on [SecondCountableTopology X] {r : ℝ≥0} {f : X → Y}
    (hr : 0 < r) (hf : ∀ x : X, ∃ C : ℝ≥0, ∃ s ∈ 𝓝 x, HolderOnWith C r f s) :
    dimH (range f) ≤ dimH (univ : Set X) / r

(hf : ∀ (x : X), ∃ C, ∃ s ∈ 𝓝 x, HolderOnWith C r f s)


theorem coeff_hermite_of_even_add {n k : ℕ} (hnk : Even (n + k)) :
    coeff (hermite n) k = (-1) ^ ((n - k) / 2) * (n - k - 1)‼ * Nat.choose n k

(Polynomial.hermite n).coeff k = (-1) ^ ((n - k) / 2) * ↑(n - k - 1).doubleFactorial * ↑(n.choose k)


theorem coeff_frobenius (f : Ring.Perfection R p) (n : ℕ) :
    coeff R p (n + 1) (frobenius _ p f) = coeff R p n f

{R : Type u₁}
[CommSemiring R]
{p : ℕ}
[hp : Fact (Nat.Prime p)]
[CharP R p]
(f : Ring.Perfection R p)
(n : ℕ)

(Perfection.coeff R p (n + 1)) ((frobenius (Ring.Perfection R p) p) f) = (Perfection.coeff R p n) f


/-- Updating a tuple and adding an element at the end commute. -/
@[simp]
theorem snoc_update : snoc (update p i y) x = update (snoc p x) (castSucc i) y

{n : ℕ}
{α : Fin (n + 1) → Type u}
(x : α (Fin.last n))
(p : (i : Fin n) → α i.castSucc)
(i : Fin n)
(y : α i.castSucc)

Fin.snoc (Function.update p i y) x = Function.update (Fin.snoc p x) i.castSucc y


lemma isUnit_addU_of_Y_ne {P Q : Fin 3 → F} (hPz : P z ≠ 0) (hQz : Q z ≠ 0)
    (hy : P y * Q z ^ 3 ≠ Q y * P z ^ 3) : IsUnit (addU P Q)

{F : Type v}
[Field F]
{P Q : Fin 3 → F}
(hPz : P z ≠ 0)
(hQz : Q z ≠ 0)
(hy : P y * Q z ^ 3 ≠ Q y * P z ^ 3)

IsUnit (WeierstrassCurve.Jacobian.addU P Q)


/-- While in many cases `Fin.cast` is better than `Equiv.cast`/`cast`, sometimes we want to apply
a generic theorem about `cast`. -/
theorem cast_eq_cast (h : n = m) : (cast h : Fin n → Fin m) = _root_.cast (h ▸ rfl)


lemma subset_closure (M : Matroid α) (X : Set α) (hX : X ⊆ M.E := by aesop_mat) :
    X ⊆ M.closure X

{α : Type u_2}
(M : Matroid α)
(X : Set α)
(hX : X ⊆ M.E := by aesop_mat)


@[simp]
theorem inv_sign (r : ℝ) : (sign r)⁻¹ = sign r


@[to_additive]
lemma prod_mul_prod_eq_prod_zipWith_mul_prod_drop :
    ∀ l l' : List M,
      l.prod * l'.prod =
        (zipWith (· * ·) l l').prod * (l.drop l'.length).prod * (l'.drop l.length).prod

{M : Type u_4}
[AddCommMonoid M]
(l l' : List M)

l.sum + l'.sum =
  (List.zipWith (fun x x_1 => x + x_1) l l').sum + (List.drop l'.length l).sum + (List.drop l.length l').sum


/-- If `J` is connected, any functor to a discrete category is constant on objects.
The converse is given in `IsConnected.of_any_functor_const_on_obj`.
-/
theorem any_functor_const_on_obj [IsPreconnected J] {α : Type u₂} (F : J ⥤ Discrete α) (j j' : J) :
    F.obj j = F.obj j'

(F : CategoryTheory.Functor J (CategoryTheory.Discrete α))


theorem dedup_map_of_injective [DecidableEq β] {f : α → β} (hf : Function.Injective f)
    (xs : List α) :
    (xs.map f).dedup = xs.dedup.map f

{α : Type u_1}
{β : Type u_2}
[DecidableEq α]
[DecidableEq β]
{f : α → β}
(hf : Function.Injective f)
(xs : List α)

(List.map f xs).dedup = List.map f xs.dedup


theorem mapsTo (h : RightInvOn f' f t) (hf : SurjOn f' t s) : MapsTo f s t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
{f' : β → α}
(h : Set.RightInvOn f' f t)
(hf : Set.SurjOn f' t s)


theorem lift_nhds_left {x : α} {g : Set α → Filter β} (hg : Monotone g) :
    (𝓝 x).lift g = (𝓤 α).lift fun s : Set (α × α) => g (ball x s)

{α : Type ua}
{β : Type ub}
[UniformSpace α]
{x : α}
{g : Set α → Filter β}
(hg : Monotone g)

(𝓝 x).lift g = (𝓤 α).lift fun s => g (UniformSpace.ball x s)


theorem toNonUnitalSubring_injective {R : Type u} {A : Type v} [CommRing R] [NonUnitalRing A]
    [Module R A] [Star A] :
    Function.Injective (toNonUnitalSubring : NonUnitalStarSubalgebra R A → NonUnitalSubring A)


@[simp] lemma coe_toSupHom (f : LatticeHom α β) : ⇑f.toSupHom = f

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
(f : LatticeHom α β)


theorem AntivaryOn.dual_left : AntivaryOn f g s → MonovaryOn (toDual ∘ f) g s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : ι → α}
{g : ι → β}
{s : Set ι}

AntivaryOn f g s → MonovaryOn (⇑OrderDual.toDual ∘ f) g s


theorem mem_ball_comm : x ∈ ball y ε ↔ y ∈ ball x ε

{α : Type u}
[PseudoEMetricSpace α]
{x y : α}
{ε : ℝ≥0∞}

x ∈ EMetric.ball y ε ↔ y ∈ EMetric.ball x ε


theorem trCfg_init (k) (L : List (Γ k)) : TrCfg (TM2.init k L) (TM1.init (trInit k L) : Cfg₂₁)

{K : Type u_1}
[DecidableEq K]
{Γ : K → Type u_2}
{Λ : Type u_3}
[Inhabited Λ]
{σ : Type u_4}
[Inhabited σ]
(k : K)
(L : List (Γ k))

Turing.TM2to1.TrCfg (Turing.TM2.init k L) (Turing.TM1.init (Turing.TM2to1.trInit k L))


@[simp]
theorem mapMatrix_id : (AlgHom.id R α).mapMatrix = AlgHom.id R (Matrix m m α)

{m : Type u_2}
{R : Type u_7}
{α : Type v}
[Fintype m]
[DecidableEq m]
[CommSemiring R]
[Semiring α]
[Algebra R α]


@[simp] theorem toIsometryEquiv_trans (e : X ≅ Y) (f : Y ≅ Z) :
    toIsometryEquiv (e ≪≫ f) = e.toIsometryEquiv.trans f.toIsometryEquiv

{R : Type u}
[CommRing R]
{X Y Z : QuadraticModuleCat R}
(e : X ≅ Y)
(f : Y ≅ Z)

(e ≪≫ f).toIsometryEquiv = e.toIsometryEquiv.trans f.toIsometryEquiv


@[to_additive (attr := simp)]
theorem inv_inf (S T : Submonoid G) : (S ⊓ T)⁻¹ = S⁻¹ ⊓ T⁻¹

{G : Type u_2}
[Group G]
(S T : Submonoid G)

(S ⊓ T)⁻¹ = S⁻¹ ⊓ T⁻¹


theorem isVanKampenColimit_of_evaluation [HasPullbacks D] [HasColimitsOfShape J D] (F : J ⥤ C ⥤ D)
    (c : Cocone F) (hc : ∀ x : C, IsVanKampenColimit (((evaluation C D).obj x).mapCocone c)) :
    IsVanKampenColimit c

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

(hc : ∀ (x : C), CategoryTheory.IsVanKampenColimit (((CategoryTheory.evaluation C D).obj x).mapCocone c))


theorem isLUB_Ioc (h : a < b) : IsLUB (Ioc a b) b

{α : Type u}
[Preorder α]
{a b : α}
(h : a < b)


theorem union_right_comm (s t u : Finset α) : s ∪ t ∪ u = s ∪ u ∪ t

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


@[rclike_simps]
theorem normSq_one : normSq (1 : K) = 1


lemma Set.Infinite.exists_accPt_cofinite_inf_principal [CompactSpace X] (hs : s.Infinite) :
    ∃ x, AccPt x (cofinite ⊓ 𝓟 s)

{X : Type u}
[TopologicalSpace X]
{s : Set X}
[CompactSpace X]
(hs : s.Infinite)


theorem eval₂_list_sum (l : List R[X]) (x : S) : eval₂ f x l.sum = (l.map (eval₂ f x)).sum

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(f : R →+* S)
(l : List R[X])
(x : S)

Polynomial.eval₂ f x l.sum = (List.map (Polynomial.eval₂ f x) l).sum


@[simp]
theorem comp_base {X Y Z : SheafedSpace C} (f : X ⟶ Y) (g : Y ⟶ Z) :
    (f ≫ g).base = f.base ≫ g.base

{X Y Z : AlgebraicGeometry.SheafedSpace C}


theorem transferFunction_apply (q : G ⧸ H) :
    transferFunction H g q =
      g ^ (cast (quotientEquivSigmaZMod H g q).2 : ℤ) *
        (quotientEquivSigmaZMod H g q).1.out'.out'

{G : Type u}
[Group G]
(H : Subgroup G)
(g : G)
(q : G ⧸ H)

H.transferFunction g q =
  g ^ ((H.quotientEquivSigmaZMod g) q).snd.cast * Quotient.out' (Quotient.out' ((H.quotientEquivSigmaZMod g) q).fst)


/-- Since `k` is redundant, it is not necessary to show `q₁.k = q₂.k` when showing `q₁ = q₂`. -/
@[ext]
protected theorem ext ⦃q₁ q₂ : Basis A c₁ c₂⦄ (hi : q₁.i = q₂.i) (hj : q₁.j = q₂.j) : q₁ = q₂

⦃q₁ q₂ : QuaternionAlgebra.Basis A c₁ c₂⦄


/-- The quotient map `𝕜 → AddCircle p` as a partial homeomorphism. -/
@[simps] def partialHomeomorphCoe [DiscreteTopology (zmultiples p)] :
    PartialHomeomorph 𝕜 (AddCircle p)

∀ (a_1 : 𝕜), ↑(AddCircle.partialHomeomorphCoe p a) a_1 = ↑a_1


theorem eq_top_iff_forall_lt (x : PartENat) : x = ⊤ ↔ ∀ n : ℕ, (n : PartENat) < x


theorem eLpNorm_smul_le_eLpNorm_top_mul_eLpNorm (p : ℝ≥0∞) (hf : AEStronglyMeasurable f μ)
    (φ : α → 𝕜) : eLpNorm (φ • f) p μ ≤ eLpNorm φ ∞ μ * eLpNorm f p μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.eLpNorm (φ • f) p μ ≤ MeasureTheory.eLpNorm φ ⊤ μ * MeasureTheory.eLpNorm f p μ


/-- If `P` is a presentation of `S` over `R` and `T` is an `R`-algebra, we
obtain a natural presentation of `T ⊗[R] S` over `T`. -/
@[simps relation, simps (config := .lemmasOnly) rels]
noncomputable
def baseChange : Presentation T (T ⊗[R] S)

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{T : Type u_1}
[CommRing T]
[Algebra R T]
(P : Algebra.Presentation R S)
(i : P.rels)

P.baseChange.relation i = (MvPolynomial.map (algebraMap R T)) (P.relation i)


@[simp] lemma odd_add_self_one' : Odd (a + (a + 1))


theorem size_le {m n : ℕ} : size m ≤ n ↔ m < 2 ^ n


lemma image2_inter_right (hf : Injective2 f) :
    image2 f s (t ∩ t') = image2 f s t ∩ image2 f s t'

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{f : α → β → γ}
{s : Set α}
{t t' : Set β}
(hf : Function.Injective2 f)

Set.image2 f s (t ∩ t') = Set.image2 f s t ∩ Set.image2 f s t'


@[to_additive (attr := simp)]
theorem image2_div : image2 Div.div s t = s / t


theorem isTotallySeparated_singleton {x} : IsTotallySeparated ({x} : Set α)

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


theorem finSuccEquiv'_last_apply {i : Fin (n + 1)} (h : i ≠ Fin.last n) :
    finSuccEquiv' (Fin.last n) i = Fin.castLT i (Fin.val_lt_last h)

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

(finSuccEquiv' (Fin.last n)) i = some (i.castLT ⋯)


theorem union_left {s'} (h : IsMetricSeparated s t) (h' : IsMetricSeparated s' t) :
    IsMetricSeparated (s ∪ s') t

{X : Type u_1}
[EMetricSpace X]
{s t s' : Set X}
(h : IsMetricSeparated s t)
(h' : IsMetricSeparated s' t)


@[simp]
theorem map_vadd (p : P) (v : V) : f (v +ᵥ p) = f.linearIsometry v +ᵥ f p

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


protected theorem hasBasis_nhds_zero [TopologicalSpace F] [TopologicalAddGroup F] :
    (𝓝 (0 : E →SL[σ] F)).HasBasis
      (fun SV : Set E × Set F => Bornology.IsVonNBounded 𝕜₁ SV.1 ∧ SV.2 ∈ (𝓝 0 : Filter F))
      fun SV => { f : E →SL[σ] F | ∀ x ∈ SV.1, f x ∈ SV.2 }

{𝕜₁ : Type u_1}
{𝕜₂ : Type u_2}
[NormedField 𝕜₁]
[NormedField 𝕜₂]
{σ : 𝕜₁ →+* 𝕜₂}
{E : Type u_4}
{F : Type u_5}
[AddCommGroup E]
[Module 𝕜₁ E]
[AddCommGroup F]
[Module 𝕜₂ F]
[TopologicalSpace E]
[TopologicalSpace F]
[TopologicalAddGroup F]

(𝓝 0).HasBasis (fun SV => Bornology.IsVonNBounded 𝕜₁ SV.1 ∧ SV.2 ∈ 𝓝 0) fun SV => {f | ∀ x ∈ SV.1, f x ∈ SV.2}


theorem Ioc_subset_Icc_self : Ioc a b ⊆ Icc a b


theorem row_weak {μ : YoungDiagram} (T : SemistandardYoungTableau μ) {i j1 j2 : ℕ} (hj : j1 < j2)
    (hcell : (i, j2) ∈ μ) : T i j1 ≤ T i j2


theorem mul_slash_subgroup (k1 k2 : ℤ) (Γ : Subgroup SL(2, ℤ)) (A : Γ) (f g : ℍ → ℂ) :
    (f * g) ∣[k1 + k2] A = f ∣[k1] A * g ∣[k2] A

(k1 k2 : ℤ)
(Γ : Subgroup SL(2, ℤ))
(A : ↥Γ)
(f g : ℍ → ℂ)


@[simp]
theorem coe_bot : ⇑(⊥ : sSupHom α β) = ⊥

{α : Type u_2}
{β : Type u_3}
[SupSet α]


@[to_additive]
protected theorem Set.Finite.multipliable {s : Set β} (hs : s.Finite) (f : β → α) :
    Multipliable (f ∘ (↑) : s → α)

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{s : Set β}
(hs : s.Finite)
(f : β → α)


@[simp]
theorem map_add [DecidableEq ι] (i : ι) (x y : M) :
    f (update v i (x + y)) = f (update v i x) + f (update v i y)

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

f (Function.update v i (x + y)) = f (Function.update v i x) + f (Function.update v i y)


lemma toENatAux_eq_zero {x : Cardinal} : toENatAux x = 0 ↔ x = 0


theorem preimage_image_sigmaMk_of_ne (h : i ≠ j) (s : Set (α j)) :
    Sigma.mk i ⁻¹' (Sigma.mk j '' s) = ∅

{ι : Type u_1}
{α : ι → Type u_3}
{i j : ι}
(h : i ≠ j)
(s : Set (α j))


theorem cons_ne_zero_of_left (h : y ≠ 0) : cons y s ≠ 0

{n : ℕ}
{M : Type u_1}
[Zero M]
{y : M}
{s : Fin n →₀ M}
(h : y ≠ 0)


theorem whiskeringLeftFunctor'_eq :
    whiskeringLeftFunctor' L W E = Localization.whiskeringLeftFunctor L W E ⋙ inducedFunctor _

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
(L : CategoryTheory.Functor C D)
(W : CategoryTheory.MorphismProperty C)
(E : Type u_3)
[CategoryTheory.Category.{u_6, u_3} E]
[L.IsLocalization W]

CategoryTheory.Localization.whiskeringLeftFunctor' L W E =
  (CategoryTheory.Localization.whiskeringLeftFunctor L W E).comp
    (CategoryTheory.inducedFunctor CategoryTheory.FullSubcategory.obj)


@[to_additive isAddCyclic_of_card_nsmul_eq_zero_le]
theorem isCyclic_of_card_pow_eq_one_le : IsCyclic α

(hn : ∀ (n : ℕ), 0 < n → (Finset.filter (fun a => n • a = 0) Finset.univ).card ≤ n)


lemma comap_indep_iff_of_injOn (hf : InjOn f (f ⁻¹' N.E)) :
    (N.comap f).Indep I ↔ N.Indep (f '' I)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{I : Set α}
{N : Matroid β}
(hf : Set.InjOn f (f ⁻¹' N.E))


@[qify_simps] lemma intCast_eq (a b : ℤ) : a = b ↔ (a : ℚ) = (b : ℚ)


@[simp]
lemma map_comp {n₁ n₂ n₁₂ : ℤ} (z₁ : Cochain F G n₁) (z₂ : Cochain G K n₂) (h : n₁ + n₂ = n₁₂)
    (Φ : C ⥤ D) [Φ.Additive] :
    (Cochain.comp z₁ z₂ h).map Φ = Cochain.comp (z₁.map Φ) (z₂.map Φ) h

(z₁ : CochainComplex.HomComplex.Cochain F G n₁)

(z₂ : CochainComplex.HomComplex.Cochain G K n₂)

(z₁.comp z₂ h).map Φ = (z₁.map Φ).comp (z₂.map Φ) h


@[simp]
theorem abs_negOnePow (n : ℤ) : |(n.negOnePow : ℤ)| = 1


theorem isCaratheodory_sum {s : ℕ → Set α} (h : ∀ i, IsCaratheodory m (s i))
    (hd : Pairwise (Disjoint on s)) {t : Set α} :
    ∀ {n}, (∑ i ∈ Finset.range n, m (t ∩ s i)) = m (t ∩ ⋃ i < n, s i)

{α : Type u}
(m : MeasureTheory.OuterMeasure α)
{s : ℕ → Set α}
(h : ∀ (i : ℕ), m.IsCaratheodory (s i))
(hd : Pairwise (Disjoint on s))
{t : Set α}
{n : ℕ}

∑ i ∈ Finset.range n, m (t ∩ s i) = m (t ∩ ⋃ i, ⋃ (_ : i < n), s i)


theorem eventually_nnnorm_sub_lt (x₀ : E) {ε : ℝ≥0} (ε_pos : 0 < ε) :
    ∀ᶠ x in 𝓝 x₀, ‖x - x₀‖₊ < ε

{E : Type u_1}
[SeminormedAddCommGroup E]
(x₀ : E)
{ε : ℝ≥0}
(ε_pos : 0 < ε)


@[simp]
theorem inr_add [AddZeroClass R] [AddZeroClass M] (m₁ m₂ : M) :
    (inr (m₁ + m₂) : tsze R M) = inr m₁ + inr m₂

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

TrivSqZeroExt.inr (m₁ + m₂) = TrivSqZeroExt.inr m₁ + TrivSqZeroExt.inr m₂


@[elementwise, simp]
theorem ofRestrict_invApp {C : Type*} [Category C] (X : SheafedSpace C) {Y : TopCat}
    {f : Y ⟶ TopCat.of X.carrier} (h : OpenEmbedding f) (U : Opens (X.restrict h).carrier) :
    (SheafedSpace.IsOpenImmersion.ofRestrict X h).invApp U = 𝟙 _

{f : Y ⟶ TopCat.of ↑↑X.toPresheafedSpace}

(U : TopologicalSpace.Opens ↑↑(X.restrict h).toPresheafedSpace)

AlgebraicGeometry.SheafedSpace.IsOpenImmersion.invApp (X.ofRestrict h) U =
  𝟙 ((X.restrict h).presheaf.obj (Opposite.op U))


@[simp]
theorem trans_apply (f : r ≼i s) (g : s ≼i t) (a : α) : (f.trans g) a = g (f a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{r : α → α → Prop}
{s : β → β → Prop}
{t : γ → γ → Prop}
(f : r ≼i s)
(g : s ≼i t)
(a : α)


@[simp]
theorem infty_coeFn_pow (f : lp B ∞) (n : ℕ) : ⇑(f ^ n) = (⇑f) ^ n

{I : Type u_3}
{B : I → Type u_4}
[(i : I) → NormedRing (B i)]
[∀ (i : I), NormOneClass (B i)]
(f : ↥(lp B ⊤))
(n : ℕ)


protected theorem Nodup.concat (h : a ∉ l) (h' : l.Nodup) : (l.concat a).Nodup

{α : Type u}
{l : List α}
{a : α}
(h : a ∉ l)
(h' : l.Nodup)


@[simp]
theorem padic_norm_e_of_padicInt (z : ℤ_[p]) : ‖(z : ℚ_[p])‖ = ‖z‖

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


@[simp]
theorem IsTorsionBy.mk_smul (hM : IsTorsionBy R M r) (b : R) (x : M) :
    haveI := hM.hasSMul
    Ideal.Quotient.mk (Ideal.span {r}) b • x = b • x

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{r : R}
(hM : Module.IsTorsionBy R M r)
(b : R)
(x : M)

(Ideal.Quotient.mk (Ideal.span {r})) b • x = b • x


@[simp]
theorem get?_cons_zero (a : α) (s : Seq α) : (cons a s).get? 0 = some a

{α : Type u}
(a : α)
(s : Stream'.Seq α)


@[to_additive (attr := simp)]
lemma mulEquiv_coe_eq {X Y : Type _} [Semigroup X] [Semigroup Y] (e : X ≃* Y) :
    (@DFunLike.coe (Semigrp.of X ⟶ Semigrp.of Y) _ (fun _ => (forget Semigrp).obj _)
      ConcreteCategory.instFunLike (e : X →ₙ* Y) : X → Y) = ↑e

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


theorem localization_map [FormallyUnramified R S] :
    FormallyUnramified Rₘ Sₘ

[IsLocalization (Submonoid.map (algebraMap R S) M) Sₘ]


/-- The length of a list converted from a function is the size of the domain. -/
@[simp]
theorem length_ofFn {n} (f : Fin n → α) : length (ofFn f) = n


/-- The right unitor isomorphism for binary coproducts with the initial object. -/
@[simps]
def coprod.rightUnitor (P : C) : P ⨿ ⊥_ C ≅ P

(CategoryTheory.Limits.coprod.rightUnitor P).hom =
  CategoryTheory.Limits.coprod.desc (𝟙 P) (CategoryTheory.Limits.initial.to P)


@[simp]
theorem coeff_zero_one : coeff 0 (1 : MvPolynomial σ R) = 1

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


@[simp]
theorem comap_coe_atTop : comap toReal atTop = atTop

Filter.comap NNReal.toReal Filter.atTop = Filter.atTop


@[simp]
theorem contMDiffOn_diffeomorph_comp_iff {m} (h : M ≃ₘ^n⟮I, J⟯ N) {f : M' → M} (hm : m ≤ n) {s} :
    ContMDiffOn I' J m (h ∘ f) s ↔ ContMDiffOn I' I m f s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_5}
[TopologicalSpace H]
{H' : Type u_6}
[TopologicalSpace H']
{G : Type u_7}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{N : Type u_11}
[TopologicalSpace N]
[ChartedSpace G N]
{n m : ℕ∞}
(h : M ≃ₘ^n⟮I, J⟯ N)
{f : M' → M}
(hm : m ≤ n)
{s : Set M'}

ContMDiffOn I' J m (⇑h ∘ f) s ↔ ContMDiffOn I' I m f s


theorem isLittleO_const_log_atTop {c : ℝ} : (fun _ => c) =o[atTop] log


/-- If `f` is continuous multilinear, then `f (Σ_{j₁} g₁ j₁, ..., Σ_{jₙ} gₙ jₙ)` is the sum of
`f (g₁ (r 1), ..., gₙ (r n))` where `r` ranges over all functions `r`. This follows from
multilinearity by expanding successively with respect to each coordinate. -/
theorem map_sum [DecidableEq ι] [∀ i, Fintype (α i)] :
    (f fun i => ∑ j, g i j) = ∑ r : ∀ i, α i, f fun i => g i (r i)

{R : Type u}
{ι : Type v}
{M₁ : ι → Type w₁}
{M₂ : Type w₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
[(i : ι) → TopologicalSpace (M₁ i)]
[TopologicalSpace M₂]
(f : ContinuousMultilinearMap R M₁ M₂)
{α : ι → Type u_1}
[Fintype ι]
(g : (i : ι) → α i → M₁ i)
[DecidableEq ι]
[(i : ι) → Fintype (α i)]

(f fun i => ∑ j : α i, g i j) = ∑ r : (i : ι) → α i, f fun i => g i (r i)


/-- The Birkhoff averages of a function `g` over the orbit of a fixed point `x` of `f`
tend to `g x` as `N → ∞`. In fact, they are equal to `g x` for all `N ≠ 0`,
see `Function.IsFixedPt.birkhoffAverage_eq`.

TODO: add a version for a periodic orbit. -/
theorem Function.IsFixedPt.tendsto_birkhoffAverage
    (R : Type*) [DivisionSemiring R] [CharZero R]
    [AddCommMonoid E] [TopologicalSpace E] [Module R E]
    {f : α → α} {x : α} (h : f.IsFixedPt x) (g : α → E) :
    Tendsto (birkhoffAverage R f g · x) atTop (𝓝 (g x))

{α : Type u_1}
{E : Type u_2}
(R : Type u_3)
[DivisionSemiring R]
[CharZero R]
[AddCommMonoid E]
[TopologicalSpace E]
[Module R E]
{f : α → α}
{x : α}
(h : Function.IsFixedPt f x)
(g : α → E)

Filter.Tendsto (fun x_1 => birkhoffAverage R f g x_1 x) Filter.atTop (𝓝 (g x))


@[to_additive (attr := simp)]
theorem hasProd_subtype_mulSupport : HasProd (f ∘ (↑) : mulSupport f → α) a ↔ HasProd f a

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a : α}

HasProd (f ∘ Subtype.val) a ↔ HasProd f a


@[deprecated id (since := "2024-03-23")]
theorem ball_of_forall (h : ∀ x, p x) (x) : p x

{α : Sort u_1}
{p : α → Prop}
(h : ∀ (x : α), p x)
(x : α)


/-- A quadratic map on a module.

For a more familiar constructor when `R` is a ring, see `QuadraticMap.ofPolar`. -/
structure QuadraticMap (R : Type u) (M : Type v) (N : Type w) [CommSemiring R] [AddCommMonoid M]
    [Module R M] [AddCommMonoid N] [Module R N] where
  toFun : M → N
  toFun_smul : ∀ (a : R) (x : M), toFun (a • x) = (a * a) • toFun x
  exists_companion' : ∃ B : BilinMap R M N, ∀ x y, toFun (x + y) = toFun x + toFun y + B x y

{R : Type u}
{M : Type v}
{N : Type w}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
(self : QuadraticMap R M N)

∃ B, ∀ (x y : M), self.toFun (x + y) = self.toFun x + self.toFun y + (B x) y


/-- Euclid's theorem on the **infinitude of primes**.
Here given in the form: for every `n`, there exists a prime number `p ≥ n`. -/
theorem exists_infinite_primes (n : ℕ) : ∃ p, n ≤ p ∧ Prime p


@[simp]
theorem conjAe_coe : ⇑conjAe = conj


/-- The functor from differential graded objects to homological complexes.
-/
@[simps]
def dgoToHomologicalComplex :
    DifferentialObject ℤ (GradedObjectWithShift b V) ⥤
      HomologicalComplex V (ComplexShape.up' b)

(X : CategoryTheory.DifferentialObject ℤ (CategoryTheory.GradedObjectWithShift b V))

((HomologicalComplex.dgoToHomologicalComplex b V).obj X).d i j = if h : i + b = j then X.d i ≫ X.objEqToHom ⋯ else 0


/-- Let `φ : R[x] → S[x]` be an additive map, `k : ℕ` a bound, and `fu : ℕ → ℕ` a
"sufficiently monotone" map.  Assume also that
* `φ` maps to `0` all monomials of degree less than `k`,
* `φ` maps each monomial `m` in `R[x]` to a polynomial `φ m` of degree `fu (deg m)`.
Then, `φ` maps each polynomial `p` in `R[x]` to a polynomial of degree `fu (deg p)`. -/
theorem mono_map_natDegree_eq {S F : Type*} [Semiring S]
    [FunLike F R[X] S[X]] [AddMonoidHomClass F R[X] S[X]] {φ : F}
    {p : R[X]} (k : ℕ) (fu : ℕ → ℕ) (fu0 : ∀ {n}, n ≤ k → fu n = 0)
    (fc : ∀ {n m}, k ≤ n → n < m → fu n < fu m) (φ_k : ∀ {f : R[X]}, f.natDegree < k → φ f = 0)
    (φ_mon_nat : ∀ n c, c ≠ 0 → (φ (monomial n c)).natDegree = fu n) :
    (φ p).natDegree = fu p.natDegree

(fc : ∀ {n m : ℕ}, k ≤ n → n < m → fu n < fu m)

(φ_mon_nat : ∀ (n : ℕ) (c : R), c ≠ 0 → (φ ((Polynomial.monomial n) c)).natDegree = fu n)


theorem min_mul_of_nonneg [MulPosMono α]
    (a b : α) (hc : 0 ≤ c) : min a b * c = min (a * c) (b * c)

{α : Type u}
[Semiring α]
[LinearOrder α]
{c : α}
[MulPosMono α]
(a b : α)
(hc : 0 ≤ c)


theorem C_pow (a : R) (n : ℕ) : (C (a ^ n) : MvPolynomial σ R) = C a ^ n

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(a : R)
(n : ℕ)

MvPolynomial.C (a ^ n) = MvPolynomial.C a ^ n


@[simp]
theorem star_ι (m : M) : star (ι Q m) = -ι Q m

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

star ((CliffordAlgebra.ι Q) m) = -(CliffordAlgebra.ι Q) m


@[simp]
theorem count_apply_lt_top [MeasurableSingletonClass α] : count s < ∞ ↔ s.Finite

{α : Type u_1}
[MeasurableSpace α]
{s : Set α}
[MeasurableSingletonClass α]

MeasureTheory.Measure.count s < ⊤ ↔ s.Finite


theorem ne_top_iff_one : I ≠ ⊤ ↔ (1 : α) ∉ I

I ≠ ⊤ ↔ 1 ∉ I


theorem toIcoMod_eq_toIcoMod : toIcoMod hp a b = toIcoMod hp a c ↔ ∃ n : ℤ, c - b = n • p

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

toIcoMod hp a b = toIcoMod hp a c ↔ ∃ n, c - b = n • p


theorem map_dotProduct [NonAssocSemiring R] [NonAssocSemiring S] (f : R →+* S) (v w : n → R) :
    f (v ⬝ᵥ w) = f ∘ v ⬝ᵥ f ∘ w

{n : Type u_3}
{R : Type u_7}
{S : Type u_8}
[Fintype n]
[NonAssocSemiring R]
[NonAssocSemiring S]
(f : R →+* S)
(v w : n → R)


theorem zero_memℒp : Memℒp (0 : α → E) p μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]


theorem IsMaxOn.localize (hf : IsMaxOn f s a) : IsLocalMaxOn f s a

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


lemma eq_atoms_of_sSup_eq_top (hS : BooleanGenerators S) (h : sSup S = ⊤) :
    S = {a : α | IsAtom a}

(hS : IsCompactlyGenerated.BooleanGenerators S)


@[simp] theorem eventually_all_finset {ι} (I : Finset ι) {l} {p : ι → α → Prop} :
    (∀ᶠ x in l, ∀ i ∈ I, p i x) ↔ ∀ i ∈ I, ∀ᶠ x in l, p i x

{α : Type u}
{ι : Type u_2}
(I : Finset ι)
{l : Filter α}
{p : ι → α → Prop}

(∀ᶠ (x : α) in l, ∀ i ∈ I, p i x) ↔ ∀ i ∈ I, ∀ᶠ (x : α) in l, p i x


theorem ae_empty_or_univ_of_preimage_ae_le (hf : Ergodic f μ) (hs : MeasurableSet s)
    (hs' : f ⁻¹' s ≤ᵐ[μ] s) : s =ᵐ[μ] (∅ : Set α) ∨ s =ᵐ[μ] univ

{α : Type u_1}
{m : MeasurableSpace α}
{f : α → α}
{s : Set α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.IsFiniteMeasure μ]
(hf : Ergodic f μ)
(hs : MeasurableSet s)
(hs' : f ⁻¹' s ≤ᵐ[μ] s)


theorem not_and_of_not_left (b : Prop) : ¬a → ¬(a ∧ b)


/-- In the Vitali family `IsUnifLocDoublingMeasure.vitaliFamily K`, the sets based at `x`
contain all balls `closedBall y r` when `dist x y ≤ K * r`. -/
theorem closedBall_mem_vitaliFamily_of_dist_le_mul {K : ℝ} {x y : α} {r : ℝ} (h : dist x y ≤ K * r)
    (rpos : 0 < r) : closedBall y r ∈ (vitaliFamily μ K).setsAt x

Metric.closedBall y r ∈ (IsUnifLocDoublingMeasure.vitaliFamily μ K).setsAt x


theorem gaugeSeminormFamily_ball (s : AbsConvexOpenSets 𝕜 E) :
    (gaugeSeminormFamily 𝕜 E s).ball 0 1 = (s : Set E)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[AddCommGroup E]
[TopologicalSpace E]
[Module 𝕜 E]
[Module ℝ E]
[IsScalarTower ℝ 𝕜 E]
[ContinuousSMul ℝ E]
(s : AbsConvexOpenSets 𝕜 E)

(gaugeSeminormFamily 𝕜 E s).ball 0 1 = ↑s


/-- The duality equivalence `WalkingSpanᵒᵖ ≌ WalkingCospan` -/
@[simps!]
def walkingSpanOpEquiv : WalkingSpanᵒᵖ ≌ WalkingCospan

{X₁ X₂ : CategoryTheory.Limits.WidePullbackShape CategoryTheory.Limits.WalkingPair}

∀ (a : X₁ ⟶ X₂),
  CategoryTheory.Limits.walkingSpanOpEquiv.inverse.map a =
    CategoryTheory.Limits.widePullbackShapeOpMap CategoryTheory.Limits.WalkingPair X₁ X₂ a


@[simp]
theorem measurableEquivPi_apply (a : ℂ) :
    measurableEquivPi a = ![a.re, a.im]

Complex.measurableEquivPi a = ![a.re, a.im]


theorem closure_union_closure_subset (x y : α) : (l x : Set β) ∪ l y ⊆ l (x ∪ y)

{α : Type u_1}
{β : Type u_4}
[SetLike α β]
(l : LowerAdjoint SetLike.coe)
(x y : α)

↑(l.toFun ↑x) ∪ ↑(l.toFun ↑y) ⊆ ↑(l.toFun (↑x ∪ ↑y))


theorem IsGLB.frequently_mem {a : α} {s : Set α} (ha : IsGLB s a) (hs : s.Nonempty) :
    ∃ᶠ x in 𝓝[≥] a, x ∈ s

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a : α}
{s : Set α}
(ha : IsGLB s a)
(hs : s.Nonempty)


theorem hasEigenvalue_iff_isRoot : f.HasEigenvalue μ ↔ (minpoly K f).IsRoot μ

{K : Type v}
{V : Type w}
[Field K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
{f : Module.End K V}
{μ : K}


/-- The kernel morphism of a monomorphism is a zero morphism -/
theorem kernel.ι_of_mono [HasKernel f] [Mono f] : kernel.ι f = 0


lemma killingForm_restrict_range_ad : (killingForm R 𝔻).restrict 𝕀 = killingForm R 𝕀

(R : Type u_1)
(L : Type u_2)
[Field R]
[LieRing L]
[LieAlgebra R L]
[Module.Finite R L]

(killingForm R (LieDerivation R L L)).restrict (LieDerivation.ad R L).range.toSubmodule =
  killingForm R ↥(LieDerivation.ad R L).range


@[simp]
theorem map_comp_lTensor (f : M →ₗ[R] P) (g : N →ₗ[R] Q) (g' : S →ₗ[R] N) :
    (map f g).comp (g'.lTensor _) = map f (g.comp g')

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

TensorProduct.map f g ∘ₗ LinearMap.lTensor M g' = TensorProduct.map f (g ∘ₗ g')


lemma extend_d_eq {i' j' : ι'} {i j : ι} (hi : e.f i = i') (hj : e.f j = j') :
    (K.extend e).d i' j' = (K.extendXIso e hi).hom ≫ K.d i j ≫
      (K.extendXIso e hj).inv


theorem tan_sq_div_one_add_tan_sq {x : ℂ} (hx : cos x ≠ 0) :
    tan x ^ 2 / (1 + tan x ^ 2) = sin x ^ 2

Complex.tan x ^ 2 / (1 + Complex.tan x ^ 2) = Complex.sin x ^ 2


protected theorem map₂ [Zero δ] (hf : f.FinMeasSupp μ) {g : α →ₛ γ} (hg : g.FinMeasSupp μ)
    {op : β → γ → δ} (H : op 0 0 = 0) : ((pair f g).map (Function.uncurry op)).FinMeasSupp μ

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{m : MeasurableSpace α}
[Zero β]
[Zero γ]
{μ : MeasureTheory.Measure α}
{f : MeasureTheory.SimpleFunc α β}
[Zero δ]
(hf : f.FinMeasSupp μ)
{g : MeasureTheory.SimpleFunc α γ}
(hg : g.FinMeasSupp μ)
{op : β → γ → δ}
(H : op 0 0 = 0)

(MeasureTheory.SimpleFunc.map (Function.uncurry op) (f.pair g)).FinMeasSupp μ


@[simp]
theorem dualRestrict_comp_dualLift (W : Subspace K V) : W.dualRestrict.comp W.dualLift = 1

{K : Type u}
{V : Type v}
[Field K]
[AddCommGroup V]
[Module K V]
(W : Subspace K V)

Submodule.dualRestrict W ∘ₗ W.dualLift = 1


theorem star_eq_inv' : (star : unitary R → unitary R) = Inv.inv


theorem comap_comap (s : AffineSubspace k P₃) (f : P₁ →ᵃ[k] P₂) (g : P₂ →ᵃ[k] P₃) :
    (s.comap g).comap f = s.comap (g.comp f)

{k : Type u_1}
{V₁ : Type u_2}
{P₁ : Type u_3}
{V₂ : Type u_4}
{P₂ : Type u_5}
{V₃ : Type u_6}
{P₃ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
[AddCommGroup V₃]
[Module k V₃]
[AffineSpace V₃ P₃]
(s : AffineSubspace k P₃)
(f : P₁ →ᵃ[k] P₂)
(g : P₂ →ᵃ[k] P₃)

AffineSubspace.comap f (AffineSubspace.comap g s) = AffineSubspace.comap (g.comp f) s


@[simp]
theorem mapAlgHom_coe_ringHom (f : A →ₐ[R] B) :
    ↑(mapAlgHom f : _ →ₐ[R] Polynomial B) = (mapRingHom ↑f : Polynomial A →+* Polynomial B)

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

↑(Polynomial.mapAlgHom f) = Polynomial.mapRingHom ↑f


lemma nontrivial : ∃ r : R, v r ≠ 0 ∧ v r ≠ 1

{R : Type u_1}
[Ring R]
{Γ₀ : Type u_2}
[LinearOrderedCommGroupWithZero Γ₀]
(v : Valuation R Γ₀)
[v.RankOne]


@[simp]
theorem mem_sSup {Us : Set (Opens α)} {x : α} : x ∈ sSup Us ↔ ∃ u ∈ Us, x ∈ u

{α : Type u_2}
[TopologicalSpace α]
{Us : Set (TopologicalSpace.Opens α)}
{x : α}


/-- A closed set `s` is preconnected if and only if for every cover by two closed sets that are
disjoint, it is contained in one of the two covering sets. -/
theorem isPreconnected_iff_subset_of_fully_disjoint_closed {s : Set α} (hs : IsClosed s) :
    IsPreconnected s ↔
      ∀ u v, IsClosed u → IsClosed v → s ⊆ u ∪ v → Disjoint u v → s ⊆ u ∨ s ⊆ v

{α : Type u}
[TopologicalSpace α]
{s : Set α}
(hs : IsClosed s)

IsPreconnected s ↔ ∀ (u v : Set α), IsClosed u → IsClosed v → s ⊆ u ∪ v → Disjoint u v → s ⊆ u ∨ s ⊆ v


@[simp]
theorem mmap_cons {m} [Monad m] {α β} (f : α → m β) (a) :
    ∀ {n} (v : Vector α n),
      mmap f (a ::ᵥ v) = do
        let h' ← f a
        let t' ← mmap f v
        pure (h' ::ᵥ t')

{m : Type u_2 → Type u_3}
[Monad m]
{α : Type u_4}
{β : Type u_2}
(f : α → m β)
(a : α)
{n : ℕ}
(v : Mathlib.Vector α n)

Mathlib.Vector.mmap f (a ::ᵥ v) = do
  let h' ← f a
  let t' ← Mathlib.Vector.mmap f v
  pure (h' ::ᵥ t')


@[simp]
theorem subtype_comp_codRestrict (p : Submodule R₂ M₂) (h : ∀ b, f b ∈ p) :
    p.subtype.comp (codRestrict p f h) = f

{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 R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
(f : M →ₛₗ[σ₁₂] M₂)
(p : Submodule R₂ M₂)
(h : ∀ (b : M), f b ∈ p)

p.subtype.comp (LinearMap.codRestrict p f h) = f


@[to_additive]
theorem eq_empty_or_univ_of_smul_invariant_closed [IsMinimal M α] {s : Set α} (hs : IsClosed s)
    (hsmul : ∀ c : M, c • s ⊆ s) : s = ∅ ∨ s = univ

(M : Type u_1)
{α : Type u_3}
[AddMonoid M]
[TopologicalSpace α]
[AddAction M α]
[AddAction.IsMinimal M α]
{s : Set α}
(hs : IsClosed s)
(hsmul : ∀ (c : M), c +ᵥ s ⊆ s)


/-- The measure of a set under `pure a` is `1` for sets containing `a` and `0` otherwise. -/
@[simp]
theorem toMeasure_pure_apply (hs : MeasurableSet s) :
    (pure a).toMeasure s = if a ∈ s then 1 else 0

{α : Type u_1}
(a : α)
(s : Set α)
[MeasurableSpace α]
(hs : MeasurableSet s)

(PMF.pure a).toMeasure s = if a ∈ s then 1 else 0


@[gcongr] protected theorem add_left (c : ℤ) (h : a ≡ b [ZMOD n]) : c + a ≡ c + b [ZMOD n]

{n a b : ℤ}
(c : ℤ)
(h : a ≡ b [ZMOD n])


@[simp]
theorem disjoint_cons_right {a : α} {s t : Multiset α} :
    Disjoint s (a ::ₘ t) ↔ a ∉ s ∧ Disjoint s t

{α : Type u_1}
{a : α}
{s t : Multiset α}

s.Disjoint (a ::ₘ t) ↔ a ∉ s ∧ s.Disjoint t


@[simp]
theorem bind_const (p : PMF α) (q : PMF β) : (p.bind fun _ => q) = q

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


theorem getElem_cons_length (x : α) (xs : List α) (n : Nat) (h : n = xs.length) :
    (x :: xs)[n]'(by simp [h]) = (x :: xs).getLast (cons_ne_nil x xs)

{α : Type u_1}
(x : α)
(xs : List α)
(n : Nat)
(h : n = xs.length)


theorem dvd_cancelLeads_of_dvd_of_dvd {r : R[X]} (pq : p ∣ q) (pr : p ∣ r) : p ∣ q.cancelLeads r

{R : Type u_1}
[CommRing R]
{p q r : Polynomial R}
(pq : p ∣ q)
(pr : p ∣ r)


@[simp]
theorem comp_apply (f : SupHom β γ) (g : SupHom α β) (a : α) : (f.comp g) a = f (g a)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Sup α]
[Sup β]
[Sup γ]
(f : SupHom β γ)
(g : SupHom α β)
(a : α)


@[simp]
lemma comp_mk₀_id {a : M} (f : ShiftedHom X Y a) (m₀ : M) (hm₀ : m₀ = 0) :
    f.comp (mk₀ m₀ hm₀ (𝟙 Y)) (by rw [hm₀, zero_add]) = f

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
{M : Type u_4}
[AddMonoid M]
[CategoryTheory.HasShift C M]
{X Y : C}
{a : M}
(f : CategoryTheory.ShiftedHom X Y a)
(m₀ : M)
(hm₀ : m₀ = 0)

f.comp (CategoryTheory.ShiftedHom.mk₀ m₀ hm₀ (CategoryTheory.CategoryStruct.id Y)) ⋯ = f


lemma disjiUnion_filter_eq_of_maps_to (h : ∀ x ∈ s, f x ∈ t) :
    t.disjiUnion (fun a ↦ s.filter (f · = a)) pairwiseDisjoint_fibers = s

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{s : Finset α}
{t : Finset β}
{f : α → β}
(h : ∀ x ∈ s, f x ∈ t)

t.disjiUnion (fun a => Finset.filter (fun x => f x = a) s) ⋯ = s


protected theorem lt_add_of_tsub_lt_left (hb : AddLECancellable b) (h : a - b < c) : a < b + c

{α : Type u_1}
[PartialOrder α]
[AddCommSemigroup α]
[Sub α]
[OrderedSub α]
{a b c : α}
(hb : AddLECancellable b)
(h : a - b < c)


/-- Spec, as a contravariant functor from commutative rings to locally ringed spaces.
-/
@[simps]
def Spec.toLocallyRingedSpace : CommRingCat.{u}ᵒᵖ ⥤ LocallyRingedSpace

∀ {X Y : CommRingCatᵒᵖ} (f : X ⟶ Y),
  AlgebraicGeometry.Spec.toLocallyRingedSpace.map f = AlgebraicGeometry.Spec.locallyRingedSpaceMap f.unop


/-- The homotopy between morphisms in `ShortComplex Cᵒᵖ` that is induced by a homotopy
between morphisms in `ShortComplex C`. -/
@[simps]
def op (h : Homotopy φ₁ φ₂) : Homotopy (opMap φ₁) (opMap φ₂)

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

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


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

{C : Type u_1}
[CategoryTheory.Category.{u_4, u_1} C]
{D : Type u_2}
[CategoryTheory.Category.{u_5, u_2} D]
(e : C ≌ D)
[CategoryTheory.Precoherent C]
(A : Type u_3)
[CategoryTheory.Category.{u_6, u_3} A]

∀ {X Y : CategoryTheory.Sheaf (CategoryTheory.coherentTopology D) A} (f : X ⟶ Y) (X_1 : Cᵒᵖ),
  ((e.sheafCongrPrecoherent A).inverse.map f).val.app X_1 = f.val.app (Opposite.op (e.functor.obj (Opposite.unop X_1)))


@[simp] theorem nil_perm {l₁ : List α} : [] ~ l₁ ↔ l₁ = []


lemma toFinite_withDensity_restrict_sigmaFiniteSet (μ : Measure α) [SFinite μ] :
    (μ.toFinite.withDensity
        (fun x ↦ if μ.densityToFinite x ≠ ∞ then μ.densityToFinite x else 1)).restrict
        μ.sigmaFiniteSet
      = μ.restrict μ.sigmaFiniteSet

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

(μ.toFinite.withDensity fun x => if μ.densityToFinite x ≠ ⊤ then μ.densityToFinite x else 1).restrict μ.sigmaFiniteSet =
  μ.restrict μ.sigmaFiniteSet


@[ext]
theorem ext {S T : PointedCone 𝕜 E} (h : ∀ x, x ∈ S ↔ x ∈ T) : S = T

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{S T : PointedCone 𝕜 E}
(h : ∀ (x : E), x ∈ S ↔ x ∈ T)


lemma count_eq_count_filter_add [DecidableEq α] (P : α → Prop) [DecidablePred P]
    (l : List α) (a : α) :
    count a l = count a (l.filter P) + count a (l.filter (¬ P ·))

{α : Type u_1}
[DecidableEq α]
(P : α → Prop)
[DecidablePred P]
(l : List α)
(a : α)

List.count a l =
  List.count a (List.filter (fun b => decide (P b)) l) + List.count a (List.filter (fun x => decide ¬P x) l)


/-- `VectorMeasure.restrict` as an additive monoid homomorphism. -/
@[simps]
def restrictₗ (i : Set α) : VectorMeasure α M →ₗ[R] VectorMeasure α M

{α : Type u_1}
{m : MeasurableSpace α}
{M : Type u_3}
[AddCommMonoid M]
[TopologicalSpace M]
{R : Type u_4}
[Semiring R]
[Module R M]
[ContinuousConstSMul R M]
[ContinuousAdd M]
(i : Set α)
(v : MeasureTheory.VectorMeasure α M)

(MeasureTheory.VectorMeasure.restrictₗ i) v = v.restrict i


theorem Chain'.imp_head {x y} (h : ∀ {z}, R x z → R y z) {l} (hl : Chain' R (x :: l)) :
    Chain' R (y :: l)

{α : Type u}
{R : α → α → Prop}
{x y : α}
(h : ∀ {z : α}, R x z → R y z)
{l : List α}
(hl : List.Chain' R (x :: l))


theorem floor_le_of_le (h : a ≤ n) : ⌊a⌋₊ ≤ n

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a : α}
{n : ℕ}
(h : a ≤ ↑n)


@[simp]
theorem sigmaUnique_symm_apply {β : α → Type*} [∀ a, Unique (β a)] (x : α) :
    (sigmaUnique α β).symm x = ⟨x, default⟩

{α : Type u_2}
{β : α → Type u_1}
[(a : α) → Unique (β a)]
(x : α)

(Equiv.sigmaUnique α β).symm x = ⟨x, default⟩


@[to_additive sum_fiberwise_le_sum_of_sum_fiber_nonneg]
theorem prod_fiberwise_le_prod_of_one_le_prod_fiber' {t : Finset ι'} {g : ι → ι'} {f : ι → N}
    (h : ∀ y ∉ t, (1 : N) ≤ ∏ x ∈ s.filter fun x ↦ g x = y, f x) :
    (∏ y ∈ t, ∏ x ∈ s.filter fun x ↦ g x = y, f x) ≤ ∏ x ∈ s, f x

(h : ∀ y ∉ t, 0 ≤ ∑ x ∈ Finset.filter (fun x => g x = y) s, f x)

∑ y ∈ t, ∑ x ∈ Finset.filter (fun x => g x = y) s, f x ≤ ∑ x ∈ s, f x


protected theorem _root_.Set.PairwiseDisjoint.aedisjoint {f : ι → Set α} {s : Set ι}
    (hf : s.PairwiseDisjoint f) : s.Pairwise (AEDisjoint μ on f)

{ι : Type u_1}
{α : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : ι → Set α}
{s : Set ι}
(hf : s.PairwiseDisjoint f)

s.Pairwise (MeasureTheory.AEDisjoint μ on f)


lemma hasDerivAt_neg_exp_mul_exp {r x : ℝ} :
    HasDerivAt (fun a ↦ -exp (-(r * a))) (r * exp (-(r * x))) x

HasDerivAt (fun a => -rexp (-(r * a))) (r * rexp (-(r * x))) x


theorem dimH_ball_pi_fin {n : ℕ} (x : Fin n → ℝ) {r : ℝ} (hr : 0 < r) :
    dimH (Metric.ball x r) = n


/-- The `Submodule.LinearDisjoint.rank_inf_le_one_of_commute_of_flat`
for commutative rings. -/
theorem rank_inf_le_one_of_flat (hf : Module.Flat R M ∨ Module.Flat R N) :
    Module.rank R ↥(M ⊓ N) ≤ 1

(hf : Module.Flat R ↥M ∨ Module.Flat R ↥N)


theorem HasDerivAt.inv (hc : HasDerivAt c c' x) (hx : c x ≠ 0) :
    HasDerivAt (fun y => (c y)⁻¹) (-c' / c x ^ 2) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{c : 𝕜 → 𝕜}
{c' : 𝕜}
(hc : HasDerivAt c c' x)
(hx : c x ≠ 0)


@[to_additive]
theorem mulIndicator_apply_ne_one {a : α} : s.mulIndicator f a ≠ 1 ↔ a ∈ s ∩ mulSupport f

{α : Type u_1}
{M : Type u_4}
[Zero M]
{s : Set α}
{f : α → M}
{a : α}

s.indicator f a ≠ 0 ↔ a ∈ s ∩ Function.support f


@[simp]
theorem one_apply (m : M) : (1 : MulAut M) m = m


theorem IsPath.reverse {u v : V} {p : G.Walk u v} (h : p.IsPath) : p.reverse.IsPath

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


theorem and_any_distrib_right (l : List α) (p : α → Bool) (q : Bool) :
    (l.any p && q) = l.any fun a => p a && q

{α : Type u_1}
(l : List α)
(p : α → Bool)
(q : Bool)


@[to_additive]
theorem mulDysonETransform.card :
    (mulDysonETransform e x).1.card + (mulDysonETransform e x).2.card = x.1.card + x.2.card

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

(Finset.mulDysonETransform e x).1.card + (Finset.mulDysonETransform e x).2.card = x.1.card + x.2.card


@[simp]
theorem norm_zpow : ∀ (a : α) (n : ℤ), ‖a ^ n‖ = ‖a‖ ^ n

{α : Type u_1}
[NormedDivisionRing α]
(a : α)
(n : ℤ)


lemma tangentCoordChange_def {x y z : M} : tangentCoordChange I x y z =
    fderivWithin 𝕜 (extChartAt I y ∘ (extChartAt I x).symm) (range I) (extChartAt I x z)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_4}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_6}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{x y z : M}

tangentCoordChange I x y z =
  fderivWithin 𝕜 (↑(extChartAt I y) ∘ ↑(extChartAt I x).symm) (Set.range ↑I) (↑(extChartAt I x) z)


theorem Anisotropic.eq_zero_iff {Q : QuadraticMap R M N} (h : Anisotropic Q) {x : M} :
    Q x = 0 ↔ x = 0

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


lemma normal_iff_forall_fieldRange_le : Normal F K ↔ ∀ σ : K →ₐ[F] L, σ.fieldRange ≤ K

{F : Type u_1}
{L : Type u_3}
[Field F]
[Field L]
[Algebra F L]
[Normal F L]
{K : IntermediateField F L}

Normal F ↥K ↔ ∀ (σ : ↥K →ₐ[F] L), σ.fieldRange ≤ K


theorem irreducible_aux1 {k m n : ℕ} (hkm : k < m) (hmn : m < n) (u v w : Units ℤ)
    (hp : p = trinomial k m n (u : ℤ) v w) :
    C (v : ℤ) * (C (u : ℤ) * X ^ (m + n) + C (w : ℤ) * X ^ (n - m + k + n)) =
      ⟨Finsupp.filter (· ∈ Set.Ioo (k + n) (n + n)) (p * p.mirror).toFinsupp⟩

(hp : p = Polynomial.trinomial k m n ↑u ↑v ↑w)

Polynomial.C ↑v * (Polynomial.C ↑u * Polynomial.X ^ (m + n) + Polynomial.C ↑w * Polynomial.X ^ (n - m + k + n)) =
  { toFinsupp := Finsupp.filter (fun x => x ∈ Set.Ioo (k + n) (n + n)) (p * p.mirror).toFinsupp }


/-- If `l` has no duplicates, then `List.get` defines an equivalence between `Fin (length l)` and
the set of elements of `l`. -/
@[simps]
def getEquiv (l : List α) (H : Nodup l) : Fin (length l) ≃ { x // x ∈ l }

{α : Type u_1}
[DecidableEq α]
(l : List α)
(H : l.Nodup)
(i : Fin l.length)

↑((List.Nodup.getEquiv l H) i) = l.get i


theorem Sum.one_le_dist_inr_inl {x : X} {y : Y} : 1 ≤ Sum.dist (.inr y) (.inl x)

{X : Type u}
{Y : Type v}
[MetricSpace X]
[MetricSpace Y]
{x : X}
{y : Y}

1 ≤ Metric.Sum.dist (Sum.inr y) (Sum.inl x)


@[to_additive]
theorem Nonempty.of_smul_right : (s • t).Nonempty → t.Nonempty

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[VAdd α β]
{s : Finset α}
{t : Finset β}


@[simp]
theorem functorPushforward_top (F : C ⥤ D) (X : C) : (⊤ : Sieve X).functorPushforward F = ⊤

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

CategoryTheory.Sieve.functorPushforward F ⊤ = ⊤


theorem card_lt_of_injective_not_surjective (f : α → β) (h : Function.Injective f)
    (h' : ¬Function.Surjective f) : card α < card β

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(f : α → β)
(h : Function.Injective f)
(h' : ¬Function.Surjective f)


@[simp] protected lemma isUnit_iff {n : ℕ} : IsUnit n ↔ n = 1


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

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


@[norm_cast]
theorem WithBot.coe_iSup [Nonempty ι] [SupSet α] {f : ι → α} (hf : BddAbove (range f)) :
    ↑(⨆ i, f i) = (⨆ i, f i : WithBot α)

{α : Type u_1}
{ι : Sort u_4}
[Preorder α]
[Nonempty ι]
[SupSet α]
{f : ι → α}
(hf : BddAbove (Set.range f))


@[to_additive]
theorem le_of_forall_one_lt_lt_mul' (h : ∀ ε : α, 1 < ε → a < b * ε) : a ≤ b

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


theorem isRadical_iff_span_singleton [CommSemiring R] :
    IsRadical y ↔ (Ideal.span ({y} : Set R)).IsRadical

IsRadical y ↔ (Ideal.span {y}).IsRadical


/-- Given natural transformations `F ⟶ F₁` and `F ⟶ F₂`, construct
a natural transformation `F ⟶ prod F₁ F₂`. -/
@[simps]
def prod.lift {F₁ F₂ : C ⥤ Type w} (τ₁ : F ⟶ F₁) (τ₂ : F ⟶ F₂) :
    F ⟶ prod F₁ F₂

{F F₁ F₂ : CategoryTheory.Functor C (Type w)}

(CategoryTheory.FunctorToTypes.prod.lift τ₁ τ₂).app x y = (τ₁.app x y, τ₂.app x y)


/-- When `α` is compact, and `β` is a metric space, the bounded continuous maps `α →ᵇ β` are
isometric to `C(α, β)`.
-/
@[simps! (config := .asFn) toEquiv apply symm_apply]
def isometryEquivBoundedOfCompact : C(α, β) ≃ᵢ (α →ᵇ β)

(α : Type u_1)
(β : Type u_2)
[TopologicalSpace α]
[CompactSpace α]
[MetricSpace β]

(ContinuousMap.isometryEquivBoundedOfCompact α β).toEquiv = ContinuousMap.equivBoundedOfCompact α β


@[simp]
theorem symm_symm : e.symm.symm = e

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(e : P ≃ᵃⁱ[𝕜] P₂)


/-- The equivalence between `Bipointed` and itself induced by `Prod.swap` both ways. -/
@[simps!]
def swapEquiv : Bipointed ≌ Bipointed

∀ {X Y : Bipointed} (f : X ⟶ Y) (a : X.X), (Bipointed.swapEquiv.inverse.map f).toFun a = f.toFun a


theorem preimage_coe_self_inter (s t : Set α) :
    ((↑) : s → α) ⁻¹' (s ∩ t) = ((↑) : s → α) ⁻¹' t

Subtype.val ⁻¹' (s ∩ t) = Subtype.val ⁻¹' t


theorem le_of_lt_minimalPeriod_of_iterate_eq {m n : ℕ} (hm : m < minimalPeriod f x)
    (hmn : f^[m] x = f^[n] x) : m ≤ n

{α : Type u_1}
{f : α → α}
{x : α}
{m n : ℕ}
(hm : m < Function.minimalPeriod f x)
(hmn : f^[m] x = f^[n] x)


protected theorem id_traverse {α} (xs : List α) : List.traverse (pure : α → Id α) xs = xs


theorem le_tsub_add_add : a + b ≤ a - c + (b + c)

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


theorem length_take_of_le (h : n ≤ length l) : length (take n l) = n

∀ {α : Type u_1} {l : List α}, n ≤ l.length → (List.take n l).length = n


theorem le_trans' : b ≤ c → a ≤ b → a ≤ c


theorem eraseLead_support (f : R[X]) : f.eraseLead.support = f.support.erase f.natDegree


theorem nonneg_iff_zero_le {a : ℤ√d} : Nonneg a ↔ 0 ≤ a


lemma StarAlgebra.adjoin_nonUnitalStarSubalgebra (s : Set A) :
    adjoin R (NonUnitalStarAlgebra.adjoin R s : Set A) = adjoin R s

(R : Type u_1)
{A : Type u_2}
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarRing A]
[Algebra R A]
[StarModule R A]
(s : Set A)

StarAlgebra.adjoin R ↑(NonUnitalStarAlgebra.adjoin R s) = StarAlgebra.adjoin R s


lemma eventually_r_lt_n : ∀ᶠ (n : ℕ) in atTop, ∀ i, r i n < n

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

∀ᶠ (n : ℕ) in Filter.atTop, ∀ (i : α), r i n < n


theorem mk_mem_sigmaLift (f : ∀ ⦃i⦄, α i → β i → Finset (γ i)) (i : ι) (a : α i) (b : β i)
    (x : γ i) : (⟨i, x⟩ : Sigma γ) ∈ sigmaLift f ⟨i, a⟩ ⟨i, b⟩ ↔ x ∈ f a b

(f : ⦃i : ι⦄ → α i → β i → Finset (γ i))

⟨i, x⟩ ∈ Finset.sigmaLift f ⟨i, a⟩ ⟨i, b⟩ ↔ x ∈ f a b


theorem inf {I J : Ideal A} (HI : I.IsHomogeneous 𝒜) (HJ : J.IsHomogeneous 𝒜) :
    (I ⊓ J).IsHomogeneous 𝒜

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[Semiring A]
[DecidableEq ι]
[AddMonoid ι]
[SetLike σ A]
[AddSubmonoidClass σ A]
{𝒜 : ι → σ}
[GradedRing 𝒜]
{I J : Ideal A}
(HI : Ideal.IsHomogeneous 𝒜 I)
(HJ : Ideal.IsHomogeneous 𝒜 J)


@[simp] lemma divNat_zero (n : ℕ) : divNat n 0 = 0


lemma toFinite_absolutelyContinuous (μ : Measure α) [SFinite μ] : μ.toFinite ≪ μ

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


@[simp]
theorem convexJoin_singleton_right (s : Set E) (y : E) :
    convexJoin 𝕜 s {y} = ⋃ x ∈ s, segment 𝕜 x y

{𝕜 : Type u_2}
{E : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
(s : Set E)
(y : E)


theorem one_sub_K_pos' (hf : ContractingWith K f) : (0 : ℝ≥0∞) < 1 - K

{α : Type u_1}
[EMetricSpace α]
{K : ℝ≥0}
{f : α → α}
(hf : ContractingWith K f)


theorem finite_sUnion_mem_iff {s : Set (Set α)} (hs : s.Finite) : ⋃₀ s ∈ f ↔ ∃ t ∈ s, t ∈ f

{α : Type u}
{f : Ultrafilter α}
{s : Set (Set α)}
(hs : s.Finite)

⋃₀ s ∈ f ↔ ∃ t ∈ s, t ∈ f


@[simp]
theorem cancel_right {g₁ g₂ : InfHom β γ} {f : InfHom α β} (hf : Surjective f) :
    g₁.comp f = g₂.comp f ↔ g₁ = g₂

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Inf α]
[Inf β]
[Inf γ]
{g₁ g₂ : InfHom β γ}
{f : InfHom α β}
(hf : Function.Surjective ⇑f)


/-- Lebesgue decomposition of a finite kernel `κ` with respect to another one `η`.
`κ` is the sum of an abolutely continuous part `withDensity η (rnDeriv κ η)` and a singular part
`singularPart κ η`. -/
lemma rnDeriv_add_singularPart (κ η : Kernel α γ) [IsFiniteKernel κ] [IsFiniteKernel η] :
    withDensity η (rnDeriv κ η) + singularPart κ η = κ

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]

η.withDensity (κ.rnDeriv η) + κ.singularPart η = κ


@[simp]
theorem coe_single [DecidableEq ι] (i : ι) : ⇑(single i : φ i →ₗ[R] (i : ι) → φ i) = Pi.single i

{R : Type u}
{ι : Type x}
[Semiring R]
{φ : ι → Type i}
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
[DecidableEq ι]
(i : ι)


theorem HasAntitoneBasis.eventually_subset [Preorder ι] {l : Filter α} {s : ι → Set α}
    (hl : l.HasAntitoneBasis s) {t : Set α} (ht : t ∈ l) : ∀ᶠ i in atTop, s i ⊆ t

{ι : Type u_1}
{α : Type u_3}
[Preorder ι]
{l : Filter α}
{s : ι → Set α}
(hl : l.HasAntitoneBasis s)
{t : Set α}
(ht : t ∈ l)


theorem _root_.fourierIntegral_gaussian_innerProductSpace (hb : 0 < b.re) (w : V) :
    𝓕 (fun v ↦ cexp (- b * ‖v‖^2)) w =
      (π / b) ^ (FiniteDimensional.finrank ℝ V / 2 : ℂ) * cexp (-π ^ 2 * ‖w‖^2 / b)

{b : ℂ}
{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[FiniteDimensional ℝ V]
[MeasurableSpace V]
[BorelSpace V]
(hb : 0 < b.re)
(w : V)

𝓕 (fun v => cexp (-b * ↑‖v‖ ^ 2)) w = (↑π / b) ^ (↑(FiniteDimensional.finrank ℝ V) / 2) * cexp (-↑π ^ 2 * ↑‖w‖ ^ 2 / b)


theorem self_le_toNat (a : Int) : a ≤ toNat a


theorem Icc_subset_Iio_iff (h₁ : a₁ ≤ b₁) : Icc a₁ b₁ ⊆ Iio b₂ ↔ b₁ < b₂

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


/-- The following statement says that summing over `N`-smooth numbers
for large enough `N` gets us arbitrarily close to the sum over all natural numbers
(assuming `f` is norm-summable and `f 0 = 0`; the latter since `0` is not smooth). -/
lemma norm_tsum_smoothNumbers_sub_tsum_lt (hsum : Summable f) (hf₀ : f 0 = 0)
    {ε : ℝ} (εpos : 0 < ε) :
    ∃ N₀ : ℕ, ∀ N ≥ N₀, ‖(∑' m : ℕ, f m) - ∑' m : N.smoothNumbers, f m‖ < ε

{R : Type u_1}
[NormedCommRing R]
[CompleteSpace R]
{f : ℕ → R}
(hsum : Summable f)
(hf₀ : f 0 = 0)
{ε : ℝ}
(εpos : 0 < ε)

∃ N₀, ∀ N ≥ N₀, ‖∑' (m : ℕ), f m - ∑' (m : ↑N.smoothNumbers), f ↑m‖ < ε


@[simp, push_cast] theorem coe_pow (f : G →+c[a, a] G) (n : ℕ) : ⇑(f ^ n) = f^[n]

{G : Type u_1}
[Add G]
{a : G}
(f : AddConstMap G G a a)
(n : ℕ)


@[simp] lemma cast_eq_one : (n : α) = 1 ↔ n = 1

{α : Type u_3}
[AddGroupWithOne α]
[CharZero α]
{n : ℤ}


@[simp] theorem toNat_sub_toNat_neg : ∀ n : Int, ↑n.toNat - ↑(-n).toNat = n


lemma ιTotalOrZero_eq_zero (i₁ : I₁) (i₂ : I₂) (i₁₂ : I₁₂)
    (h : ComplexShape.π c₁ c₂ c₁₂ (i₁, i₂) ≠ i₁₂) :
    K.ιTotalOrZero c₁₂ i₁ i₂ i₁₂ = 0

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Preadditive C]
{I₁ : Type u_2}
{I₂ : Type u_3}
{I₁₂ : Type u_4}
{c₁ : ComplexShape I₁}
{c₂ : ComplexShape I₂}
(K : HomologicalComplex₂ C c₁ c₂)
(c₁₂ : ComplexShape I₁₂)
[DecidableEq I₁₂]
[TotalComplexShape c₁ c₂ c₁₂]
[K.HasTotal c₁₂]
(i₁ : I₁)
(i₂ : I₂)
(i₁₂ : I₁₂)
(h : c₁.π c₂ c₁₂ (i₁, i₂) ≠ i₁₂)


theorem rotate_mod (l : List α) (n : ℕ) : l.rotate (n % l.length) = l.rotate n


@[simp]
theorem mem_ssubsets {s t : Finset α} : t ∈ s.ssubsets ↔ t ⊂ s

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


theorem pow_apply_mem_toList_iff_mem_support {n : ℕ} : (p ^ n) x ∈ p.toList x ↔ x ∈ p.support

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{p : Equiv.Perm α}
{x : α}
{n : ℕ}


/-- Convex **Jensen's inequality** where an element plays a distinguished role. -/
lemma ConvexOn.map_add_sum_le (hf : ConvexOn 𝕜 s f) (h₀ : ∀ i ∈ t, 0 ≤ w i)
    (h₁ : v + ∑ i ∈ t, w i = 1) (hmem : ∀ i ∈ t, p i ∈ s) (hv : 0 ≤ v) (hq : q ∈ s) :
    f (v • q + ∑ i ∈ t, w i • p i) ≤ v • f q + ∑ i ∈ t, w i • f (p i)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
{ι : Type u_5}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[OrderedAddCommGroup β]
[Module 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
{t : Finset ι}
{w : ι → 𝕜}
{p : ι → E}
{v : 𝕜}
{q : E}
(hf : ConvexOn 𝕜 s f)
(h₀ : ∀ i ∈ t, 0 ≤ w i)
(h₁ : v + ∑ i ∈ t, w i = 1)
(hmem : ∀ i ∈ t, p i ∈ s)
(hv : 0 ≤ v)
(hq : q ∈ s)


@[simp]
theorem map_id (S : NonUnitalStarSubalgebra R A) : map (NonUnitalStarAlgHom.id R A) S = S

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[Star A]
(S : NonUnitalStarSubalgebra R A)

NonUnitalStarSubalgebra.map (NonUnitalStarAlgHom.id R A) S = S


/-- The evaluation map is not generally multiplicative when the coefficient ring is noncommutative,
but nevertheless any polynomial of the form `p * (X - monomial 0 r)` is sent to zero
when evaluated at `r`.

This is the key step in our proof of the Cayley-Hamilton theorem.
-/
theorem eval_mul_X_sub_C {p : R[X]} (r : R) : (p * (X - C r)).eval r = 0

{R : Type u}
[Ring R]
{p : R[X]}
(r : R)

Polynomial.eval r (p * (Polynomial.X - Polynomial.C r)) = 0


@[simp]
theorem smul_units_def (f : A →ₐ[R] A) (x : Aˣ) :
    f • x = Units.map (f : A →* A) x

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


theorem lintegral_withDensity (κ : Kernel α β) [IsSFiniteKernel κ]
    (hf : Measurable (Function.uncurry f)) (a : α) {g : β → ℝ≥0∞} (hg : Measurable g) :
    ∫⁻ b, g b ∂withDensity κ f a = ∫⁻ b, f a b * g b ∂κ a

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

∫⁻ (b : β), g b ∂(κ.withDensity f) a = ∫⁻ (b : β), f a b * g b ∂κ a


@[to_additive]
theorem orbit_smul_subset (m : M) (a : α) : orbit M (m • a) ⊆ orbit M a

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

AddAction.orbit M (m +ᵥ a) ⊆ AddAction.orbit M a


@[simp]
theorem map_symm_map (e : α ≃ᵐ β) : (μ.map e).map e.symm = μ

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
(e : α ≃ᵐ β)

MeasureTheory.Measure.map (⇑e.symm) (MeasureTheory.Measure.map (⇑e) μ) = μ


theorem aecover_Ioc_of_Ioc (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B)) :
    AECover (μ.restrict <| Ioc A B) l fun i => Ioc (a i) (b i)

{α : Type u_1}
{ι : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
[OpensMeasurableSpace α]
{a b : ι → α}
{A B : α}
[MeasureTheory.NoAtoms μ]
(ha : Filter.Tendsto a l (𝓝 A))
(hb : Filter.Tendsto b l (𝓝 B))

MeasureTheory.AECover (μ.restrict (Set.Ioc A B)) l fun i => Set.Ioc (a i) (b i)


@[to_additive]
theorem characteristic_iff_map_eq : H.Characteristic ↔ ∀ ϕ : G ≃* G, H.map ϕ.toMonoidHom = H

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

H.Characteristic ↔ ∀ (ϕ : G ≃+ G), AddSubgroup.map ϕ.toAddMonoidHom H = H


theorem sInf_image {s : Set β} {f : β → α} : sInf (f '' s) = ⨅ a ∈ s, f a

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
{s : Set β}
{f : β → α}


/-- Change a cone on `F.leftOp : Jᵒᵖ ⥤ C` to a cocone on `F : J ⥤ Cᵒᵖ`. -/
@[simps pt]
def coconeOfConeLeftOp (c : Cone F.leftOp) : Cocone F

(c : CategoryTheory.Limits.Cone F.leftOp)

(CategoryTheory.Limits.coconeOfConeLeftOp c).pt = Opposite.op c.pt


theorem isNilpotent_iff_exists_self_le_ucs :
    LieModule.IsNilpotent R L N ↔ ∃ k, N ≤ (⊥ : LieSubmodule R L M).ucs k

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

LieModule.IsNilpotent R L ↥↑N ↔ ∃ k, N ≤ LieSubmodule.ucs k ⊥


theorem pmap_prev_eq_rotate_length_sub_one (h : Nodup l) :
    (l.pmap l.prev fun _ h => h) = l.rotate (l.length - 1)

{α : Type u_1}
[DecidableEq α]
(l : List α)
(h : l.Nodup)

List.pmap l.prev l ⋯ = l.rotate (l.length - 1)


/-- A function that is bounded on a box `I` and a.e. continuous is integrable on `I`.

This is a version of `integrable_of_bounded_and_ae_continuousWithinAt` with a stronger continuity
assumption so that the user does not need to specialize the continuity assumption to each box on
which the theorem is to be applied. -/
theorem integrable_of_bounded_and_ae_continuous [CompleteSpace E] {I : Box ι} {f : ℝⁿ → E}
    (hb : ∃ C : ℝ, ∀ x ∈ Box.Icc I, ‖f x‖ ≤ C) (μ : Measure ℝⁿ) [IsLocallyFiniteMeasure μ]
    (hc : ∀ᵐ x ∂μ, ContinuousAt f x) : Integrable I l f μ.toBoxAdditive.toSMul

(hb : ∃ C, ∀ x ∈ BoxIntegral.Box.Icc I, ‖f x‖ ≤ C)

(hc : ∀ᵐ (x : ι → ℝ) ∂μ, ContinuousAt f x)

BoxIntegral.Integrable I l f μ.toBoxAdditive.toSMul


theorem Ioc_toDual : Ioc (toDual a) (toDual b) = (Ico b a).map toDual.toEmbedding

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

Finset.Ioc (OrderDual.toDual a) (OrderDual.toDual b) = Finset.map OrderDual.toDual.toEmbedding (Finset.Ico b a)


theorem eq_nat_or_neg (a : Int) : ∃ n : Nat, a = n ∨ a = -↑n


@[simp] theorem gcd_mul_left_left (m n : Nat) : gcd (m * n) n = n


theorem kernel_zero_of_nonzero_from_simple {X Y : C} [Simple X] {f : X ⟶ Y} [HasKernel f]
    (w : f ≠ 0) : kernel.ι f = 0


/-- The `Field.finSepDegree F E` is equal to the cardinality of `E →ₐ[F] K` as a natural number,
when `E / F` is algebraic and `K / F` is algebraically closed. -/
theorem finSepDegree_eq_of_isAlgClosed [Algebra.IsAlgebraic F E] [IsAlgClosed K] :
    finSepDegree F E = Nat.card (E →ₐ[F] K)

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(K : Type w)
[Field K]
[Algebra F K]
[Algebra.IsAlgebraic F E]
[IsAlgClosed K]

Field.finSepDegree F E = Nat.card (E →ₐ[F] K)


@[to_additive]
theorem TopologicalGroup.t2Space_iff_one_closed : T2Space G ↔ IsClosed ({1} : Set G)

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]


/-- The `Char` Type represents an unicode scalar value.
    See http://www.unicode.org/glossary/#unicode_scalar_value). -/
structure Char where
  /-- The underlying unicode scalar value as a `UInt32`. -/
  val   : UInt32
  /-- The value must be a legal codepoint. -/
  valid : val.isValidChar


/-- `algebraMap R A` as a `StarAlgHom` when `A` is a star algebra over `R`. -/
@[simps]
def ofId (R A : Type*) [CommSemiring R] [StarRing R] [Semiring A] [StarMul A]
    [Algebra R A] [StarModule R A] : R →⋆ₐ[R] A

(R : Type u_7)
(A : Type u_8)
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarMul A]
[Algebra R A]
[StarModule R A]
(a : R)

(StarAlgHom.ofId R A) a = (algebraMap R A) a


theorem strictMono_dual_iff : StrictMono (toDual ∘ f ∘ ofDual : αᵒᵈ → βᵒᵈ) ↔ StrictMono f

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

StrictMono (⇑OrderDual.toDual ∘ f ∘ ⇑OrderDual.ofDual) ↔ StrictMono f


@[simp] lemma initSeg_nonempty : (initSeg s).Nonempty

{α : Type u_1}
[LinearOrder α]
{s : Finset α}
[Fintype α]


/-- In a category with pullbacks, a morphism `f : X ⟶ Y` induces a functor `Over Y ⥤ Over X`,
by pulling back a morphism along `f`. -/
@[simps! (config := { simpRhs := true}) obj_left obj_hom map_left]
def pullback {X Y : C} (f : X ⟶ Y) : Over Y ⥤ Over X

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasPullbacks C]
{X Y : C}
(f : X ⟶ Y)
(g : CategoryTheory.Over Y)
{h : CategoryTheory.Over Y}
{k : g ⟶ h}

((CategoryTheory.Over.pullback f).map k).left =
  CategoryTheory.Limits.pullback.lift
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.pullback.fst g.hom f) k.left)
    (CategoryTheory.Limits.pullback.snd g.hom f) ⋯


@[to_additive]
theorem _root_.Fintype.prod_eq_mul_prod_compl [DecidableEq α] [Fintype α] (a : α) (f : α → β) :
    ∏ i, f i = f a * ∏ i ∈ {a}ᶜ, f i

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
[DecidableEq α]
[Fintype α]
(a : α)
(f : α → β)


theorem bneTrueOfEqFalse {a b : Nat} (p : (a = b) = False) : (a != b) = true


@[to_additive]
theorem div_lt_iff_lt_mul' : a / b < c ↔ a < b * c

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


theorem map_le_iff_le_comap : map f N ≤ N' ↔ N ≤ comap f N'

{R : Type u}
{L : Type v}
{M : Type w}
{M' : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[AddCommGroup M']
[Module R M']
[LieRingModule L M']
{f : M →ₗ⁅R,L⁆ M'}
{N : LieSubmodule R L M}
{N' : LieSubmodule R L M'}

LieSubmodule.map f N ≤ N' ↔ N ≤ LieSubmodule.comap f N'


@[simp] theorem atLeastTwo_false_left  : atLeastTwo false b c = (b && c)


/-- **Phragmen-Lindelöf principle** in a strip `U = {z : ℂ | a < im z < b}`.
Let `f : ℂ → E` be a function such that

* `f` is differentiable on `U` and is continuous on its closure;
* `‖f z‖` is bounded from above by `A * exp(B * exp(c * |re z|))` on `U` for some `c < π / (b - a)`;
* `‖f z‖` is bounded from above by a constant `C` on the boundary of `U`.

Then `‖f z‖` is bounded by the same constant on the closed strip
`{z : ℂ | a ≤ im z ≤ b}`. Moreover, it suffices to verify the second assumption
only for sufficiently large values of `|re z|`.
-/
theorem horizontal_strip (hfd : DiffContOnCl ℂ f (im ⁻¹' Ioo a b))
    (hB : ∃ c < π / (b - a), ∃ B, f =O[comap (_root_.abs ∘ re) atTop ⊓ 𝓟 (im ⁻¹' Ioo a b)]
      fun z ↦ expR (B * expR (c * |z.re|)))
    (hle_a : ∀ z : ℂ, im z = a → ‖f z‖ ≤ C) (hle_b : ∀ z, im z = b → ‖f z‖ ≤ C) (hza : a ≤ im z)
    (hzb : im z ≤ b) : ‖f z‖ ≤ C

(hfd : DiffContOnCl ℂ f (Complex.im ⁻¹' Set.Ioo a b))

(hB :
  ∃ c < π / (b - a),
    ∃ B,
      f =O[Filter.comap (abs ∘ Complex.re) Filter.atTop ⊓ 𝓟 (Complex.im ⁻¹' Set.Ioo a b)] fun z =>
        expR (B * expR (c * |z.re|)))

(hle_a : ∀ (z : ℂ), z.im = a → ‖f z‖ ≤ C)

(hle_b : ∀ (z : ℂ), z.im = b → ‖f z‖ ≤ C)


@[simp, norm_cast] lemma im_nnratCast (q : ℚ≥0) : (q : ℂ).im = 0


/-- The determinant of a 2×2 block matrix with the lower-left block equal to zero is the product of
the determinants of the diagonal blocks. For the generalization to any number of blocks, see
`Matrix.det_of_upper_triangular`. -/
@[simp]
theorem det_fromBlocks_zero₂₁ (A : Matrix m m R) (B : Matrix m n R) (D : Matrix n n R) :
    (Matrix.fromBlocks A B 0 D).det = A.det * D.det

{m : Type u_1}
{n : Type u_2}
[DecidableEq n]
[Fintype n]
[DecidableEq m]
[Fintype m]
{R : Type v}
[CommRing R]
(A : Matrix m m R)
(B : Matrix m n R)
(D : Matrix n n R)


@[simp]
theorem mem_support {x : α} : x ∈ f.support ↔ f x ≠ x

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{f : Equiv.Perm α}
{x : α}


theorem subtypeEquivSubtypePerm_apply_of_mem (f : Perm (Subtype p)) (h : p a) :
    -- Porting note: was `Perm.subtypeEquivSubtypePerm p f a`
    ((Perm.subtypeEquivSubtypePerm p).toFun f).1 a = f ⟨a, h⟩

{α : Type u}
{p : α → Prop}
[DecidablePred p]
{a : α}
(f : Equiv.Perm (Subtype p))
(h : p a)

↑((Equiv.Perm.subtypeEquivSubtypePerm p).toFun f) a = ↑(f ⟨a, h⟩)


/-- The equivalence of categories from the order dual of a preordered type `X`
to the opposite category of the preorder `X`. -/
@[simps]
def orderDualEquivalence : Xᵒᵈ ≌ Xᵒᵖ

(CategoryTheory.orderDualEquivalence X).inverse.obj x = OrderDual.toDual (Opposite.unop x)


@[simp]
theorem coe_of {X : Type*} (toTwoPointing : TwoPointing X) : ↥(of toTwoPointing) = X

{X : Type u_3}
(toTwoPointing : TwoPointing X)


/-- **Minkowski inequality**: the `L_p` seminorm of the infinite sum of two vectors is less than or
equal to the infinite sum of the `L_p`-seminorms of the summands, if these infinite sums both
exist. A version for `ℝ`-valued functions. For an alternative version, convenient if the infinite
sums are already expressed as `p`-th powers, see `Lp_add_le_hasSum_of_nonneg`. -/
theorem Lp_add_le_tsum_of_nonneg (hp : 1 ≤ p) (hf : ∀ i, 0 ≤ f i) (hg : ∀ i, 0 ≤ g i)
    (hf_sum : Summable fun i => f i ^ p) (hg_sum : Summable fun i => g i ^ p) :
    (Summable fun i => (f i + g i) ^ p) ∧
      (∑' i, (f i + g i) ^ p) ^ (1 / p) ≤
        (∑' i, f i ^ p) ^ (1 / p) + (∑' i, g i ^ p) ^ (1 / p)

{ι : Type u}
{f g : ι → ℝ}
{p : ℝ}
(hp : 1 ≤ p)
(hf : ∀ (i : ι), 0 ≤ f i)
(hg : ∀ (i : ι), 0 ≤ g i)
(hf_sum : Summable fun i => f i ^ p)
(hg_sum : Summable fun i => g i ^ p)


theorem eLpNorm'_sum_le {ι} {f : ι → α → E} {s : Finset ι}
    (hfs : ∀ i, i ∈ s → AEStronglyMeasurable (f i) μ) (hq1 : 1 ≤ q) :
    eLpNorm' (∑ i ∈ s, f i) q μ ≤ ∑ i ∈ s, eLpNorm' (f i) q μ

(hfs : ∀ i ∈ s, MeasureTheory.AEStronglyMeasurable (f i) μ)

MeasureTheory.eLpNorm' (∑ i ∈ s, f i) q μ ≤ ∑ i ∈ s, MeasureTheory.eLpNorm' (f i) q μ


theorem eval₂_dvd : p ∣ q → eval₂ f x p ∣ eval₂ f x q

{R : Type u}
{S : Type v}
[Semiring R]
{p q : R[X]}
[CommSemiring S]
(f : R →+* S)
(x : S)

p ∣ q → Polynomial.eval₂ f x p ∣ Polynomial.eval₂ f x q


/-- Given an action `μ` of a Type `M` on a Type `N` and a relation `r` on `N`, informally, the
`CovariantClass` says that "the action `μ` preserves the relation `r`."

More precisely, the `CovariantClass` is a class taking two Types `M N`, together with an "action"
`μ : M → N → N` and a relation `r : N → N → Prop`.  Its unique field `elim` is the assertion that
for all `m ∈ M` and all elements `n₁, n₂ ∈ N`, if the relation `r` holds for the pair
`(n₁, n₂)`, then, the relation `r` also holds for the pair `(μ m n₁, μ m n₂)`,
obtained from `(n₁, n₂)` by acting upon it by `m`.

If `m : M` and `h : r n₁ n₂`, then `CovariantClass.elim m h : r (μ m n₁) (μ m n₂)`.
-/
class CovariantClass : Prop where
  /-- For all `m ∈ M` and all elements `n₁, n₂ ∈ N`, if the relation `r` holds for the pair
  `(n₁, n₂)`, then, the relation `r` also holds for the pair `(μ m n₁, μ m n₂)` -/
  protected elim : Covariant M N μ r

{M : Type u_1}
{N : Type u_2}
{μ : M → N → N}
{r : N → N → Prop}
[self : CovariantClass M N μ r]


theorem symmetric_codisjoint : Symmetric (Codisjoint : α → α → Prop)

{α : Type u_1}
[PartialOrder α]
[OrderTop α]


theorem NullMeasurableSet.mono (h : NullMeasurableSet s μ) (hle : ν ≤ μ) : NullMeasurableSet s ν

(h : MeasureTheory.NullMeasurableSet s μ)


theorem isConnected_Ioc (h : a < b) : IsConnected (Ioc a b)

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{a b : α}
(h : a < b)


@[simp]
theorem prod_eq_top : s ×ˢ t = ⊤ ↔ s = ⊤ ∨ t = ⊤

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{s : UpperSet α}
{t : UpperSet β}

s ×ˢ t = ⊤ ↔ s = ⊤ ∨ t = ⊤


theorem TopologicalRing.of_nhds_zero
    (hadd : Tendsto (uncurry ((· + ·) : R → R → R)) (𝓝 0 ×ˢ 𝓝 0) <| 𝓝 0)
    (hneg : Tendsto (fun x => -x : R → R) (𝓝 0) (𝓝 0))
    (hmul : Tendsto (uncurry ((· * ·) : R → R → R)) (𝓝 0 ×ˢ 𝓝 0) <| 𝓝 0)
    (hmul_left : ∀ x₀ : R, Tendsto (fun x : R => x₀ * x) (𝓝 0) <| 𝓝 0)
    (hmul_right : ∀ x₀ : R, Tendsto (fun x : R => x * x₀) (𝓝 0) <| 𝓝 0)
    (hleft : ∀ x₀ : R, 𝓝 x₀ = map (fun x => x₀ + x) (𝓝 0)) : TopologicalRing R

(hadd : Filter.Tendsto (Function.uncurry fun x x_1 => x + x_1) (𝓝 0 ×ˢ 𝓝 0) (𝓝 0))

(hneg : Filter.Tendsto (fun x => -x) (𝓝 0) (𝓝 0))

(hmul : Filter.Tendsto (Function.uncurry fun x x_1 => x * x_1) (𝓝 0 ×ˢ 𝓝 0) (𝓝 0))

(hmul_left : ∀ (x₀ : R), Filter.Tendsto (fun x => x₀ * x) (𝓝 0) (𝓝 0))

(hmul_right : ∀ (x₀ : R), Filter.Tendsto (fun x => x * x₀) (𝓝 0) (𝓝 0))

(hleft : ∀ (x₀ : R), 𝓝 x₀ = Filter.map (fun x => x₀ + x) (𝓝 0))


theorem ofLE_refl_apply (a : A) : ofLE (le_refl A) a = a

{X : Type u_2}
[TopologicalSpace X]
{A : DiscreteQuotient X}
(a : Quotient A.toSetoid)


@[simp, norm_cast]
theorem coe_bracket (x : L) (m : N) : (↑⁅x, m⁆ : M) = ⁅x, ↑m⁆

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(N : LieSubmodule R L M)
(x : L)
(m : ↥N)


theorem mul_left_mono : Monotone (a * ·)


@[simp]
theorem map_comp_inrHom (f : M →ₗ[R'] N) :
    (map f).toLinearMap ∘ₗ inrHom R' M = inrHom R' N ∘ₗ f

{R' : Type u}
{M : Type v}
[CommSemiring R']
[AddCommMonoid M]
[Module R' M]
[Module R'ᵐᵒᵖ M]
[IsCentralScalar R' M]
{N : Type u_3}
[AddCommMonoid N]
[Module R' N]
[Module R'ᵐᵒᵖ N]
[IsCentralScalar R' N]
(f : M →ₗ[R'] N)

(TrivSqZeroExt.map f).toLinearMap ∘ₗ TrivSqZeroExt.inrHom R' M = TrivSqZeroExt.inrHom R' N ∘ₗ f


theorem eq_leadingCoeff_mul_of_monic_of_dvd_of_natDegree_le {R} [CommRing R] {p q : R[X]}
    (hp : p.Monic) (hdiv : p ∣ q) (hdeg : q.natDegree ≤ p.natDegree) :
    q = C q.leadingCoeff * p

{R : Type u_1}
[CommRing R]
{p q : R[X]}
(hp : p.Monic)
(hdiv : p ∣ q)
(hdeg : q.natDegree ≤ p.natDegree)


@[simp]
theorem abs_mul (x y : EReal) : (x * y).abs = x.abs * y.abs


@[simp]
theorem multichoose_zero_right' (r : R) : multichoose r 0 = r ^ 0

{R : Type u_1}
[AddCommMonoid R]
[Pow R ℕ]
[BinomialRing R]
(r : R)


theorem span_union (s t : Set M) : span R (s ∪ t) = span R s ⊔ span R t

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(s t : Set M)

Submodule.span R (s ∪ t) = Submodule.span R s ⊔ Submodule.span R t


theorem isClopen_univ : IsClopen (univ : Set X)


theorem Periodic.zsmul_eq [AddGroup α] (h : Periodic f c) (n : ℤ) : f (n • c) = f 0

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[AddGroup α]
(h : Function.Periodic f c)
(n : ℤ)


@[simp]
theorem isAddCyclic_additive_iff [Group α] : IsAddCyclic (Additive α) ↔ IsCyclic α


/-- The top submonoid is isomorphic to the monoid. -/
@[to_additive (attr := simps) "The top additive submonoid is isomorphic to the additive monoid."]
def topEquiv : (⊤ : Submonoid M) ≃* M


@[to_additive]
theorem leftInv_leftInv_eq (hS : S ≤ IsUnit.submonoid M) : S.leftInv.leftInv = S

{M : Type u_1}
[AddMonoid M]
(S : AddSubmonoid M)
(hS : S ≤ IsAddUnit.addSubmonoid M)


@[to_additive (attr := simp)]
theorem uncurry_mul [∀ a b, Mul (γ a b)] (x y : ∀ a b, γ a b) :
    Sigma.uncurry (x * y) = Sigma.uncurry x * Sigma.uncurry y

{α : Type u_3}
{β : α → Type u_4}
{γ : (a : α) → β a → Type u_5}
[(a : α) → (b : β a) → Add (γ a b)]
(x y : (a : α) → (b : β a) → γ a b)

Sigma.uncurry (x + y) = Sigma.uncurry x + Sigma.uncurry y


theorem fderiv_inverse (x : Rˣ) : fderiv 𝕜 (@Ring.inverse R _) x = -mulLeftRight 𝕜 R ↑x⁻¹ ↑x⁻¹

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{R : Type u_6}
[NormedRing R]
[NormedAlgebra 𝕜 R]
[CompleteSpace R]
(x : Rˣ)

fderiv 𝕜 Ring.inverse ↑x = -((ContinuousLinearMap.mulLeftRight 𝕜 R) ↑x⁻¹) ↑x⁻¹


/-- The set of nonnegative elements in an ordered semiring, as a subsemiring. -/
@[simps]
def nonneg (R : Type*) [OrderedSemiring R] : Subsemiring R


lemma exact_of_δlast {n : ℕ} (S : ComposableArrows C (n + 2))
    (h₁ : S.δlast.Exact) (h₂ : (mk₂ (S.map' n (n + 1)) (S.map' (n + 1) (n + 2))).Exact) :
    S.Exact

(S : CategoryTheory.ComposableArrows C (n + 2))

(h₂ : (CategoryTheory.ComposableArrows.mk₂ (S.map' n (n + 1) ⋯ ⋯) (S.map' (n + 1) (n + 2) ⋯ ⋯)).Exact)


theorem zero_at_im_infty (f : ℍ → ℂ) :
    IsZeroAtImInfty f ↔ ∀ ε : ℝ, 0 < ε → ∃ A : ℝ, ∀ z : ℍ, A ≤ im z → abs (f z) ≤ ε

UpperHalfPlane.IsZeroAtImInfty f ↔ ∀ (ε : ℝ), 0 < ε → ∃ A, ∀ (z : ℍ), A ≤ z.im → Complex.abs (f z) ≤ ε


/-- The square of the quadratic character on nonzero arguments is `1`. -/
theorem quadraticChar_sq_one {a : F} (ha : a ≠ 0) : quadraticChar F a ^ 2 = 1

{F : Type u_1}
[Field F]
[Fintype F]
[DecidableEq F]
{a : F}
(ha : a ≠ 0)


theorem Differentiable.clog {f : E → ℂ} (h₁ : Differentiable ℂ f)
    (h₂ : ∀ x, f x ∈ slitPlane) : Differentiable ℂ fun t => log (f t)

(h₂ : ∀ (x : E), f x ∈ Complex.slitPlane)

Differentiable ℂ fun t => Complex.log (f t)


@[simp, norm_cast] lemma val_nnqsmul (q : ℚ≥0) (x : selfAdjoint R) : ↑(q • x) = q • (x : R)

{R : Type u_1}
[Field R]
[StarRing R]
(q : ℚ≥0)
(x : ↥(selfAdjoint R))


@[simp]
theorem funMap_apply₁ (f : f₁) (x : M) :
    @Structure.funMap _ M (Structure.mk₂ c' f₁' f₂' r₁' r₂') 1 f ![x] = f₁' f x

{M : Type w}
{c f₁ f₂ : Type u}
{r₁ r₂ : Type v}
{c' : c → M}
{f₁' : f₁ → M → M}
{f₂' : f₂ → M → M → M}
{r₁' : r₁ → Set M}
{r₂' : r₂ → M → M → Prop}
(f : f₁)
(x : M)

FirstOrder.Language.Structure.funMap f ![x] = f₁' f x


theorem norm_setToFun_le' (hT : DominatedFinMeasAdditive μ T C) (hf : Integrable f μ) :
    ‖setToFun μ T hT f‖ ≤ max C 0 * ‖hf.toL1 f‖

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

‖MeasureTheory.setToFun μ T hT f‖ ≤ max C 0 * ‖MeasureTheory.Integrable.toL1 f hf‖


nonrec theorem MeasureTheory.AEStronglyMeasurable.prod_swap {γ : Type*} [TopologicalSpace γ]
    [SFinite μ] [SFinite ν] {f : β × α → γ} (hf : AEStronglyMeasurable f (ν.prod μ)) :
    AEStronglyMeasurable (fun z : α × β => f z.swap) (μ.prod ν)

{f : β × α → γ}

(hf : MeasureTheory.AEStronglyMeasurable f (ν.prod μ))

MeasureTheory.AEStronglyMeasurable (fun z => f z.swap) (μ.prod ν)


/-- Order without maximal elements. Sometimes called cofinal. -/
class NoMaxOrder (α : Type*) [LT α] : Prop where
  /-- For each term `a`, there is some strictly greater `b`. -/
  exists_gt (a : α) : ∃ b, a < b

{α : Type u_3}
[LT α]
[self : NoMaxOrder α]
(a : α)


/-- If the product of `f i` over `i ∈ s` is not equal to `1`, then there is some `x ∈ s` such that
`f x ≠ 1`. -/
@[to_additive
      "If the product of `f i` over `i ∈ s` is not equal to `0`, then there is some `x ∈ s`
      such that `f x ≠ 0`."]
theorem exists_ne_one_of_finprod_mem_ne_one (h : ∏ᶠ i ∈ s, f i ≠ 1) : ∃ x ∈ s, f x ≠ 1

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
{f : α → M}
{s : Set α}
(h : ∑ᶠ (i : α) (_ : i ∈ s), f i ≠ 0)


theorem disjoint_cofinite_left : Disjoint cofinite l ↔ ∃ s ∈ l, Set.Finite s

Disjoint Filter.cofinite l ↔ ∃ s ∈ l, s.Finite


@[to_additive]
theorem mul_lt_of_lt_one_of_lt' [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a b c : α} (ha : a < 1)
    (hbc : b < c) :
    a * b < c

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


theorem flip_quotDualCoannihilatorToDual_injective (W : Submodule R (Dual R M)) :
    Function.Injective W.quotDualCoannihilatorToDual.flip

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(W : Submodule R (Module.Dual R M))


@[to_additive neg_one_zsmul]
lemma zpow_neg_one (x : G) : x ^ (-1 : ℤ) = x⁻¹


theorem inf_limZero {f g : CauSeq α abs} (hf : LimZero f) (hg : LimZero g) : LimZero (f ⊓ g)

{α : Type u_1}
[LinearOrderedField α]
{f g : CauSeq α abs}
(hf : f.LimZero)
(hg : g.LimZero)


@[simp]
theorem cons_val_two (x : α) (u : Fin m.succ.succ → α) : vecCons x u 2 = vecHead (vecTail u)

{α : Type u}
{m : ℕ}
(x : α)
(u : Fin m.succ.succ → α)

Matrix.vecCons x u 2 = Matrix.vecHead (Matrix.vecTail u)


theorem le_of_pred_lt {a b : α} : pred a < b → a ≤ b

{α : Type u_1}
[Preorder α]
[PredOrder α]
{a b : α}


@[simp]
theorem consRecOn_cons {motive : NormalWord d → Sort*}
    (g : G) (u : ℤˣ) (w : NormalWord d) (h1 : w.head ∈ d.set u)
    (h2 : ∀ u' ∈ Option.map Prod.fst w.toList.head?, w.head ∈ toSubgroup A B u → u = u')
    (ofGroup : ∀g, motive (ofGroup g))
    (cons : ∀ (g : G) (u : ℤˣ) (w : NormalWord d) (h1 : w.head ∈ d.set u)
      (h2 : ∀ u' ∈ Option.map Prod.fst w.toList.head?,
        w.head ∈ toSubgroup A B u → u = u'),
      motive w → motive (cons g u w h1 h2)) :
    consRecOn (.cons g u w h1 h2) ofGroup cons = cons g u w h1 h2
      (consRecOn w ofGroup cons)

{d : HNNExtension.NormalWord.TransversalPair G A B}

{motive : HNNExtension.NormalWord d → Sort u_4}

(ofGroup : (g : G) → motive (HNNExtension.NormalWord.ofGroup g))

(cons :
  (g : G) →
    (u : ℤˣ) →
      (w : HNNExtension.NormalWord d) →
        (h1 : w.head ∈ d.set u) →
          (h2 : ∀ u' ∈ Option.map Prod.fst w.toList.head?, w.head ∈ HNNExtension.toSubgroup A B u → u = u') →
            motive w → motive (HNNExtension.NormalWord.cons g u w h1 h2))

HNNExtension.NormalWord.consRecOn (HNNExtension.NormalWord.cons g u w h1 h2) ofGroup cons =
  cons g u w h1 h2 (HNNExtension.NormalWord.consRecOn w ofGroup cons)


@[simp]
theorem bot_N : (⊥ : I.Filtration M).N = ⊥

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
{I : Ideal R}


/-- The functor `CondensedSet ⥤ TopCat`  -/
@[simps]
def condensedSetToTopCat : CondensedSet.{u} ⥤ TopCat.{u+1}


nonrec theorem IsLocalExtr.neg (hf : IsLocalExtr f a) : IsLocalExtr (fun x => -f x) a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[OrderedAddCommGroup β]
{f : α → β}
{a : α}
(hf : IsLocalExtr f a)


theorem Function.Injective.lieAlgebra_isNilpotent [h₁ : IsNilpotent R L'] {f : L →ₗ⁅R⁆ L'}
    (h₂ : Function.Injective f) : IsNilpotent R L

{R : Type u}
{L : Type v}
{L' : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
[h₁ : LieAlgebra.IsNilpotent R L']
{f : L →ₗ⁅R⁆ L'}
(h₂ : Function.Injective ⇑f)


/-- The third projection `Triangle C ⥤ C`. -/
@[simps]
def π₃ : Triangle C ⥤ C

(T : CategoryTheory.Pretriangulated.Triangle C)

CategoryTheory.Pretriangulated.Triangle.π₃.obj T = T.obj₃


@[simp]
theorem pointReflection_toAffineEquiv (x : P) :
    (pointReflection 𝕜 x).toAffineEquiv = AffineEquiv.pointReflection 𝕜 x

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_10}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(x : P)

(AffineIsometryEquiv.pointReflection 𝕜 x).toAffineEquiv = AffineEquiv.pointReflection 𝕜 x


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

{M : Type u_1}
[Monoid M]
(S T : Subgroup Mˣ)


theorem head?_append {s t : List α} {x : α} (h : x ∈ s.head?) : x ∈ (s ++ t).head?

{α : Type u}
{s t : List α}
{x : α}
(h : x ∈ s.head?)


protected theorem Pairwise.chain (p : Pairwise R (a :: l)) : Chain R a l

∀ {α : Type u_1} {R : α → α → Prop} {a : α} {l : List α}, List.Pairwise R (a :: l) → List.Chain R a l


theorem lineMap_lt_lineMap_iff_of_lt (h : r < r') : lineMap a b r < lineMap a b r' ↔ a < b

{k : Type u_1}
{E : Type u_2}
[OrderedRing k]
[OrderedAddCommGroup E]
[Module k E]
[OrderedSMul k E]
{a b : E}
{r r' : k}
(h : r < r')

(AffineMap.lineMap a b) r < (AffineMap.lineMap a b) r' ↔ a < b


@[simp]
theorem coe_comp_topHom (f : BoundedOrderHom β γ) (g : BoundedOrderHom α β) :
    (f.comp g : TopHom α γ) = (f : TopHom β γ).comp g

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Preorder α]
[Preorder β]
[Preorder γ]
[BoundedOrder α]
[BoundedOrder β]
[BoundedOrder γ]
(f : BoundedOrderHom β γ)
(g : BoundedOrderHom α β)


theorem of_sub_int (m : ℤ) (h : Irrational (x - m)) : Irrational x

{x : ℝ}
(m : ℤ)
(h : Irrational (x - ↑m))


@[simp] theorem domCongr_apply (e : G ≃+ H) (f : MonoidAlgebra A G) (h : H) :
    domCongr k A e f h = f (e.symm h)

(k : Type u₁)
{G : Type u₂}
{H : Type u_1}
(A : Type u_3)
[CommSemiring k]
[AddMonoid G]
[AddMonoid H]
[Semiring A]
[Algebra k A]
(e : G ≃+ H)
(f : MonoidAlgebra A G)
(h : H)

((AddMonoidAlgebra.domCongr k A e) f) h = f (e.symm h)


@[simp]
theorem iInf_coe_toSubmodule {ι} (p : ι → LieSubmodule R L M) :
    (↑(⨅ i, p i) : Submodule R M) = ⨅ i, (p i : Submodule R M)

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
{ι : Sort u_1}
(p : ι → LieSubmodule R L M)


theorem MapsTo.surjOn_compl (h : MapsTo f s t) (h' : Surjective f) : SurjOn f sᶜ tᶜ

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
(h : Set.MapsTo f s t)
(h' : Function.Surjective f)


theorem martingale_const_fun [OrderBot ι] (ℱ : Filtration ι m0) (μ : Measure Ω) [IsFiniteMeasure μ]
    {f : Ω → E} (hf : StronglyMeasurable[ℱ ⊥] f) (hfint : Integrable f μ) :
    Martingale (fun _ => f) ℱ μ

(hf : MeasureTheory.StronglyMeasurable f)

MeasureTheory.Martingale (fun x => f) ℱ μ


theorem add_div_eq_of_add_mod_lt {a b c : ℕ} (hc : a % c + b % c < c) :
    (a + b) / c = a / c + b / c


theorem nonZeroDivisors.ne_zero [Nontrivial M] {x} (hx : x ∈ M⁰) : x ≠ 0

{M : Type u_2}
[MonoidWithZero M]
[Nontrivial M]
{x : M}
(hx : x ∈ M⁰)


protected theorem Adj.ne {G : SimpleGraph V} {a b : V} (h : G.Adj a b) : a ≠ b

{V : Type u}
{G : SimpleGraph V}
{a b : V}
(h : G.Adj a b)


@[to_additive]
theorem mulIndicator_empty' (f : α → M) : mulIndicator (∅ : Set α) f = 1

{α : Type u_1}
{M : Type u_4}
[One M]
(f : α → M)


@[simp]
theorem isCoatomic_dual_iff_isAtomic [OrderBot α] : IsCoatomic αᵒᵈ ↔ IsAtomic α

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


@[simp, norm_cast]
theorem const_le_iff [LE β] [NeBot l] {x y : β} : (↑x : Germ l β) ≤ ↑y ↔ x ≤ y

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
[LE β]
[l.NeBot]
{x y : β}

↑x ≤ ↑y ↔ x ≤ y


/-- Continuity of the measure of translates of a compact set:
Given a closed compact set `k` in a topological group,
the measure of `g • k \ k` tends to zero as `g` tends to `1`. -/
@[to_additive]
lemma tendsto_measure_smul_diff_isCompact_isClosed [LocallyCompactSpace G]
    [IsFiniteMeasureOnCompacts μ] [InnerRegularCompactLTTop μ] {k : Set G}
    (hk : IsCompact k) (h'k : IsClosed k) :
    Tendsto (fun g : G ↦ μ (g • k \ k)) (𝓝 1) (𝓝 0)

Filter.Tendsto (fun g => μ ((g +ᵥ k) \ k)) (𝓝 0) (𝓝 0)


/-- 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}
[SeminormedGroup E]
[SeminormedGroup F]
[FunLike 𝓕 E F]
[MonoidHomClass 𝓕 E F]
(f : 𝓕)
(C : ℝ)
(h : ∀ (x : E), ‖f x‖ ≤ C * ‖x‖)


@[to_additive (attr := continuity)]
theorem continuous_pow : ∀ n : ℕ, Continuous fun a : M => a ^ n

{M : Type u_3}
[TopologicalSpace M]
[AddMonoid M]
[ContinuousAdd M]
(n : ℕ)


theorem Disjoint.exists_uniform_thickening_of_basis {p : ι → Prop} {s : ι → Set (α × α)}
    (hU : (𝓤 α).HasBasis p s) {A B : Set α} (hA : IsCompact A) (hB : IsClosed B)
    (h : Disjoint A B) : ∃ i, p i ∧ Disjoint (⋃ x ∈ A, ball x (s i)) (⋃ x ∈ B, ball x (s i))

{α : Type ua}
{ι : Sort u_1}
[UniformSpace α]
{p : ι → Prop}
{s : ι → Set (α × α)}
(hU : (𝓤 α).HasBasis p s)
{A B : Set α}
(hA : IsCompact A)
(hB : IsClosed B)
(h : Disjoint A B)

∃ i, p i ∧ Disjoint (⋃ x ∈ A, UniformSpace.ball x (s i)) (⋃ x ∈ B, UniformSpace.ball x (s i))


theorem HasPDF.congr' {X Y : Ω → E} {ℙ : Measure Ω} {μ : Measure E} (hXY : X =ᵐ[ℙ] Y) :
    HasPDF X ℙ μ ↔ HasPDF Y ℙ μ

{Ω : Type u_1}
{E : Type u_2}
[MeasurableSpace E]

∀ {x : MeasurableSpace Ω} {X Y : Ω → E} {ℙ : MeasureTheory.Measure Ω} {μ : MeasureTheory.Measure E},
  X =ᵐ[ℙ] Y → (MeasureTheory.HasPDF X ℙ μ ↔ MeasureTheory.HasPDF Y ℙ μ)


/-- postcompose an equation between morphisms by another morphism -/
theorem eq_whisker {f g : X ⟶ Y} (w : f = g) (h : Y ⟶ Z) : f ≫ h = g ≫ h

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z : C}
{f g : X ⟶ Y}
(w : f = g)
(h : Y ⟶ Z)

CategoryTheory.CategoryStruct.comp f h = CategoryTheory.CategoryStruct.comp g h


/-- A subgroup is either the trivial subgroup or contains a non-identity element. -/
@[to_additive "A subgroup is either the trivial subgroup or contains a nonzero element."]
theorem bot_or_exists_ne_one (H : Subgroup G) : H = ⊥ ∨ ∃ x ∈ H, x ≠ (1 : G)

{G : Type u_1}
[Group G]
(H : Subgroup G)


@[to_additive]
theorem image_mul_product : ((s ×ˢ t).image fun x : α × α => x.fst * x.snd) = s * t

{α : Type u_2}
[DecidableEq α]
[Add α]
{s t : Finset α}

Finset.image (fun x => x.1 + x.2) (s ×ˢ t) = s + t


/-- The datum of an extra degeneracy is a technical condition on
augmented simplicial objects. The morphisms `s'` and `s n` of the
structure formally behave like extra degeneracies `σ (-1)`. -/
@[ext]
structure ExtraDegeneracy (X : SimplicialObject.Augmented C) where
  s' : point.obj X ⟶ drop.obj X _[0]
  s : ∀ n : ℕ, drop.obj X _[n] ⟶ drop.obj X _[n + 1]
  s'_comp_ε : s' ≫ X.hom.app (op [0]) = 𝟙 _
  s₀_comp_δ₁ : s 0 ≫ X.left.δ 1 = X.hom.app (op [0]) ≫ s'
  s_comp_δ₀ : ∀ n : ℕ, s n ≫ X.left.δ 0 = 𝟙 _
  s_comp_δ :
    ∀ (n : ℕ) (i : Fin (n + 2)), s (n + 1) ≫ X.left.δ i.succ = X.left.δ i ≫ s n
  s_comp_σ :
    ∀ (n : ℕ) (i : Fin (n + 1)), s n ≫ X.left.σ i.succ = X.left.σ i ≫ s (n + 1)

{X : CategoryTheory.SimplicialObject.Augmented C}

(self : SimplicialObject.Augmented.ExtraDegeneracy X)

self.s' ≫ X.hom.app (Opposite.op [0]) = 𝟙 (CategoryTheory.SimplicialObject.Augmented.point.obj X)


protected theorem comp_eq_of_monotoneOn {β : Type*} [LinearOrder β] (f : α → E) {t : Set β}
    (φ : β → α) (hφ : MonotoneOn φ t) {x y : β} (hx : x ∈ t) (hy : y ∈ t) :
    variationOnFromTo (f ∘ φ) t x y = variationOnFromTo f (φ '' t) (φ x) (φ y)

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
{β : Type u_3}
[LinearOrder β]
(f : α → E)
{t : Set β}
(φ : β → α)
(hφ : MonotoneOn φ t)
{x y : β}
(hx : x ∈ t)
(hy : y ∈ t)


@[simp] lemma tail_sub (a b : Fin n.succ → α) : vecTail (a - b) = vecTail a - vecTail b

{α : Type u_1}
{n : ℕ}
[Sub α]
(a b : Fin n.succ → α)

Matrix.vecTail (a - b) = Matrix.vecTail a - Matrix.vecTail b


@[simp]
theorem lift_comm (F : Over Y ⥤ Over X)
    (h : ∀ f : MonoOver Y, Mono (F.obj ((MonoOver.forget Y).obj f)).hom) :
    lift F h ⋙ MonoOver.forget X = MonoOver.forget Y ⋙ F

(F : CategoryTheory.Functor (CategoryTheory.Over Y) (CategoryTheory.Over X))

(h : ∀ (f : CategoryTheory.MonoOver Y), CategoryTheory.Mono (F.obj ((CategoryTheory.MonoOver.forget Y).obj f)).hom)

(CategoryTheory.MonoOver.lift F h).comp (CategoryTheory.MonoOver.forget X) = (CategoryTheory.MonoOver.forget Y).comp F


@[simp]
theorem toSubring_subtype {R A : Type*} [CommRing R] [Ring A] [Algebra R A] (S : Subalgebra R A) :
    S.toSubring.subtype = (S.val : S →+* A)

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[Ring A]
[Algebra R A]
(S : Subalgebra R A)


theorem finprod_nonneg {R : Type*} [OrderedCommSemiring R] {f : α → R} (hf : ∀ x, 0 ≤ f x) :
    0 ≤ ∏ᶠ x, f x

{α : Sort u_4}
{R : Type u_7}
[OrderedCommSemiring R]
{f : α → R}
(hf : ∀ (x : α), 0 ≤ f x)


/-- An expository lemma to show how all of `ts`, `r`, and `f` can be eliminated from
`permutationsAux2`.

`(permutationsAux2 t [] [] ys id).2`, which appears on the RHS, is a list whose elements are
produced by inserting `t` into every non-terminal position of `ys` in order. As an example:
```lean
#eval permutationsAux2 1 [] [] [2, 3, 4] id
-- [[1, 2, 3, 4], [2, 1, 3, 4], [2, 3, 1, 4]]
```
-/
theorem permutationsAux2_snd_eq (t : α) (ts : List α) (r : List β) (ys : List α) (f : List α → β) :
    (permutationsAux2 t ts r ys f).2 =
      ((permutationsAux2 t [] [] ys id).2.map fun x => f (x ++ ts)) ++ r

{α : Type u_1}
{β : Type u_2}
(t : α)
(ts : List α)
(r : List β)
(ys : List α)
(f : List α → β)

(List.permutationsAux2 t ts r ys f).2 = List.map (fun x => f (x ++ ts)) (List.permutationsAux2 t [] [] ys id).2 ++ r


/-- Derivative under integral of `x ↦ ∫ F x a` at a given point `x₀ : ℝ`, assuming
`F x₀` is integrable, `x ↦ F x a` is differentiable on an interval around `x₀` for ae `a`
(with interval radius independent of `a`) with derivative uniformly bounded by an integrable
function, and `F x` is ae-measurable for `x` in a possibly smaller neighborhood of `x₀`. -/
theorem hasDerivAt_integral_of_dominated_loc_of_deriv_le (ε_pos : 0 < ε)
    (hF_meas : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (F x) μ) (hF_int : Integrable (F x₀) μ)
    {F' : 𝕜 → α → E} (hF'_meas : AEStronglyMeasurable (F' x₀) μ)
    (h_bound : ∀ᵐ a ∂μ, ∀ x ∈ ball x₀ ε, ‖F' x a‖ ≤ bound a) (bound_integrable : Integrable bound μ)
    (h_diff : ∀ᵐ a ∂μ, ∀ x ∈ ball x₀ ε, HasDerivAt (F · a) (F' x a) x) :
    Integrable (F' x₀) μ ∧ HasDerivAt (fun n ↦ ∫ a, F n a ∂μ) (∫ a, F' x₀ a ∂μ) x₀

(hF_meas : ∀ᶠ (x : 𝕜) in 𝓝 x₀, MeasureTheory.AEStronglyMeasurable (F x) μ)

(hF_int : MeasureTheory.Integrable (F x₀) μ)

(hF'_meas : MeasureTheory.AEStronglyMeasurable (F' x₀) μ)

(h_bound : ∀ᵐ (a : α) ∂μ, ∀ x ∈ Metric.ball x₀ ε, ‖F' x a‖ ≤ bound a)

(bound_integrable : MeasureTheory.Integrable bound μ)

(h_diff : ∀ᵐ (a : α) ∂μ, ∀ x ∈ Metric.ball x₀ ε, HasDerivAt (fun x => F x a) (F' x a) x)

MeasureTheory.Integrable (F' x₀) μ ∧ HasDerivAt (fun n => ∫ (a : α), F n a ∂μ) (∫ (a : α), F' x₀ a ∂μ) x₀


theorem card_fintype_Ico_of_le (h : a ≤ b) : (Fintype.card (Set.Ico a b) : ℤ) = b - a


@[simp]
theorem toContinuousMap_coe (f : P →ᴬ[R] Q) : f.toContinuousMap = ↑f

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


theorem sym2_eq_sym_two : xs.sym2.map (Sym2.equivSym α) = xs.sym 2

List.map (⇑(Sym2.equivSym α)) xs.sym2 = List.sym 2 xs


/-- **Lifting the exponent lemma** for `p = 2` -/
theorem Int.two_pow_sub_pow {x y : ℤ} {n : ℕ} (hxy : 2 ∣ x - y) (hx : ¬2 ∣ x) (hn : Even n) :
    multiplicity 2 (x ^ n - y ^ n) + 1 =
      multiplicity 2 (x + y) + multiplicity 2 (x - y) + multiplicity (2 : ℤ) n

multiplicity 2 (x ^ n - y ^ n) + 1 = multiplicity 2 (x + y) + multiplicity 2 (x - y) + multiplicity 2 ↑n


/-- `f` factors through its coimage via the canonical morphism `p`. -/
protected theorem coimage.fac : coimage.π f ≫ Abelian.factorThruCoimage f = f

CategoryTheory.Abelian.coimage.π f ≫ CategoryTheory.Abelian.factorThruCoimage f = f


theorem mapsTo_emetric_closedBall (h : LipschitzWith K f) (x : α) (r : ℝ≥0∞) :
    MapsTo f (closedBall x r) (closedBall (f x) (K * r))

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(h : LipschitzWith K f)
(x : α)
(r : ℝ≥0∞)

Set.MapsTo f (EMetric.closedBall x r) (EMetric.closedBall (f x) (↑K * r))


@[to_additive]
theorem mem_centralizer_iff_commutator_eq_one {g : G} {s : Set G} :
    g ∈ centralizer s ↔ ∀ h ∈ s, h * g * h⁻¹ * g⁻¹ = 1

{G : Type u_1}
[Group G]
{g : G}
{s : Set G}

g ∈ Subgroup.centralizer s ↔ ∀ h ∈ s, h * g * h⁻¹ * g⁻¹ = 1


lemma hasFPowerSeriesOnBall_inv_one_sub
    (𝕜 𝕝 : Type*) [NontriviallyNormedField 𝕜] [NontriviallyNormedField 𝕝] [NormedAlgebra 𝕜 𝕝] :
    HasFPowerSeriesOnBall (fun x : 𝕝 ↦ (1 - x)⁻¹) (formalMultilinearSeries_geometric 𝕜 𝕝) 0 1

(𝕜 : Type u_9)
(𝕝 : Type u_10)
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕝]
[NormedAlgebra 𝕜 𝕝]

HasFPowerSeriesOnBall (fun x => (1 - x)⁻¹) (formalMultilinearSeries_geometric 𝕜 𝕝) 0 1