@[simp]
theorem parallel_bot_iff_eq_bot {s : AffineSubspace k P} : s ∥ ⊥ ↔ s = ⊥

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : AffineSubspace k P}

s ∥ ⊥ ↔ s = ⊥


@[to_additive (attr := simp)]
lemma inv_pow (a : α) : ∀ n : ℕ, a⁻¹ ^ n = (a ^ n)⁻¹

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


/-- If `x` is in the base field `K`, then the norm is `x ^ [L : K]`.

(If `L` is not finite-dimensional over `K`, then `norm = 1 = x ^ 0 = x ^ (finrank L K)`.)
-/
@[simp]
protected theorem norm_algebraMap {L : Type*} [Ring L] [Algebra K L] (x : K) :
    norm K (algebraMap K L x) = x ^ finrank K L

{K : Type u_4}
[Field K]
{L : Type u_7}
[Ring L]
[Algebra K L]
(x : K)

(Algebra.norm K) ((algebraMap K L) x) = x ^ FiniteDimensional.finrank K L


@[simps (config := .lemmasOnly)]
instance instMonoidalCategoryStruct : MonoidalCategoryStruct (ModuleCat.{u} R)

{R : Type u}
[CommRing R]
(M : ModuleCat R)

CategoryTheory.MonoidalCategory.rightUnitor M = ModuleCat.MonoidalCategory.rightUnitor M


theorem add_eq_coe : a + b = x ↔ ∃ a' b' : α, ↑a' = a ∧ ↑b' = b ∧ a' + b' = x

{α : Type u}
[Add α]
{a b : WithBot α}
{x : α}

a + b = ↑x ↔ ∃ a' b', ↑a' = a ∧ ↑b' = b ∧ a' + b' = x


@[simp, norm_cast]
theorem natCast_imJ (n : ℕ) : (n : ℍ[R]).imJ = 0


theorem IsInt.to_isRat {α} [Ring α] : ∀ {a : α} {n}, IsInt a n → IsRat a n (nat_lit 1)

Mathlib.Meta.NormNum.IsInt a n → Mathlib.Meta.NormNum.IsRat a n 1


lemma fin3_def {R : Type u} (P : Fin 3 → R) : P = ![P x, P y, P z]


@[simp]
theorem trailingDegree_monomial (ha : a ≠ 0) : trailingDegree (monomial n a) = n

{R : Type u}
{a : R}
{n : ℕ}
[Semiring R]
(ha : a ≠ 0)

((Polynomial.monomial n) a).trailingDegree = ↑n


/-- If `μ univ < n * μ s` and `f` is a map preserving measure `μ`,
then for some `x ∈ s` and `0 < m < n`, `f^[m] x ∈ s`. -/
theorem exists_mem_iterate_mem_of_volume_lt_mul_volume (hf : MeasurePreserving f μ μ)
    (hs : NullMeasurableSet s μ) {n : ℕ} (hvol : μ (Set.univ : Set α) < n * μ s) :
    ∃ x ∈ s, ∃ m ∈ Set.Ioo 0 n, f^[m] x ∈ s

(hf : MeasureTheory.MeasurePreserving f μ μ)

(hs : MeasureTheory.NullMeasurableSet s μ)


@[simp]
theorem whisker_unit (t : LeftExtension f g) {x : B} (h : c ⟶ x) :
    (t.whisker h).unit = t.unit ▷ h ≫ (α_ f t.extension h).hom

(t : CategoryTheory.Bicategory.LeftExtension f g)

(t.whisker h).unit =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight t.unit h)
    (CategoryTheory.Bicategory.associator f t.extension h).hom


@[simp]
theorem round_neg_two_inv : round (-2⁻¹ : α) = 0

{α : Type u_2}
[LinearOrderedField α]
[FloorRing α]


@[simp]
theorem lift_max {a b : Cardinal} : lift.{u, v} (max a b) = max (lift.{u, v} a) (lift.{u, v} b)

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


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

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

∀ {X Y : C} (f : X ⟶ Y) (x : ((fun X => CategoryTheory.Mat_.mk PUnit.{1} fun x => X) X).ι)
  (x_1 : ((fun X => CategoryTheory.Mat_.mk PUnit.{1} fun x => X) Y).ι),
  (CategoryTheory.Mat_.embedding C).map f x x_1 = f


theorem atBot_le_cocompact [NoMinOrder α] [ClosedIicTopology α] :
    atBot ≤ cocompact α

{α : Type u_2}
[LinearOrder α]
[TopologicalSpace α]
[NoMinOrder α]
[ClosedIicTopology α]


theorem lieSpan_mono {t : Set M} (h : s ⊆ t) : lieSpan R L s ≤ lieSpan R L t

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
{s t : Set M}
(h : s ⊆ t)

LieSubmodule.lieSpan R L s ≤ LieSubmodule.lieSpan R L t


@[simp]
theorem map_id (C : ConnectedComponent G) : C.map Hom.id = C

{V : Type u}
{G : SimpleGraph V}
(C : G.ConnectedComponent)

SimpleGraph.ConnectedComponent.map SimpleGraph.Hom.id C = C


@[norm_cast]
theorem coe_edgeFinset : (G.edgeFinset : Set (Sym2 V)) = G.edgeSet

{V : Type u_1}
(G : SimpleGraph V)
[Fintype ↑G.edgeSet]


/--
The light condensed object associated to a presheaf on `LightProfinite` which preserves finite
products and satisfies the equalizer condition.
-/
@[simps]
noncomputable def ofSheafLightProfinite (F : LightProfinite.{u}ᵒᵖ ⥤ A) [PreservesFiniteProducts F]
    (hF : EqualizerCondition F) : LightCondensed A

(hF : CategoryTheory.regularTopology.EqualizerCondition F)

(LightCondensed.ofSheafLightProfinite F hF).val = F


@[to_additive]
theorem pairwiseDisjoint_smul_iff :
    s.PairwiseDisjoint (· • t) ↔ (s ×ˢ t).InjOn fun p ↦ p.1 * p.2

{α : Type u_2}
[Mul α]
[IsLeftCancelMul α]
{s t : Set α}

(s.PairwiseDisjoint fun x => x • t) ↔ Set.InjOn (fun p => p.1 * p.2) (s ×ˢ t)


@[simp]
theorem Fork.ι_ofι {P : C} (ι : P ⟶ X) (w : ι ≫ f = ι ≫ g) : (Fork.ofι ι w).ι = ι

(w : CategoryTheory.CategoryStruct.comp ι f = CategoryTheory.CategoryStruct.comp ι g)

(CategoryTheory.Limits.Fork.ofι ι w).ι = ι


@[simp] theorem find?_eq [BEq α] (a : α) (l : AssocList α β) :
    find? a l = (l.toList.find? (·.1 == a)).map (·.2)

{α : Type u_1}
{β : Type u_2}
[BEq α]
(a : α)
(l : Batteries.AssocList α β)

Batteries.AssocList.find? a l = Option.map (fun x => x.snd) (List.find? (fun x => x.fst == a) l.toList)


/-- **Squeeze theorem** (also known as **sandwich theorem**). This version assumes that inequalities
hold everywhere. -/
theorem tendsto_of_tendsto_of_tendsto_of_le_of_le [OrderTopology α] {f g h : β → α} {b : Filter β}
    {a : α} (hg : Tendsto g b (𝓝 a)) (hh : Tendsto h b (𝓝 a)) (hgf : g ≤ f) (hfh : f ≤ h) :
    Tendsto f b (𝓝 a)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder α]
[OrderTopology α]
{f g h : β → α}
{b : Filter β}
{a : α}
(hg : Filter.Tendsto g b (𝓝 a))
(hh : Filter.Tendsto h b (𝓝 a))
(hgf : g ≤ f)
(hfh : f ≤ h)


theorem rank_finsupp' (ι : Type v) : Module.rank R (ι →₀ M) = #ι * Module.rank R M

(R : Type u)
(M : Type v)
[Ring R]
[AddCommGroup M]
[Module R M]
[StrongRankCondition R]
[Module.Free R M]
(ι : Type v)


theorem deriv_tsum_apply (hu : Summable u) (hg : ∀ n, Differentiable 𝕜 (g n))
    (hg' : ∀ n y, ‖deriv (g n) y‖ ≤ u n) (hg0 : Summable fun n => g n y₀) (y : 𝕜) :
    deriv (fun z => ∑' n, g n z) y = ∑' n, deriv (g n) y

(hg : ∀ (n : α), Differentiable 𝕜 (g n))

(hg' : ∀ (n : α) (y : 𝕜), ‖deriv (g n) y‖ ≤ u n)

deriv (fun z => ∑' (n : α), g n z) y = ∑' (n : α), deriv (g n) y


@[simp]
theorem image2_left (h : t.Nonempty) : image2 (fun x _ => x) s t = s

{α : Type u_1}
{β : Type u_3}
{s : Set α}
{t : Set β}
(h : t.Nonempty)


@[simp]
theorem zsmul_apply (r : ℤ) (f : α →ᵇ β) (v : α) : (r • f) v = r • f v

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
(r : ℤ)
(f : BoundedContinuousFunction α β)
(v : α)


@[deprecated getElem?_set_eq_of_lt (since := "2024-06-12")]
theorem get?_set_eq_of_lt (a : α) {n} {l : List α} (h : n < length l) :
    (set l n a).get? n = some a

{α : Type u_1}
(a : α)
{n : Nat}
{l : List α}
(h : n < l.length)


/-- If `L₁ : C₁ ⥤ D` is a localization functor for `W₁ : MorphismProperty C₁`, then it is also
the case of a functor `L₂ : C₂ ⥤ D` for a suitable `W₂ : MorphismProperty C₂` when
we have an equivalence of category `E : C₁ ≌ C₂` and an isomorphism `E.functor ⋙ L₂ ≅ L₁`. -/
lemma of_equivalence_source (L₁ : C₁ ⥤ D) (W₁ : MorphismProperty C₁)
    (L₂ : C₂ ⥤ D) (W₂ : MorphismProperty C₂)
    (E : C₁ ≌ C₂) (hW₁ : W₁ ≤ W₂.isoClosure.inverseImage E.functor) (hW₂ : W₂.IsInvertedBy L₂)
    [L₁.IsLocalization W₁] (iso : E.functor ⋙ L₂ ≅ L₁) : L₂.IsLocalization W₂

(W₁ : CategoryTheory.MorphismProperty C₁)

(W₂ : CategoryTheory.MorphismProperty C₂)


theorem getI_eq_get {n : ℕ} (hn : n < l.length) : l.getI n = l.get ⟨n, hn⟩

{α : Type u}
(l : List α)
[Inhabited α]
{n : ℕ}
(hn : n < l.length)


theorem factorization_prime_le_iff_dvd {d n : ℕ} (hd : d ≠ 0) (hn : n ≠ 0) :
    (∀ p : ℕ, p.Prime → d.factorization p ≤ n.factorization p) ↔ d ∣ n

(∀ (p : ℕ), Nat.Prime p → d.factorization p ≤ n.factorization p) ↔ d ∣ n


theorem neg_le (S T : Submodule R M) : -S ≤ T ↔ S ≤ -T

{R : Type u_2}
{M : Type u_3}
[Semiring R]
[AddCommGroup M]
[Module R M]
(S T : Submodule R M)


@[to_additive]
theorem eq_top_iff' : S = ⊤ ↔ ∀ x : M, x ∈ S

{M : Type u_1}
[Add M]
(S : AddSubsemigroup M)


@[simp]
theorem mem_singleton {x y : ZFSet.{u}} : x ∈ @singleton ZFSet.{u} ZFSet.{u} _ y ↔ x = y


@[to_additive (attr := simp)]
theorem mk_pow {M} [Monoid M] {A : Type*} [SetLike A M] [SubmonoidClass A M] {S : A} (x : M)
    (hx : x ∈ S) (n : ℕ) : (⟨x, hx⟩ : S) ^ n = ⟨x ^ n, pow_mem hx n⟩

{M : Type u_6}
[Monoid M]
{A : Type u_5}
[SetLike A M]
[SubmonoidClass A M]
{S : A}
(x : M)
(hx : x ∈ S)
(n : ℕ)


/-- An additive character maps integer scalar multiples to integer powers. -/
lemma map_zsmul_eq_zpow (ψ : AddChar A M) (n : ℤ) (a : A) : ψ (n • a) = (ψ a) ^ n

{A : Type u_1}
{M : Type u_2}
[AddGroup A]
[DivisionMonoid M]
(ψ : AddChar A M)
(n : ℤ)
(a : A)


/-- `Int.clog b` and `zpow b` (almost) form a Galois connection. -/
theorem le_zpow_iff_clog_le {b : ℕ} (hb : 1 < b) {x : ℤ} {r : R} (hr : 0 < r) :
    r ≤ (b : R) ^ x ↔ clog b r ≤ x

{R : Type u_1}
[LinearOrderedSemifield R]
[FloorSemiring R]
{b : ℕ}
(hb : 1 < b)
{x : ℤ}
{r : R}
(hr : 0 < r)


theorem Nonempty.left (h : (s ∩ t).Nonempty) : s.Nonempty

{α : Type u}
{s t : Set α}
(h : (s ∩ t).Nonempty)


@[to_additive (attr := simp)]
theorem div_pure : f / pure b = f.map (· / b)

{α : Type u_2}
[Sub α]
{f : Filter α}
{b : α}

f - pure b = Filter.map (fun x => x - b) f


/-- A kernel `κCond` is a conditional kernel for a kernel `κ` if it disintegrates it in the sense
that `κ.fst ⊗ₖ κCond = κ`. -/
class IsCondKernel : Prop where
  protected disintegrate : κ.fst ⊗ₖ κCond = κ

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

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


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

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

(P : CategoryTheory.Idempotents.Karoubi C)

((CategoryTheory.Idempotents.FunctorExtension₁.obj F).obj P).X = (F.obj P.X).X


/-- Helper function for constructing morphisms between equalizer forks.
-/
@[simps]
def Fork.mkHom {s t : Fork f g} (k : s.pt ⟶ t.pt) (w : k ≫ t.ι = s.ι) : s ⟶ t

(w : CategoryTheory.CategoryStruct.comp k t.ι = s.ι)

(CategoryTheory.Limits.Fork.mkHom k w).hom = k


/-- Identity map as a uniform isomorphism. -/
@[simps! (config := .asFn) apply]
protected def refl (α : Type*) [UniformSpace α] : α ≃ᵤ α


@[simp]
theorem symm_toNonUnitalRingHom_apply_toNonUnitalRingHom_apply (e : R ≃+* S) :
    ∀ x : R, e.symm.toNonUnitalRingHom (e.toNonUnitalRingHom x) = x

{R : Type u_4}
{S : Type u_5}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
(e : R ≃+* S)
(x : R)


@[simp] theorem max_none_none [Max α] : max (none : Option α) none = none


theorem isDiag_iff_mem_range_diag (z : Sym2 α) : IsDiag z ↔ z ∈ Set.range (@diag α)


theorem CauSeq.cauchySeq (f : CauSeq β norm) : CauchySeq f

{β : Type v}
[NormedField β]
(f : CauSeq β norm)


@[reassoc (attr := simp)]
theorem μ_inv_hom_app (i j : M) (X : C) : (F.μIso i j).inv.app X ≫ (F.μ i j).app X = 𝟙 _

(F : CategoryTheory.MonoidalFunctor M (CategoryTheory.Functor C C))

CategoryTheory.CategoryStruct.comp ((F.μIso i j).inv.app X) ((F.μ i j).app X) =
  CategoryTheory.CategoryStruct.id ((F.obj (CategoryTheory.MonoidalCategory.tensorObj i j)).obj X)


theorem unbot'_lt_iff {a : WithBot α} {b c : α} (h : a = ⊥ → b < c) :
    a.unbot' b < c ↔ a < c

{α : Type u_1}
[LT α]
{a : WithBot α}
{b c : α}
(h : a = ⊥ → b < c)


lemma Absorbs.sub {s₁ s₂ t₁ t₂ : Set E} (h₁ : Absorbs M s₁ t₁) (h₂ : Absorbs M s₂ t₂) :
    Absorbs M (s₁ - s₂) (t₁ - t₂)

{M : Type u_1}
{E : Type u_2}
[Monoid M]
[AddGroup E]
[DistribMulAction M E]
[Bornology M]
{s₁ s₂ t₁ t₂ : Set E}
(h₁ : Absorbs M s₁ t₁)
(h₂ : Absorbs M s₂ t₂)


theorem mk_compl_eq_mk_compl_finite {α β : Type u} [Finite α] {s : Set α} {t : Set β}
    (h1 : #α = #β) (h : #s = #t) : #(sᶜ : Set α) = #(tᶜ : Set β)

{α β : Type u}
[Finite α]
{s : Set α}
{t : Set β}
(h1 : #α = #β)
(h : #↑s = #↑t)


private theorem List.size_toArrayAux (as : List α) (bs : Array α) : (as.toArrayAux bs).size = as.length + bs.size

{α : Type u_1}
(as : List α)
(bs : Array α)


@[simp]
theorem update_elim_inr [DecidableEq β] [DecidableEq (α ⊕ β)] {f : α → γ} {g : β → γ} {i : β}
    {x : γ} : update (Sum.elim f g) (inr i) x = Sum.elim f (update g i x)

{α : Type u}
{β : Type v}
{γ : Type u_1}
[DecidableEq β]
[DecidableEq (α ⊕ β)]
{f : α → γ}
{g : β → γ}
{i : β}
{x : γ}

Function.update (Sum.elim f g) (Sum.inr i) x = Sum.elim f (Function.update g i x)


/-- If a function is continuous within a set `s` at every point of a compact set `k`, then it is
bounded on some open neighborhood of `k` in `s`. -/
theorem exists_isOpen_isBounded_image_inter_of_isCompact_of_forall_continuousWithinAt
    [TopologicalSpace β] {k s : Set β} {f : β → α} (hk : IsCompact k)
    (hf : ∀ x ∈ k, ContinuousWithinAt f s x) :
    ∃ t, k ⊆ t ∧ IsOpen t ∧ IsBounded (f '' (t ∩ s))

∃ t, k ⊆ t ∧ IsOpen t ∧ Bornology.IsBounded (f '' (t ∩ s))


@[to_additive]
theorem Multipliable.nat_mul_neg {f : ℤ → M} (hf : Multipliable f) :
    Multipliable fun n : ℕ ↦ f n * f (-n)

{M : Type u_1}
[AddCommMonoid M]
[TopologicalSpace M]
[ContinuousAdd M]
{f : ℤ → M}
(hf : Summable f)


/-- If `f` is `n` times continuous differentiable on a set `s`, then the Taylor polynomial
  `taylorWithinEval f n s x₀ x` is continuous in `x₀`. -/
theorem continuousOn_taylorWithinEval {f : ℝ → E} {x : ℝ} {n : ℕ} {s : Set ℝ}
    (hs : UniqueDiffOn ℝ s) (hf : ContDiffOn ℝ n f s) :
    ContinuousOn (fun t => taylorWithinEval f n s t x) s

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : ℝ → E}
{x : ℝ}
{n : ℕ}
{s : Set ℝ}
(hs : UniqueDiffOn ℝ s)
(hf : ContDiffOn ℝ (↑n) f s)


@[to_additive]
theorem continuousInv_inf {t₁ t₂ : TopologicalSpace G} (h₁ : @ContinuousInv G t₁ _)
    (h₂ : @ContinuousInv G t₂ _) : @ContinuousInv G (t₁ ⊓ t₂) _

{G : Type w}
[Inv G]
{t₁ t₂ : TopologicalSpace G}
(h₁ : ContinuousInv G)
(h₂ : ContinuousInv G)


/-- a variant of `Homotopy.compRight` useful for dealing with homotopy equivalences. -/
@[simps!]
def compRightId {f : C ⟶ C} (h : Homotopy f (𝟙 C)) (g : C ⟶ D) : Homotopy (f ≫ g) g

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D : HomologicalComplex V c}
{f : C ⟶ C}
(h : Homotopy f (𝟙 C))
(g : C ⟶ D)
(i j : ι)

(h.compRightId g).hom i j = h.hom i j ≫ g.f j


@[simp]
theorem mul_left_apply_of_ne (a b : n) (h : a ≠ i) (M : Matrix n n α) :
    (stdBasisMatrix i j c * M) a b = 0

{n : Type u_3}
{α : Type u_5}
[DecidableEq n]
[Semiring α]
(i j : n)
(c : α)
[Fintype n]
(a b : n)
(h : a ≠ i)
(M : Matrix n n α)

(Matrix.stdBasisMatrix i j c * M) a b = 0


theorem forall₃_congr {p q : ∀ a b, γ a b → Prop} (h : ∀ a b c, p a b c ↔ q a b c) :
    (∀ a b c, p a b c) ↔ ∀ a b c, q a b c

{p q : (a : α) → (b : β a) → γ a b → Prop}

(h : ∀ (a : α) (b : β a) (c : γ a b), p a b c ↔ q a b c)

(∀ (a : α) (b : β a) (c : γ a b), p a b c) ↔ ∀ (a : α) (b : β a) (c : γ a b), q a b c


@[simp]
theorem bot_codisjoint : Codisjoint ⊥ a ↔ a = ⊤

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


/-- Any standard Borel space embeds measurably into the reals. -/
theorem exists_measurableEmbedding_real : ∃ f : α → ℝ, MeasurableEmbedding f

(α : Type u_1)
[MeasurableSpace α]
[StandardBorelSpace α]


@[simp]
theorem normSq_eq_of_mem_circle (z : circle) : normSq z = 1


@[reassoc]
theorem leftUnitor_monoidal (X₁ X₂ : C) :
    (λ_ X₁).hom ⊗ (λ_ X₂).hom =
      tensor_μ C (𝟙_ C, X₁) (𝟙_ C, X₂) ≫ ((λ_ (𝟙_ C)).hom ▷ (X₁ ⊗ X₂)) ≫ (λ_ (X₁ ⊗ X₂)).hom

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

(λ_ X₁).hom ⊗ (λ_ X₂).hom =
  CategoryTheory.tensor_μ C (𝟙_ C, X₁) (𝟙_ C, X₂) ≫ (λ_ (𝟙_ C)).hom ▷ (X₁ ⊗ X₂) ≫ (λ_ (X₁ ⊗ X₂)).hom


theorem lintegral_add_compl (f : α → ℝ≥0∞) {A : Set α} (hA : MeasurableSet A) :
    ∫⁻ x in A, f x ∂μ + ∫⁻ x in Aᶜ, f x ∂μ = ∫⁻ x, f x ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(f : α → ℝ≥0∞)
{A : Set α}
(hA : MeasurableSet A)

∫⁻ (x : α) in A, f x ∂μ + ∫⁻ (x : α) in Aᶜ, f x ∂μ = ∫⁻ (x : α), f x ∂μ


theorem fourier_eval_zero (n : ℤ) : fourier n (0 : AddCircle T) = 1


@[norm_cast]
theorem coe_continuousMap_mk (f : P →ᵃ[R] Q) (h) : ((⟨f, h⟩ : P →ᴬ[R] Q) : C(P, Q)) = ⟨f, h⟩

{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)
(h : Continuous f.toFun)

↑{ toAffineMap := f, cont := h } = { toFun := ⇑f, continuous_toFun := h }


@[simp]
theorem prod_smul (g : HNNExtension G A B φ) (w : NormalWord d) :
    (g • w).prod φ = g * w.prod φ

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

HNNExtension.NormalWord.ReducedWord.prod φ (g • w).toReducedWord =
  g * HNNExtension.NormalWord.ReducedWord.prod φ w.toReducedWord


@[to_additive]
theorem orderOf_dvd_of_mem_zpowers (h : y ∈ Subgroup.zpowers x) : orderOf y ∣ orderOf x

{G : Type u_1}
[Group G]
{x y : G}
(h : y ∈ Subgroup.zpowers x)


@[norm_cast]
theorem coe_upperClosure (s : Set α) : ↑(upperClosure s) = ⋃ a ∈ s, Ici a


@[simp]
theorem mem_biUnionTagged (π : Prepartition I) {πi : ∀ J, TaggedPrepartition J} :
    J ∈ π.biUnionTagged πi ↔ ∃ J' ∈ π, J ∈ πi J'

{πi : (J : BoxIntegral.Box ι) → BoxIntegral.TaggedPrepartition J}


theorem not_injective_of_ordinal {α : Type u} (f : Ordinal.{u} → α) : ¬Injective f


/-- A (non-commutative) Jordan multiplication. -/
class IsJordan [Mul A] : Prop where
  lmul_comm_rmul : ∀ a b : A, a * b * a = a * (b * a)
  lmul_lmul_comm_lmul : ∀ a b : A, a * a * (a * b) = a * (a * a * b)
  lmul_lmul_comm_rmul : ∀ a b : A, a * a * (b * a) = a * a * b * a
  lmul_comm_rmul_rmul : ∀ a b : A, a * b * (a * a) = a * (b * (a * a))
  rmul_comm_rmul_rmul : ∀ a b : A, b * a * (a * a) = b * (a * a) * a

{A : Type u_1}
[Mul A]
[self : IsJordan A]
(a b : A)


lemma comp (h : EventuallyConst f l) (g : β → γ) : EventuallyConst (g ∘ f) l

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{l : Filter α}
{f : α → β}
(h : Filter.EventuallyConst f l)
(g : β → γ)


theorem HasDerivAtFilter.hasGradientAtFilter (h : HasDerivAtFilter g g' u L') :
    HasGradientAtFilter g (starRingEnd 𝕜 g') u L'

{𝕜 : Type u_1}
[RCLike 𝕜]
{g : 𝕜 → 𝕜}
{g' u : 𝕜}
{L' : Filter 𝕜}
(h : HasDerivAtFilter g g' u L')

HasGradientAtFilter g ((starRingEnd 𝕜) g') u L'


@[simp] theorem fmod_one (a : Int) : a.fmod 1 = 0


theorem IsModularLattice.sup_inf_sup_assoc : (x ⊔ z) ⊓ (y ⊔ z) = (x ⊔ z) ⊓ y ⊔ z

{α : Type u_1}
[Lattice α]
[IsModularLattice α]
{x y z : α}


theorem StrictConvex.is_linear_image (hs : StrictConvex 𝕜 s) {f : E → F} (h : IsLinearMap 𝕜 f)
    (hf : IsOpenMap f) : StrictConvex 𝕜 (f '' s)

{𝕜 : Type u_1}
{E : Type u_3}
{F : Type u_4}
[OrderedSemiring 𝕜]
[TopologicalSpace E]
[TopologicalSpace F]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
{s : Set E}
(hs : StrictConvex 𝕜 s)
{f : E → F}
(h : IsLinearMap 𝕜 f)
(hf : IsOpenMap f)


@[simp] lemma one_lt_sq_iff_one_lt_abs (a : α) : 1 < a ^ 2 ↔ 1 < |a|

{α : Type u_1}
[LinearOrderedRing α]
(a : α)


@[simp] protected lemma Prime.primeFactors (hp : p.Prime) : p.primeFactors = {p}


theorem borel_eq_generateFrom_of_subbasis {s : Set (Set α)} [t : TopologicalSpace α]
    [SecondCountableTopology α] (hs : t = .generateFrom s) : borel α = .generateFrom s

(hs : t = TopologicalSpace.generateFrom s)

borel α = MeasurableSpace.generateFrom s


@[simp]
protected theorem toBasis_map {G : Type*} [NormedAddCommGroup G] [InnerProductSpace 𝕜 G]
    (b : OrthonormalBasis ι 𝕜 E) (L : E ≃ₗᵢ[𝕜] G) :
    (b.map L).toBasis = b.toBasis.map L.toLinearEquiv

{ι : Type u_1}
{𝕜 : Type u_3}
[RCLike 𝕜]
{E : Type u_4}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[Fintype ι]
{G : Type u_8}
[NormedAddCommGroup G]
[InnerProductSpace 𝕜 G]
(b : OrthonormalBasis ι 𝕜 E)
(L : E ≃ₗᵢ[𝕜] G)


theorem trivialization_mem_atlas : trivializationAt F E b ∈ trivializationAtlas F E

[TopologicalSpace (Bundle.TotalSpace F E)]


lemma IsAtomic.exists_atom [OrderBot α] [Nontrivial α] [IsAtomic α] : ∃ a : α, IsAtom a

(α : Type u_2)
[PartialOrder α]
[OrderBot α]
[Nontrivial α]
[IsAtomic α]


theorem monovaryOn_const_right (f : ι → α) (b : β) (s : Set ι) : MonovaryOn f (const ι b) s

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


lemma sinKernel_neg (a : UnitAddCircle) (x : ℝ) :
    sinKernel (-a) x = -sinKernel a x

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


theorem aemeasurable_congr (h : f =ᵐ[μ] g) : AEMeasurable f μ ↔ AEMeasurable g μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
[MeasurableSpace β]
{f g : α → β}
{μ : MeasureTheory.Measure α}
(h : f =ᵐ[μ] g)


@[simp]
theorem mem_single {J'} (hJ : J ≤ I) (h : x ∈ Box.Icc I) : J' ∈ single I J hJ x h ↔ J' = J

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
{x : ι → ℝ}
{J' : BoxIntegral.Box ι}
(hJ : J ≤ I)
(h : x ∈ BoxIntegral.Box.Icc I)

J' ∈ BoxIntegral.TaggedPrepartition.single I J hJ x h ↔ J' = J


theorem perm_of_mem_permutations {l₁ l₂ : List α} (h : l₁ ∈ permutations l₂) : l₁ ~ l₂

{α : Type u_1}
{l₁ l₂ : List α}
(h : l₁ ∈ l₂.permutations)


@[reassoc (attr := simp)]
lemma lanUnit_app_whiskerLeft_lanAdjunction_counit_app (G : D ⥤ H) :
    L.lanUnit.app (L ⋙ G) ≫ whiskerLeft L ((L.lanAdjunction H).counit.app G) = 𝟙 (L ⋙ G)

[∀ (F : CategoryTheory.Functor C H), L.HasLeftKanExtension F]

CategoryTheory.CategoryStruct.comp (L.lanUnit.app (L.comp G))
    (CategoryTheory.whiskerLeft L ((L.lanAdjunction H).counit.app G)) =
  CategoryTheory.CategoryStruct.id (L.comp G)


@[to_additive]
theorem symm_comp_ofMulEquivOfLocalizations_apply {k : N ≃* P} (x) :
    k.symm ((f.ofMulEquivOfLocalizations k).toMap x) = f.toMap x

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{P : Type u_3}
[AddCommMonoid P]
(f : S.LocalizationMap N)
{k : N ≃+ P}
(x : M)

k.symm ((f.ofAddEquivOfLocalizations k).toMap x) = f.toMap x


@[simp, norm_cast]
theorem isTheta_ofReal_left {f : α → ℝ} {g : α → E} : (f · : α → ℂ) =Θ[l] g ↔ f =Θ[l] g

{α : Type u_1}
{E : Type u_2}
[Norm E]
{l : Filter α}
{f : α → ℝ}
{g : α → E}


lemma gaussianReal_apply (μ : ℝ) {v : ℝ≥0} (hv : v ≠ 0) (s : Set ℝ) :
    gaussianReal μ v s = ∫⁻ x in s, gaussianPDF μ v x

(ProbabilityTheory.gaussianReal μ v) s = ∫⁻ (x : ℝ) in s, ProbabilityTheory.gaussianPDF μ v x


@[simp]
theorem rootsExpandPowEquivRoots_apply (n : ℕ) (x) :
    (rootsExpandPowEquivRoots p f n x : R) = x ^ p ^ n

(x : { x // x ∈ ((Polynomial.expand R (p ^ n)) f).roots.toFinset })

↑((Polynomial.rootsExpandPowEquivRoots p f n) x) = ↑x ^ p ^ n


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


/--A variant of `DirectSum.induction_on` that uses `DirectSum.lof` instead of `.of`-/
theorem induction_lon {R : Type*} [Semiring R] {ι: Type*} [DecidableEq ι]
    {M : ι → Type*} [(i: ι) → AddCommMonoid <| M i] [(i : ι) → Module R (M i)]
    {C: (⨁ i, M i) → Prop} (x : ⨁ i, M i)
    (H_zero : C 0)
    (H_basic : ∀ i (x : M i), C (lof R ι M i x))
    (H_plus : ∀ (x y : ⨁ i, M i), C x → C y → C (x + y)) : C x

(H_basic : ∀ (i : ι) (x : M i), C ((DirectSum.lof R ι M i) x))

(H_plus : ∀ (x y : ⨁ (i : ι), M i), C x → C y → C (x + y))


@[simp] lemma radical_eq_top_of_isSolvable [IsSolvable R L] :
    radical R L = ⊤

(R : Type u)
(L : Type v)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsSolvable R L]


theorem CountablySeparated.mono {m m' : MeasurableSpace α} [hsep : @CountablySeparated _ m]
    (h : m ≤ m') : @CountablySeparated _ m'

[hsep : MeasurableSpace.CountablySeparated α]


theorem diff_nonempty_of_ncard_lt_ncard (h : s.ncard < t.ncard) (hs : s.Finite := by toFinite_tac) :
    (t \ s).Nonempty

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


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

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

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


theorem toJordanDecomposition_eq {s : SignedMeasure α} {j : JordanDecomposition α}
    (h : s = j.toSignedMeasure) : s.toJordanDecomposition = j

{j : MeasureTheory.JordanDecomposition α}


/-- The adjunction between the cofree and forgetful constructions for Eilenberg-Moore coalgebras
for a comonad.
-/
@[simps! unit counit]
def adj : G.forget ⊣ G.cofree

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

G.adj.unit = { app := fun X => { f := X.a, h := ⋯ }, naturality := ⋯ }


theorem numDerangements_sum (n : ℕ) :
    (numDerangements n : ℤ) =
      ∑ k ∈ Finset.range (n + 1), (-1 : ℤ) ^ k * Nat.ascFactorial (k + 1) (n - k)

↑(numDerangements n) = ∑ k ∈ Finset.range (n + 1), (-1) ^ k * ↑((k + 1).ascFactorial (n - k))


/-- The pullback functor `Sheaf J A ⥤ Sheaf K A` associated to a functor `G : C ⥤ D` in the
same direction as `G`. -/
@[simps!]
def Functor.sheafPullback : Sheaf J A ⥤ Sheaf K A

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

∀ {X Y : CategoryTheory.Sheaf J A} (f : X ⟶ Y),
  (G.sheafPullback A J K).map f = (CategoryTheory.presheafToSheaf K A).map (G.op.lan.map f.val)


theorem WSameSide.trans_wOppSide {s : AffineSubspace R P} {x y z : P} (hxy : s.WSameSide x y)
    (hyz : s.WOppSide y z) (hy : y ∉ s) : s.WOppSide x z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y z : P}
(hxy : s.WSameSide x y)
(hyz : s.WOppSide y z)
(hy : y ∉ s)


theorem csInf_image2_eq_csSup_csSup (h₁ : ∀ b, GaloisConnection (toDual ∘ l₁ b) (swap u b ∘ ofDual))
    (h₂ : ∀ a, GaloisConnection (toDual ∘ l₂ a) (u a ∘ ofDual)) :
    s.Nonempty → BddAbove s → t.Nonempty → BddAbove t → sInf (image2 u s t) = u (sSup s) (sSup t)

{u : α → β → γ}

{l₁ : β → γ → α}

{l₂ : α → γ → β}

(h₁ : ∀ (b : β), GaloisConnection (⇑OrderDual.toDual ∘ l₁ b) (Function.swap u b ∘ ⇑OrderDual.ofDual))

(h₂ : ∀ (a : α), GaloisConnection (⇑OrderDual.toDual ∘ l₂ a) (u a ∘ ⇑OrderDual.ofDual))

s.Nonempty → BddAbove s → t.Nonempty → BddAbove t → sInf (Set.image2 u s t) = u (sSup s) (sSup t)


/-- The property that all arguments are numeric is leftward-closed under `ArgsRel`. -/
lemma ArgsRel.numeric_closed {a' a} : ArgsRel a' a → a.Numeric → a'.Numeric

Surreal.Multiplication.ArgsRel a' a → a.Numeric → a'.Numeric


@[simp]
theorem smul_mem_pointwise_smul_iff {g : G} {S : ValuationSubring K} {x : K} :
    g • x ∈ g • S ↔ x ∈ S

{K : Type u}
[Field K]
{G : Type u_1}
[Group G]
[MulSemiringAction G K]
{g : G}
{S : ValuationSubring K}
{x : K}


@[to_additive]
theorem lift_unique {j : N →* P} (hj : ∀ x, j (f.toMap x) = g x) : f.lift hg = j

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{P : Type u_3}
[CommMonoid P]
(f : S.LocalizationMap N)
{g : M →* P}
(hg : ∀ (y : ↥S), IsUnit (g ↑y))
{j : N →* P}
(hj : ∀ (x : M), j (f.toMap x) = g x)


theorem coeffs_one : coeffs (1 : R[X]) ⊆ {1}


/-- Every diagram indexing a pullback is naturally isomorphic (actually, equal) to a `cospan` -/
-- @[simps (config := { rhsMd := semireducible })]  Porting note: no semireducible
@[simps!]
def diagramIsoCospan (F : WalkingCospan ⥤ C) : F ≅ cospan (F.map inl) (F.map inr)

(F : CategoryTheory.Limits.WalkingCospan ⥤ C)

(CategoryTheory.Limits.diagramIsoCospan F).inv.app X = CategoryTheory.eqToHom ⋯


@[to_additive (attr := simp)]
theorem ofLeftInverse_apply {f : G →* N} {g : N →* G} (h : Function.LeftInverse g f) (x : G) :
    ↑(ofLeftInverse h x) = f x

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{f : G →* N}
{g : N →* G}
(h : Function.LeftInverse ⇑g ⇑f)
(x : G)


theorem log_pos_real' {x : ℝ≥0∞} (h : 0 < x.toReal) :
    log x = Real.log (ENNReal.toReal x)


lemma isOpen_preimage_ofUpper : IsOpen (ofUpper ⁻¹' s) ↔ (upper α).IsOpen s

IsOpen (⇑Topology.WithUpper.ofUpper ⁻¹' s) ↔ TopologicalSpace.IsOpen s


/-- The *Euler Product* for multiplicative (on coprime arguments) functions.

If `f : ℕ → R`, where `R` is a complete normed commutative ring, `f 0 = 0`, `f 1 = 1`, `f` i
multiplicative on coprime arguments, and `‖f ·‖` is summable, then
`∏' p : ℕ, if p.Prime then ∑' e, f (p ^ e) else 1 = ∑' n, f n`.
This version is stated using `HasProd` and `Set.mulIndicator`. -/
theorem eulerProduct_hasProd_mulIndicator (hsum : Summable (‖f ·‖)) (hf₀ : f 0 = 0) :
    HasProd (Set.mulIndicator {p | Nat.Prime p} fun p ↦  ∑' e, f (p ^ e)) (∑' n, f n)

(hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n)

HasProd ({p | Nat.Prime p}.mulIndicator fun p => ∑' (e : ℕ), f (p ^ e)) (∑' (n : ℕ), f n)


@[to_additive (attr := simp)]
theorem isUnit_coe : IsUnit (s : Set α) ↔ IsUnit s

{α : Type u_2}
[DecidableEq α]
[SubtractionMonoid α]
{s : Finset α}


theorem log_eq_of_pow_le_of_lt_pow {b m n : ℕ} (h₁ : b ^ m ≤ n) (h₂ : n < b ^ (m + 1)) :
    log b n = m


theorem exists_nat_pos_inv_mul_lt (ha : a ≠ ∞) (hb : b ≠ 0) :
    ∃ n > 0, ((n : ℕ) : ℝ≥0∞)⁻¹ * a < b

{a b : ENNReal}
(ha : a ≠ ⊤)
(hb : b ≠ 0)


@[to_additive]
theorem not_step_nil : ¬Step [] L


lemma dblZ_of_Y_eq [NoZeroDivisors R] {P Q : Fin 3 → R} (hQz : Q z ≠ 0)
    (hx : P x * Q z ^ 2 = Q x * P z ^ 2) (hy : P y * Q z ^ 3 = Q y * P z ^ 3)
    (hy' : P y * Q z ^ 3 = W'.negY Q * P z ^ 3) : W'.dblZ P = 0


/-- `S.normedMk` is surjective. -/
theorem surjective_normedMk (S : AddSubgroup M) : Function.Surjective (normedMk S)

{M : Type u_1}
[SeminormedAddCommGroup M]
(S : AddSubgroup M)


/-- The (bundled) homeomorphism associated to an isometric isomorphism. -/
@[simps toEquiv]
protected def toHomeomorph (h : α ≃ᵢ β) : α ≃ₜ β

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


theorem map_inf [SemilatticeSup β] (hf : AntitoneOn f s) (hx : x ∈ s) (hy : y ∈ s) :
    f (x ⊓ y) = f x ⊔ f y

{α : Type u}
{β : Type v}
{f : α → β}
{s : Set α}
{x y : α}
[LinearOrder α]
[SemilatticeSup β]
(hf : AntitoneOn f s)
(hx : x ∈ s)
(hy : y ∈ s)


@[to_additive]
theorem mem_nhds_one (B : GroupFilterBasis G) {U : Set G} (hU : U ∈ B) :
    U ∈ @nhds G B.topology 1

{G : Type u}
[Group G]
(B : GroupFilterBasis G)
{U : Set G}
(hU : U ∈ B)


/-- If the angle ∠ABC at a point is π, the angle ∠BAC is 0. -/
theorem angle_eq_zero_of_angle_eq_pi_left {p1 p2 p3 : P} (h : ∠ p1 p2 p3 = π) : ∠ p2 p1 p3 = 0

(h : EuclideanGeometry.angle p1 p2 p3 = π)


@[simp, norm_cast]
theorem coe_sup : ⇑(p ⊔ q) = ⇑p ⊔ ⇑q

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


/-- If the singleton `{x}` has non-zero mass for `ρ.fst`, then for all `s : Set Ω`,
`ρ.condKernel x s = (ρ.fst {x})⁻¹ * ρ ({x} ×ˢ s)` . -/
lemma _root_.MeasureTheory.Measure.condKernel_apply_of_ne_zero [MeasurableSingletonClass α]
    {x : α} (hx : ρ.fst {x} ≠ 0) (s : Set Ω) :
    ρ.condKernel x s = (ρ.fst {x})⁻¹ * ρ ({x} ×ˢ s)

{α : Type u_1}
{Ω : Type u_4}
{mα : MeasurableSpace α}
[MeasurableSpace Ω]
[StandardBorelSpace Ω]
[Nonempty Ω]
{ρ : MeasureTheory.Measure (α × Ω)}
[MeasureTheory.IsFiniteMeasure ρ]
[MeasurableSingletonClass α]
{x : α}
(hx : ρ.fst {x} ≠ 0)
(s : Set Ω)

(ρ.condKernel x) s = (ρ.fst {x})⁻¹ * ρ ({x} ×ˢ s)


theorem traverse_map' (g : α → β) (h : β → G γ) :
    traverse (h ∘ g) = (traverse h ∘ map g : t α → G (t γ))

{t : Type u → Type u}
[Traversable t]
[LawfulTraversable t]
{G : Type u → Type u}
[Applicative G]
[LawfulApplicative G]
{α β γ : Type u}
(g : α → β)
(h : β → G γ)

traverse (h ∘ g) = traverse h ∘ Functor.map g


@[simp]
theorem bot_lt_add_iff {x y : EReal} : ⊥ < x + y ↔ ⊥ < x ∧ ⊥ < y


theorem _root_.Polynomial.Monic.leadingCoeff_not_mem (hf : f.Monic) (h : 𝓟 ≠ ⊤) :
    ¬f.leadingCoeff ∈ 𝓟

{R : Type u}
[CommSemiring R]
{𝓟 : Ideal R}
{f : R[X]}
(hf : f.Monic)
(h : 𝓟 ≠ ⊤)


theorem rank_le_of_submodule (s t : Submodule R M) (h : s ≤ t) :
    Module.rank R s ≤ Module.rank R t

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
(s t : Submodule R M)
(h : s ≤ t)


theorem Equiv.Perm.viaFintypeEmbedding_apply_not_mem_range {b : β} (h : b ∉ Set.range f) :
    e.viaFintypeEmbedding f b = b

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[DecidableEq β]
(e : Equiv.Perm α)
(f : α ↪ β)
{b : β}
(h : b ∉ Set.range ⇑f)


/-- Structure recording good behavior of a property of a triple `(f, s, x)` where `f` is a function,
`s` a set and `x` a point. Good behavior here means locality and invariance under given groupoids
(both in the source and in the target). Given such a good behavior, the lift of this property
to charted spaces admitting these groupoids will inherit the good behavior. -/
structure LocalInvariantProp (P : (H → H') → Set H → H → Prop) : Prop where
  is_local : ∀ {s x u} {f : H → H'}, IsOpen u → x ∈ u → (P f s x ↔ P f (s ∩ u) x)
  right_invariance' : ∀ {s x f} {e : PartialHomeomorph H H},
    e ∈ G → x ∈ e.source → P f s x → P (f ∘ e.symm) (e.symm ⁻¹' s) (e x)
  congr_of_forall : ∀ {s x} {f g : H → H'}, (∀ y ∈ s, f y = g y) → f x = g x → P f s x → P g s x
  left_invariance' : ∀ {s x f} {e' : PartialHomeomorph H' H'},
    e' ∈ G' → s ⊆ f ⁻¹' e'.source → f x ∈ e'.source → P f s x → P (e' ∘ f) s x

{H : Type u_1}
{H' : Type u_3}
[TopologicalSpace H]
[TopologicalSpace H']
{G : StructureGroupoid H}
{G' : StructureGroupoid H'}
{P : (H → H') → Set H → H → Prop}
(self : G.LocalInvariantProp G' P)
{s : Set H}
{x : H}
{f : H → H'}
{e : PartialHomeomorph H H}

e ∈ G → x ∈ e.source → P f s x → P (f ∘ ↑e.symm) (↑e.symm ⁻¹' s) (↑e x)


theorem divInt_mul_divInt_cancel {x : ℤ} (hx : x ≠ 0) (n d : ℤ) : n /. x * (x /. d) = n /. d

Rat.divInt n x * Rat.divInt x d = Rat.divInt n d


@[simp, norm_cast]
theorem cast_intCast (n : ℤ) : ((n : ℚ) : α) = n


theorem integral_Icc_eq_integral_Ioo' (hx : μ {x} = 0) (hy : μ {y} = 0) :
    ∫ t in Icc x y, f t ∂μ = ∫ t in Ioo x y, f t ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → E}
{μ : MeasureTheory.Measure X}
[PartialOrder X]
{x y : X}
(hx : μ {x} = 0)
(hy : μ {y} = 0)

∫ (t : X) in Set.Icc x y, f t ∂μ = ∫ (t : X) in Set.Ioo x y, f t ∂μ


lemma killingForm_eq_zero_of_mem_zeroRoot_mem_posFitting
    (H : LieSubalgebra R L) [LieAlgebra.IsNilpotent R H]
    {x₀ x₁ : L}
    (hx₀ : x₀ ∈ LieAlgebra.zeroRootSubalgebra R L H)
    (hx₁ : x₁ ∈ LieModule.posFittingComp R H L) :
    killingForm R L x₀ x₁ = 0

(hx₁ : x₁ ∈ LieModule.posFittingComp R (↥H) L)


/-- Typeclass saying that `F` is a type of bundled equivalences such that all `e : F` are
dilations. -/
class DilationEquivClass [EquivLike F X Y] : Prop where
  edist_eq' : ∀ f : F, ∃ r : ℝ≥0, r ≠ 0 ∧ ∀ x y : X, edist (f x) (f y) = r * edist x y

{F : Type u_1}
{X : outParam (Type u_2)}
{Y : outParam (Type u_3)}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
[EquivLike F X Y]
[self : DilationEquivClass F X Y]
(f : F)

∃ r, r ≠ 0 ∧ ∀ (x y : X), edist (f x) (f y) = ↑r * edist x y


@[to_additive]
theorem pow_eq_one_iff {x : M} {n : ℕ} (hn : n ≠ 0) : x ^ n = 1 ↔ x = 1

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


theorem dvd_div_of_mul_dvd {a b c : R} (h : a * b ∣ c) : b ∣ c / a

{R : Type u}
[EuclideanDomain R]
{a b c : R}
(h : a * b ∣ c)


private lemma div_two_lt {n : ℕ} (h0 : n ≠ 0) : n / 2 < n


/-- For each object in `C`, there is a triangle of the form `(X,X,0,𝟙 X,0,0)`
-/
@[simps!]
def contractibleTriangle (X : C) : Triangle C

(CategoryTheory.Pretriangulated.contractibleTriangle X).mor₂ = 0


theorem compProdFun_tsum_left (κ : Kernel α β) (η : Kernel (α × β) γ) [IsSFiniteKernel κ] (a : α)
    (s : Set (β × γ)) : compProdFun κ η a s = ∑' n, compProdFun (seq κ n) η a s

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

κ.compProdFun η a s = ∑' (n : ℕ), (κ.seq n).compProdFun η a s


theorem iff_isOpen_fiber {f : X → Y} : IsLocallyConstant f ↔ ∀ y, IsOpen (f ⁻¹' {y})

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
{f : X → Y}

IsLocallyConstant f ↔ ∀ (y : Y), IsOpen (f ⁻¹' {y})


/-- If `K : HomologicalComplex C c'`, then `K.IsStrictlySupported e` holds for
an embedding `e : c.Embedding c'` of complex shapes if `K` is exact at `i'`
whenever `i'` is not of the form `e.f i` for some `i`.-/
class IsSupported : Prop where
  exactAt (i' : ι') (hi' : ∀ i, e.f i ≠ i') : K.ExactAt i'


theorem coe_pow (f : E →ₗᵢ[R] E) (n : ℕ) : ⇑(f ^ n) = f^[n]

{R : Type u_1}
{E : Type u_5}
[Semiring R]
[SeminormedAddCommGroup E]
[Module R E]
(f : E →ₗᵢ[R] E)
(n : ℕ)


/-- `s ×ˢ t` is homeomorphic to `s × t`. -/
@[simps!]
def Set.prod (s : Set X) (t : Set Y) : ↥(s ×ˢ t) ≃ₜ s × t

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(s : Set X)
(t : Set Y)
(x : { c // s c.1 ∧ t c.2 })

(Homeomorph.Set.prod s t) x = (⟨(↑x).1, ⋯⟩, ⟨(↑x).2, ⋯⟩)


/-- When both `S.f` and `S.g` are zero, the middle object `S.X₂`
gives a right homology data on S -/
@[simps]
def ofZeros (hf : S.f = 0) (hg : S.g = 0) : S.RightHomologyData

(CategoryTheory.ShortComplex.RightHomologyData.ofZeros S hf hg).p = CategoryTheory.CategoryStruct.id S.X₂


theorem sign_eq_and_abs_eq_iff_eq {x y : EReal} :
    x.abs = y.abs ∧ sign x = sign y ↔ x = y

x.abs = y.abs ∧ SignType.sign x = SignType.sign y ↔ x = y


@[simp]
theorem iSup_exists {p : ι → Prop} {f : Exists p → α} : ⨆ x, f x = ⨆ (i) (h), f ⟨i, h⟩

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
{p : ι → Prop}
{f : Exists p → α}

⨆ (x : Exists p), f x = ⨆ i, ⨆ (h : p i), f ⋯


@[norm_cast]
theorem coe_neg : ∀ {x : ℚ}, (↑(-x) : ℚ_[p]) = -↑x


theorem Dense.borel_eq_generateFrom_Ico_mem {α : Type*} [TopologicalSpace α] [LinearOrder α]
    [OrderTopology α] [SecondCountableTopology α] [DenselyOrdered α] [NoMinOrder α] {s : Set α}
    (hd : Dense s) :
    borel α = .generateFrom { S : Set α | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S }

{α : Type u_5}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[SecondCountableTopology α]
[DenselyOrdered α]
[NoMinOrder α]
{s : Set α}
(hd : Dense s)

borel α = MeasurableSpace.generateFrom {S | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Set.Ico l u = S}


lemma W.unshift {X₁ X₂ : C} {f : X₁ ⟶ X₂} {n : ℤ} (hf : S.W (f⟦n⟧')) : S.W f

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

{S : CategoryTheory.Triangulated.Subcategory C}

(hf : S.W ((CategoryTheory.shiftFunctor C n).map f))


private theorem map_mk_unit_aux [DecidableEq α] {f : Associates α →* α}
    (hinv : Function.RightInverse f Associates.mk) (a : α) :
    a * ↑(Classical.choose (associated_map_mk hinv a)) = f (Associates.mk a)

(hinv : Function.RightInverse (⇑f) Associates.mk)

a * ↑(Classical.choose ⋯) = f (Associates.mk a)


@[simp] theorem eq_true_and_eq_false_self : ∀(b : Bool), (b = true ∧ b = false) ↔ False


theorem isNormal_iff_strictMono_limit (f : Ordinal → Ordinal) :
    IsNormal f ↔ StrictMono f ∧ ∀ o, IsLimit o → ∀ a, (∀ b < o, f b ≤ a) → f o ≤ a

Ordinal.IsNormal f ↔
  StrictMono f ∧ ∀ (o : Ordinal.{u_4}), o.IsLimit → ∀ (a : Ordinal.{u_5}), (∀ b < o, f b ≤ a) → f o ≤ a


@[simp] theorem drop_drop (n : Nat) : ∀ (m) (l : List α), drop n (drop m l) = drop (n + m) l

List.drop n (List.drop m l) = List.drop (n + m) l


theorem SupIndep.attach (hs : s.SupIndep f) : s.attach.SupIndep fun a => f a

{α : Type u_1}
{ι : Type u_3}
[Lattice α]
[OrderBot α]
{s : Finset ι}
{f : ι → α}
(hs : s.SupIndep f)


theorem forall₂_iff_zip {l₁ l₂} :
    Forall₂ R l₁ l₂ ↔ length l₁ = length l₂ ∧ ∀ {a b}, (a, b) ∈ zip l₁ l₂ → R a b

{α : Type u_1}
{β : Type u_2}
{R : α → β → Prop}
{l₁ : List α}
{l₂ : List β}

List.Forall₂ R l₁ l₂ ↔ l₁.length = l₂.length ∧ ∀ {a : α} {b : β}, (a, b) ∈ l₁.zip l₂ → R a b


/-- A cofork on `f g : X ⟶ Y` is determined by the morphism `π : Y ⟶ P` satisfying
    `f ≫ π = g ≫ π`. -/
@[simps]
def Cofork.ofπ {P : C} (π : Y ⟶ P) (w : f ≫ π = g ≫ π) : Cofork f g

(w : CategoryTheory.CategoryStruct.comp f π = CategoryTheory.CategoryStruct.comp g π)

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


/-- Left translation preserves strict concavity. -/
theorem StrictConcaveOn.translate_left (hf : StrictConcaveOn 𝕜 s f) (c : E) :
    StrictConcaveOn 𝕜 ((fun z => c + z) ⁻¹' s) (f ∘ fun z => z + c)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCancelCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[SMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : StrictConcaveOn 𝕜 s f)
(c : E)


@[simp]
theorem le_min'_iff {x} : x ≤ s.min' H ↔ ∀ y ∈ s, x ≤ y

{α : Type u_2}
[LinearOrder α]
(s : Finset α)
(H : s.Nonempty)
{x : α}


theorem subset_intentClosure_extentClosure (t : Set β) :
    t ⊆ intentClosure r (extentClosure r t)

{α : Type u_2}
{β : Type u_3}
(r : α → β → Prop)
(t : Set β)


lemma log_nz_of_isRat {n : ℤ} : (NormNum.IsRat e n d) → (decide ((0 : ℚ) < n / d))
    → (decide (n / d < (1 : ℚ))) → (Real.log (e : ℝ) ≠ 0)

Mathlib.Meta.NormNum.IsRat e n d → decide (0 < ↑n / ↑d) = true → decide (↑n / ↑d < 1) = true → Real.log e ≠ 0


theorem farFromTriangleFree_iff :
    G.FarFromTriangleFree ε ↔ ∀ ⦃H : SimpleGraph α⦄, [DecidableRel H.Adj] → H ≤ G → H.CliqueFree 3 →
      ε * (card α ^ 2 : ℕ) ≤ G.edgeFinset.card - H.edgeFinset.card

{α : Type u_1}
{𝕜 : Type u_3}
[LinearOrderedField 𝕜]
{G : SimpleGraph α}
{ε : 𝕜}
[Fintype α]
[DecidableRel G.Adj]

G.FarFromTriangleFree ε ↔
  ∀ ⦃H : SimpleGraph α⦄ [inst : DecidableRel H.Adj],
    H ≤ G → H.CliqueFree 3 → ε * ↑(Fintype.card α ^ 2) ≤ ↑G.edgeFinset.card - ↑H.edgeFinset.card


@[simp]
theorem dedup_idem {l : List α} : dedup (dedup l) = dedup l

{α : Type u_1}
[DecidableEq α]
{l : List α}


@[simp]
theorem inter_replicate (s : Multiset α) (n : ℕ) (x : α) :
    s ∩ replicate n x = replicate (min (s.count x) n) x

{α : Type u_1}
[DecidableEq α]
(s : Multiset α)
(n : ℕ)
(x : α)

s ∩ Multiset.replicate n x = Multiset.replicate (min (Multiset.count x s) n) x


/-- Shows that any non-identity element of $A_5$ whose cycle decomposition consists only of swaps
  is conjugate to $(04)(13)$. This is used to show that the normal closure of such a permutation
  in $A_5$ is $A_5$. -/
theorem isConj_swap_mul_swap_of_cycleType_two {g : Perm (Fin 5)} (ha : g ∈ alternatingGroup (Fin 5))
    (h1 : g ≠ 1) (h2 : ∀ n, n ∈ cycleType (g : Perm (Fin 5)) → n = 2) :
    IsConj (swap 0 4 * swap 1 3) g

{g : Equiv.Perm (Fin 5)}
(ha : g ∈ alternatingGroup (Fin 5))
(h1 : g ≠ 1)
(h2 : ∀ n ∈ g.cycleType, n = 2)

IsConj (Equiv.swap 0 4 * Equiv.swap 1 3) g


theorem fderivWithin_clm_comp (hxs : UniqueDiffWithinAt 𝕜 s x) (hc : DifferentiableWithinAt 𝕜 c s x)
    (hd : DifferentiableWithinAt 𝕜 d s x) :
    fderivWithin 𝕜 (fun y => (c y).comp (d y)) s x =
      (compL 𝕜 F G H (c x)).comp (fderivWithin 𝕜 d s x) +
        ((compL 𝕜 F G H).flip (d x)).comp (fderivWithin 𝕜 c s x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{x : E}
{s : Set E}
{H : Type u_6}
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
{c : E → G →L[𝕜] H}
{d : E → F →L[𝕜] G}
(hxs : UniqueDiffWithinAt 𝕜 s x)
(hc : DifferentiableWithinAt 𝕜 c s x)
(hd : DifferentiableWithinAt 𝕜 d s x)

fderivWithin 𝕜 (fun y => (c y).comp (d y)) s x =
  ((ContinuousLinearMap.compL 𝕜 F G H) (c x)).comp (fderivWithin 𝕜 d s x) +
    ((ContinuousLinearMap.compL 𝕜 F G H).flip (d x)).comp (fderivWithin 𝕜 c s x)


@[to_additive]
theorem tprod_sigma {γ : β → Type*} {f : (Σb : β, γ b) → α} (ha : Multipliable f) :
    ∏' p, f p = ∏' (b) (c), f ⟨b, c⟩

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[UniformSpace α]
[UniformAddGroup α]
[CompleteSpace α]
[T0Space α]
{γ : β → Type u_5}
{f : (b : β) × γ b → α}
(ha : Summable f)

∑' (p : (b : β) × γ b), f p = ∑' (b : β) (c : γ b), f ⟨b, c⟩


@[simp, mfld_simps]
theorem trivializationAt_coordChange_eq {b₀ b₁ b : B}
    (hb : b ∈ (trivializationAt F Z.Fiber b₀).baseSet ∩ (trivializationAt F Z.Fiber b₁).baseSet)
    (v : F) :
    (trivializationAt F Z.Fiber b₀).coordChangeL R (trivializationAt F Z.Fiber b₁) b v =
      Z.coordChange (Z.indexAt b₀) (Z.indexAt b₁) b v

(Trivialization.coordChangeL R (trivializationAt F Z.Fiber b₀) (trivializationAt F Z.Fiber b₁) b) v =
  (Z.coordChange (Z.indexAt b₀) (Z.indexAt b₁) b) v


@[simp]
theorem comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C)
    (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) :
    g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f

{R : Type u}
[CommSemiring R]
{A : Type u}
[Semiring A]
[Algebra R A]
{B : Type u}
[CommRing B]
[Algebra R B]
{C : Type u}
[CommRing C]
[Algebra R C]
[Algebra.FormallySmooth R A]
(f : A →ₐ[R] C)
(g : B →ₐ[R] C)
(hg : Function.Surjective ⇑g)
(hg' : IsNilpotent (RingHom.ker ↑g))

g.comp (Algebra.FormallySmooth.liftOfSurjective f g hg hg') = f


theorem I_mul_im (z : ℂ) : (I * z).im = z.re


theorem pow_sub_lt_descFactorial {n : ℕ} :
    ∀ {k : ℕ}, 2 ≤ k → k ≤ n → (n + 1 - k) ^ k < n.descFactorial k


/-- An orthogonal basis with respect to a nondegenerate bilinear form has no self-orthogonal
elements. -/
theorem iIsOrtho.not_isOrtho_basis_self_of_nondegenerate {n : Type w} [Nontrivial R]
    {B : BilinForm R M} {v : Basis n R M} (h : B.iIsOrtho v) (hB : B.Nondegenerate) (i : n) :
    ¬B.IsOrtho (v i) (v i)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{n : Type w}
[Nontrivial R]
{B : LinearMap.BilinForm R M}
{v : Basis n R M}
(h : B.iIsOrtho ⇑v)
(hB : B.Nondegenerate)
(i : n)


theorem setIntegral_gt_gt {R : ℝ} {f : X → ℝ} (hR : 0 ≤ R)
    (hfint : IntegrableOn f {x | ↑R < f x} μ) (hμ : μ {x | ↑R < f x} ≠ 0) :
    (μ {x | ↑R < f x}).toReal * R < ∫ x in {x | ↑R < f x}, f x ∂μ

(hfint : MeasureTheory.IntegrableOn f {x | R < f x} μ)

(μ {x | R < f x}).toReal * R < ∫ (x : X) in {x | R < f x}, f x ∂μ


theorem sum_antidiagonal_card_esymm_psum_eq_zero :
    ∑ a ∈ antidiagonal (Fintype.card σ), (-1) ^ a.fst * esymm σ R a.fst * psum σ R a.snd = 0

(σ : Type u_1)
[Fintype σ]
(R : Type u_2)
[CommRing R]

∑ a ∈ Finset.antidiagonal (Fintype.card σ), (-1) ^ a.1 * MvPolynomial.esymm σ R a.1 * MvPolynomial.psum σ R a.2 = 0


@[simp]
theorem subtypeVal_toSubtype {α : TypeVec n} (p : α ⟹ «repeat» n Prop) :
    subtypeVal p ⊚ toSubtype p = fun _ => Subtype.val

{n : ℕ}
{α : TypeVec.{u_1} n}
(p : α.Arrow (TypeVec.repeat n Prop))

TypeVec.comp (TypeVec.subtypeVal p) (TypeVec.toSubtype p) = fun x => Subtype.val


@[to_additive]
theorem isometry_mul_left [Mul M] [PseudoEMetricSpace M] [IsometricSMul M M] (a : M) :
    Isometry (a * ·)

{M : Type u}
[Add M]
[PseudoEMetricSpace M]
[IsometricVAdd M M]
(a : M)


lemma restrictStalkIso_hom_eq_germ_apply (y) :
    (X.restrictStalkIso h x).hom ((X.restrict h).presheaf.germ ⟨x, hx⟩ y) =
      X.presheaf.germ ⟨f x, show f x ∈ h.isOpenMap.functor.obj V from ⟨x, hx, rfl⟩⟩ y

(y : ↑((X.restrict h).presheaf.obj (Opposite.op V)))

(X.restrictStalkIso h x).hom (((X.restrict h).presheaf.germ ⟨x, hx⟩) y) = (X.presheaf.germ ⟨f x, ⋯⟩) y


@[simp] theorem coe_castAdd (m : Nat) (i : Fin n) : (castAdd m i : Nat) = i


@[to_additive]
theorem tprod_union_disjoint {s t : Set β} (hd : Disjoint s t) (hs : Multipliable (f ∘ (↑) : s → α))
    (ht : Multipliable (f ∘ (↑) : t → α)) :
    ∏' x : ↑(s ∪ t), f x = (∏' x : s, f x) * ∏' x : t, f x

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

∏' (x : ↑(s ∪ t)), f ↑x = (∏' (x : ↑s), f ↑x) * ∏' (x : ↑t), f ↑x


/-- The `n`th power map on a commutative monoid for a natural `n`, considered as a morphism of
monoids. -/
@[to_additive (attr := simps) "Multiplication by a natural `n` on a commutative additive monoid,
considered as a morphism of additive monoids."]
def powMonoidHom (n : ℕ) : α →* α

{α : Type u_1}
[AddCommMonoid α]
(n : ℕ)

∀ (x : α), (nsmulAddMonoidHom n) x = n • x


@[to_additive (attr := simp)]
theorem alternatingProd_cons (a : α) (l : List α) :
    alternatingProd (a :: l) = a / alternatingProd l

{α : Type u_2}
[AddCommGroup α]
(a : α)
(l : List α)

(a :: l).alternatingSum = a - l.alternatingSum


@[simp]
theorem lieEquivMatrix'_apply (f : Module.End R (n → R)) :
    lieEquivMatrix' f = LinearMap.toMatrix' f

{R : Type u}
[CommRing R]
{n : Type w}
[DecidableEq n]
[Fintype n]
(f : Module.End R (n → R))


theorem toReal_inf {a b : ℝ≥0∞} : a ≠ ∞ → b ≠ ∞ → (a ⊓ b).toReal = a.toReal ⊓ b.toReal

a ≠ ⊤ → b ≠ ⊤ → (a ⊓ b).toReal = a.toReal ⊓ b.toReal


theorem hammingNorm_comp_le_hammingNorm (f : ∀ i, γ i → β i) {x : ∀ i, γ i} (hf : ∀ i, f i 0 = 0) :
    (hammingNorm fun i => f i (x i)) ≤ hammingNorm x

{ι : Type u_2}
{β : ι → Type u_3}
[Fintype ι]
[(i : ι) → DecidableEq (β i)]
{γ : ι → Type u_4}
[(i : ι) → DecidableEq (γ i)]
[(i : ι) → Zero (β i)]
[(i : ι) → Zero (γ i)]
(f : (i : ι) → γ i → β i)
{x : (i : ι) → γ i}
(hf : ∀ (i : ι), f i 0 = 0)


theorem finsetCongr_toEmbedding (e : α ≃ β) :
    e.finsetCongr.toEmbedding = (Finset.mapEmbedding e.toEmbedding).toEmbedding

{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)


@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem nonempty_product : (s ×ˢ t).Nonempty ↔ s.Nonempty ∧ t.Nonempty

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}


lemma apply_some (h : l.idxFun i = some a) : l x i = a

{α : Type u_2}
{ι : Type u_3}
{l : Combinatorics.Line α ι}
{i : ι}
{a x : α}
(h : l.idxFun i = some a)

(fun x i => (l.idxFun i).getD x) x i = a


theorem aecover_Iio [NoMaxOrder α] : AECover μ l fun i => Iio (b i)

{α : Type u_1}
{ι : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
[OpensMeasurableSpace α]
{b : ι → α}
(hb : Filter.Tendsto b l Filter.atTop)
[NoMaxOrder α]

MeasureTheory.AECover μ l fun i => Set.Iio (b i)


/--
Equivalent preregular categories give equivalent regular toposes.
-/
@[simps!]
def sheafCongrPreregular : haveI := e.preregular
    Sheaf (regularTopology C) A ≌ Sheaf (regularTopology D) A

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

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


@[to_additive]
theorem Bornology.IsBounded.inv : IsBounded s → IsBounded s⁻¹

{E : Type u_1}
[SeminormedGroup E]
{s : Set E}

Bornology.IsBounded s → Bornology.IsBounded s⁻¹


protected theorem mul_inv_rev (φ ψ : k⟦X⟧) : (φ * ψ)⁻¹ = ψ⁻¹ * φ⁻¹

{k : Type u_2}
[Field k]
(φ ψ : PowerSeries k)

(φ * ψ)⁻¹ = ψ⁻¹ * φ⁻¹


theorem forget_lat_partOrd_eq_forget_bddOrd_partOrd :
    forget₂ BddLat Lat ⋙ forget₂ Lat PartOrd =
      forget₂ BddLat BddOrd ⋙ forget₂ BddOrd PartOrd

CategoryTheory.forget₂ BddLat Lat ⋙ CategoryTheory.forget₂ Lat PartOrd =
  CategoryTheory.forget₂ BddLat BddOrd ⋙ CategoryTheory.forget₂ BddOrd PartOrd


theorem Cofix.bisim (r : Cofix F → Cofix F → Prop)
    (h : ∀ x y, r x y → Liftr r (Cofix.dest x) (Cofix.dest y)) : ∀ x y, r x y → x = y

(h : ∀ (x y : QPF.Cofix F), r x y → Functor.Liftr r x.dest y.dest)


/-- The prod of two morphisms is a morphism. -/
@[simps]
def prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : A →ₙₐ[R] B × C

{R : Type u}
[Monoid R]
{A : Type v}
{B : Type w}
{C : Type w₁}
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[NonUnitalNonAssocSemiring B]
[NonUnitalNonAssocSemiring C]
[DistribMulAction R B]
[DistribMulAction R C]
(f : A →ₙₐ[R] B)
(g : A →ₙₐ[R] C)
(i : A)


/--
A functor `F : C ⥤ D` is final if for every `d : D`, the comma category of morphisms `d ⟶ F.obj c`
is connected.

See <https://stacks.math.columbia.edu/tag/04E6>
-/
class Final (F : C ⥤ D) : Prop where
  out (d : D) : IsConnected (StructuredArrow d F)

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

CategoryTheory.IsConnected (CategoryTheory.StructuredArrow d F)


theorem nhdsWithin_lt_le_nhdsWithin_stolzSet {M : ℝ} (hM : 1 < M) :
    (𝓝[<] 1).map ofReal' ≤ 𝓝[stolzSet M] 1

Filter.map Complex.ofReal' (𝓝[<] 1) ≤ 𝓝[Complex.stolzSet M] 1


/-- Cancellation of a telescoping product. -/
@[to_additive "Cancellation of a telescoping sum."]
theorem prod_range_div' (n : ℕ) (f : ℕ → G) :
    ((range n).map fun k ↦ f k / f (k + 1)).prod = f 0 / f n

{G : Type u_7}
[AddGroup G]
(n : ℕ)
(f : ℕ → G)

(List.map (fun k => f k - f (k + 1)) (List.range n)).sum = f 0 - f n


{α : Type u_2}
[SemilatticeSup α]
{s : Set α}


theorem Heap.realSize_merge (le) (s₁ s₂ : Heap α) :
    (s₁.merge le s₂).realSize = s₁.realSize + s₂.realSize

(s₁ s₂ : Batteries.BinomialHeap.Imp.Heap α)

(Batteries.BinomialHeap.Imp.Heap.merge le s₁ s₂).realSize = s₁.realSize + s₂.realSize


protected theorem lt_add_of_sub_left_lt {a b c : Int} (h : a - b < c) : a < b + c


/-- The projective limit of a family of finite measures is unique. -/
theorem unique [∀ i, IsFiniteMeasure (P i)]
    (hμ : IsProjectiveLimit μ P) (hν : IsProjectiveLimit ν P) :
    μ = ν

{P : (J : Finset ι) → MeasureTheory.Measure ((j : { x // x ∈ J }) → α ↑j)}

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

[∀ (i : Finset ι), MeasureTheory.IsFiniteMeasure (P i)]

(hμ : MeasureTheory.IsProjectiveLimit μ P)

(hν : MeasureTheory.IsProjectiveLimit ν P)


@[symm]
theorem Algebra.IsPushout.symm (h : Algebra.IsPushout R S R' S') : Algebra.IsPushout R R' S S'

{R : Type u_1}
{S : Type v₃}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
{R' : Type u_6}
{S' : Type u_7}
[CommSemiring R']
[CommSemiring S']
[Algebra R R']
[Algebra S S']
[Algebra R' S']
[Algebra R S']
[IsScalarTower R R' S']
[IsScalarTower R S S']
(h : Algebra.IsPushout R S R' S')


theorem integral_truncation_eq_intervalIntegral (hf : AEStronglyMeasurable f μ) {A : ℝ}
    (hA : 0 ≤ A) : ∫ x, truncation f A x ∂μ = ∫ y in -A..A, y ∂Measure.map f μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

∫ (x : α), ProbabilityTheory.truncation f A x ∂μ = ∫ (y : ℝ) in -A..A, y ∂MeasureTheory.Measure.map f μ


@[simp]
theorem Matrix.vecMul_stdBasis (M : Matrix m n R) (i j) :
    (LinearMap.stdBasis R (fun _ ↦ R) i 1 ᵥ* M) j = M i j

{R : Type u_1}
[Semiring R]
{m : Type u_3}
{n : Type u_4}
[Fintype m]
[DecidableEq m]
(M : Matrix m n R)
(i : m)
(j : n)

((LinearMap.stdBasis R (fun x => R) i) 1 ᵥ* M) j = M i j


theorem coe_symm_trans (e₁ : E ≃ₛₗᵢ[σ₁₂] E₂) (e₂ : E₂ ≃ₛₗᵢ[σ₂₃] E₃) :
    ⇑(e₁.trans e₂).symm = e₁.symm ∘ e₂.symm

{R : Type u_1}
{R₂ : Type u_2}
{R₃ : Type u_3}
{E : Type u_5}
{E₂ : Type u_6}
{E₃ : Type u_7}
[Semiring R]
[Semiring R₂]
[Semiring R₃]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
{σ₁₃ : R →+* R₃}
{σ₃₁ : R₃ →+* R}
{σ₂₃ : R₂ →+* R₃}
{σ₃₂ : R₃ →+* R₂}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[RingHomInvPair σ₁₃ σ₃₁]
[RingHomInvPair σ₃₁ σ₁₃]
[RingHomInvPair σ₂₃ σ₃₂]
[RingHomInvPair σ₃₂ σ₂₃]
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
[RingHomCompTriple σ₃₂ σ₂₁ σ₃₁]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[SeminormedAddCommGroup E₃]
[Module R E]
[Module R₂ E₂]
[Module R₃ E₃]
(e₁ : E ≃ₛₗᵢ[σ₁₂] E₂)
(e₂ : E₂ ≃ₛₗᵢ[σ₂₃] E₃)

⇑(e₁.trans e₂).symm = ⇑e₁.symm ∘ ⇑e₂.symm


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

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


@[simp]
theorem coeToPowerSeries.algHom_apply :
    coeToPowerSeries.algHom A φ = PowerSeries.map (algebraMap R A) ↑φ

{R : Type u_2}
[CommSemiring R]
(φ : Polynomial R)
(A : Type u_3)
[Semiring A]
[Algebra R A]

(Polynomial.coeToPowerSeries.algHom A) φ = (PowerSeries.map (algebraMap R A)) ↑φ


@[simp]
theorem toSubring_subtype {R A : Type*} [CommRing R] [Ring A] [Algebra R A]
    (S : NonUnitalSubalgebra R A) :
    NonUnitalSubringClass.subtype S = NonUnitalSubalgebraClass.subtype (R := R) S

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

NonUnitalSubringClass.subtype S = ↑(NonUnitalSubalgebraClass.subtype S)


lemma hasSum_integral_of_summable_integral_norm {ι} [Countable ι] {F : ι → α → E}
    (hF_int : ∀ i : ι, Integrable (F i) μ) (hF_sum : Summable fun i ↦ ∫ a, ‖F i a‖ ∂μ) :
    HasSum (∫ a, F · a ∂μ) (∫ a, (∑' i, F i a) ∂μ)

(hF_int : ∀ (i : ι), MeasureTheory.Integrable (F i) μ)

(hF_sum : Summable fun i => ∫ (a : α), ‖F i a‖ ∂μ)

HasSum (fun x => ∫ (a : α), F x a ∂μ) (∫ (a : α), ∑' (i : ι), F i a ∂μ)


theorem IsAdjointPair.sub (h : IsAdjointPair B₁ B₁' f₁ g₁) (h' : IsAdjointPair B₁ B₁' f₁' g₁') :
    IsAdjointPair B₁ B₁' (f₁ - f₁') (g₁ - g₁')

{R₁ : Type u_3}
{M₁ : Type u_4}
[CommRing R₁]
[AddCommGroup M₁]
[Module R₁ M₁]
{B₁ : LinearMap.BilinForm R₁ M₁}
{M₁' : Type u_10}
[AddCommGroup M₁']
[Module R₁ M₁']
{B₁' : LinearMap.BilinForm R₁ M₁'}
{f₁ f₁' : M₁ →ₗ[R₁] M₁'}
{g₁ g₁' : M₁' →ₗ[R₁] M₁}
(h : B₁.IsAdjointPair B₁' f₁ g₁)
(h' : B₁.IsAdjointPair B₁' f₁' g₁')

B₁.IsAdjointPair B₁' (f₁ - f₁') (g₁ - g₁')


theorem e_mem_of_eq_true {x : (π C (· ∈ s))} {a : I} (hx : x.val a = true) :
    e (π C (· ∈ s)) a ∈ factors C s x

{x : ↑(Profinite.NobelingProof.π C fun x => x ∈ s)}

Profinite.NobelingProof.e (Profinite.NobelingProof.π C fun x => x ∈ s) a ∈ Profinite.NobelingProof.factors C s x


@[simp] lemma floorRoot_zero_right (n : ℕ) : floorRoot n 0 = 0


/-- The natural homomorphism from a monoid to its quotient by a congruence relation is
    surjective. -/
@[to_additive "The natural homomorphism from an `AddMonoid` to its quotient by a congruence
relation is surjective."]
theorem mk'_surjective : Surjective c.mk'

{M : Type u_1}
[MulOneClass M]
{c : Con M}


theorem unop_op (x : α) : unop (op x) = x


theorem map_empty_eq_zero {β} [AddCancelMonoid β] {T : Set α → β} (hT : FinMeasAdditive μ T) :
    T ∅ = 0

(hT : MeasureTheory.FinMeasAdditive μ T)


theorem UniformSpace.ofDist_aux (ε : ℝ) (hε : 0 < ε) : ∃ δ > (0 : ℝ), ∀ x < δ, ∀ y < δ, x + y < ε


theorem nhdsWithin_basis_open (a : α) (t : Set α) :
    (𝓝[t] a).HasBasis (fun u => a ∈ u ∧ IsOpen u) fun u => u ∩ t

{α : Type u_1}
[TopologicalSpace α]
(a : α)
(t : Set α)


@[to_additive]
theorem map_inv' : f⁻¹.map m = (f.map m)⁻¹

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[AddGroup α]
[SubtractionMonoid β]
[FunLike F α β]
[AddMonoidHomClass F α β]
(m : F)
{f : Filter α}

Filter.map (⇑m) (-f) = -Filter.map (⇑m) f


/-- An embedding of first-order structures is an embedding that commutes with the
  interpretations of functions and relations. -/
structure Embedding extends M ↪ N where
  map_fun' : ∀ {n} (f : L.Functions n) (x), toFun (funMap f x) = funMap f (toFun ∘ x) := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial
  map_rel' : ∀ {n} (r : L.Relations n) (x), RelMap r (toFun ∘ x) ↔ RelMap r x := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
(self : L.Embedding M N)
{n : ℕ}
(r : L.Relations n)
(x : Fin n → M)

FirstOrder.Language.Structure.RelMap r (self.toFun ∘ x) ↔ FirstOrder.Language.Structure.RelMap r x


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

{𝕜 : 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 : N → M'}
(hm : m ≤ n)

ContMDiff I I' m (f ∘ ⇑h) ↔ ContMDiff J I' m f


@[to_additive nsmul_left_comm]
lemma pow_right_comm (a : M) (m n : ℕ) : (a ^ m) ^ n = (a ^ n) ^ m

{M : Type u_2}
[AddMonoid M]
(a : M)
(m n : ℕ)


protected theorem subsingleton (o : Part α) : Set.Subsingleton { a | a ∈ o }


lemma div2_bit (b n) : div2 (bit b n) = n


@[to_additive]
theorem prod_hom_rel (l : List ι) {r : M → N → Prop} {f : ι → M} {g : ι → N} (h₁ : r 1 1)
    (h₂ : ∀ ⦃i a b⦄, r a b → r (f i * a) (g i * b)) : r (l.map f).prod (l.map g).prod

(h₂ : ∀ ⦃i : ι⦄ ⦃a : M⦄ ⦃b : N⦄, r a b → r (f i * a) (g i * b))

r (List.map f l).prod (List.map g l).prod


/-- A field is a perfect field (which means that any irreducible polynomial is separable)
if and only if every separable degree one polynomial splits. -/
theorem perfectField_iff_splits_of_natSepDegree_eq_one (F : Type*) [Field F] :
    PerfectField F ↔ ∀ f : F[X], f.natSepDegree = 1 → f.Splits (RingHom.id F)

PerfectField F ↔ ∀ (f : F[X]), f.natSepDegree = 1 → Polynomial.Splits (RingHom.id F) f


/-- The definitions `LieDerivation.ad` and `LieAlgebra.ad` agree. -/
@[simp] lemma coe_ad_apply_eq_ad_apply (x : L) : ad R L x = LieAlgebra.ad R L x

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(x : L)

↑((LieDerivation.ad R L) x) = (LieAlgebra.ad R L) x


theorem TransGen.lift' {p : β → β → Prop} {a b : α} (f : α → β)
    (h : ∀ a b, r a b → TransGen p (f a) (f b)) (hab : TransGen r a b) :
    TransGen p (f a) (f b)

(h : ∀ (a b : α), r a b → Relation.TransGen p (f a) (f b))


/-- In a finite ring, an element is a unit iff it is a non-zero-divisor. -/
lemma isUnit_iff_mem_nonZeroDivisors_of_finite [Finite R] {a : R} :
    IsUnit a ↔ a ∈ nonZeroDivisors R

{R : Type u_5}
[Ring R]
[Finite R]
{a : R}


/-- The **Four Functions Theorem**, aka **Ahlswede-Daykin Inequality**. -/
lemma four_functions_theorem [DecidableEq α] (h₁ : 0 ≤ f₁) (h₂ : 0 ≤ f₂) (h₃ : 0 ≤ f₃) (h₄ : 0 ≤ f₄)
    (h : ∀ a b, f₁ a * f₂ b ≤ f₃ (a ⊓ b) * f₄ (a ⊔ b)) (s t : Finset α) :
    (∑ a ∈ s, f₁ a) * ∑ a ∈ t, f₂ a ≤ (∑ a ∈ s ⊼ t, f₃ a) * ∑ a ∈ s ⊻ t, f₄ a

(f₁ f₂ f₃ f₄ : α → β)

(h : ∀ (a b : α), f₁ a * f₂ b ≤ f₃ (a ⊓ b) * f₄ (a ⊔ b))


@[simp]
theorem commute_monomial {a : R} {n} :
    Commute φ (monomial R n a) ↔ ∀ m, Commute (coeff R m φ) a

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(φ : MvPowerSeries σ R)
{a : R}
{n : σ →₀ ℕ}

Commute φ ((MvPowerSeries.monomial R n) a) ↔ ∀ (m : σ →₀ ℕ), Commute ((MvPowerSeries.coeff R m) φ) a


/-- Given `w : TwoSquare T L R B` and a morphism `g : R.obj X₂ ⟶ B.obj X₃`, this is
the obvious equivalence of categories
`w.StructuredArrowRightwards g ≌ w.CostructuredArrowDownwards g`. -/
@[simps functor inverse unitIso counitIso]
def equivalenceJ : w.StructuredArrowRightwards g ≌ w.CostructuredArrowDownwards g

{C₁ : Type u₁}
{C₂ : Type u₂}
{C₃ : Type u₃}
{C₄ : Type u₄}
[CategoryTheory.Category.{v₁, u₁} C₁]
[CategoryTheory.Category.{v₂, u₂} C₂]
[CategoryTheory.Category.{v₃, u₃} C₃]
[CategoryTheory.Category.{v₄, u₄} C₄]
{T : CategoryTheory.Functor C₁ C₂}
{L : CategoryTheory.Functor C₁ C₃}
{R : CategoryTheory.Functor C₂ C₄}
{B : CategoryTheory.Functor C₃ C₄}
(w : CategoryTheory.TwoSquare T L R B)
{X₂ : C₂}
{X₃ : C₃}
(g : R.obj X₂ ⟶ B.obj X₃)

(w.equivalenceJ g).functor = CategoryTheory.TwoSquare.EquivalenceJ.functor w g


@[to_additive]
theorem inter_div_subset : s₁ ∩ s₂ / t ⊆ s₁ / t ∩ (s₂ / t)

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


lemma liminf_sup_filter {g} : liminf u (f ⊔ g) = liminf u f ⊓ liminf u g

{α : Type u_1}
{β : Type u_2}
[CompleteDistribLattice α]
{f : Filter β}
{u : β → α}
{g : Filter β}

Filter.liminf u (f ⊔ g) = Filter.liminf u f ⊓ Filter.liminf u g


theorem _root_.MeasureTheory.AEStronglyMeasurable.integral_condDistrib_map
    (hY : AEMeasurable Y μ) (hf : AEStronglyMeasurable f (μ.map fun a => (X a, Y a))) :
    AEStronglyMeasurable (fun x => ∫ y, f (x, y) ∂condDistrib Y X μ x) (μ.map X)

(hf : MeasureTheory.AEStronglyMeasurable f (MeasureTheory.Measure.map (fun a => (X a, Y a)) μ))

MeasureTheory.AEStronglyMeasurable (fun x => ∫ (y : Ω), f (x, y) ∂(ProbabilityTheory.condDistrib Y X μ) x)
  (MeasureTheory.Measure.map X μ)


@[simp] lemma unmop_tensorObj (X Y : Cᴹᵒᵖ) : unmop (X ⊗ Y) = unmop Y ⊗ unmop X

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

(CategoryTheory.MonoidalCategory.tensorObj X Y).unmop = CategoryTheory.MonoidalCategory.tensorObj Y.unmop X.unmop


theorem rank_unit [StrongRankCondition R] [DecidableEq n] (A : (Matrix n n R)ˣ) :
    (A : Matrix n n R).rank = Fintype.card n

{n : Type u_3}
{R : Type u_5}
[Fintype n]
[CommRing R]
[StrongRankCondition R]
[DecidableEq n]
(A : (Matrix n n R)ˣ)


theorem exists_reduced_word' (w : W) : ∃ ω : List B, cs.IsReduced ω ∧ w = π ω

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(w : W)


theorem Commute.zpow_self (A : M) (n : ℤ) : Commute (A ^ n) A

{n' : Type u_1}
[DecidableEq n']
[Fintype n']
{R : Type u_2}
[CommRing R]
(A : Matrix n' n' R)
(n : ℤ)


/-- A presentation is finite if there are only finitely-many
relations and finitely-many relations. -/
class IsFinite (P : Presentation.{t, w} R S) : Prop where
  finite_vars : Finite P.vars
  finite_rels : Finite P.rels

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Presentation R S}
[self : P.IsFinite]


@[to_additive (attr := simp)]
theorem coe_equivMapOfInjective_apply (H : Subgroup G) (f : G →* N) (hf : Function.Injective f)
    (h : H) : (equivMapOfInjective H f hf h : N) = f h

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
(H : AddSubgroup G)
(f : G →+ N)
(hf : Function.Injective ⇑f)
(h : ↥H)

↑((H.equivMapOfInjective f hf) h) = f ↑h


theorem RegularSpace.of_lift'_closure (h : ∀ x : X, (𝓝 x).lift' closure = 𝓝 x) : RegularSpace X

(h : ∀ (x : X), (𝓝 x).lift' closure = 𝓝 x)


@[simp]
theorem card_Ioc : (Ioc a b).card = (b - a).toNat


theorem _root_.biInf_sigma (s : Set ι) (t : ∀ i, Set (α i)) (f : Sigma α → β) :
    ⨅ ij ∈ s.sigma t, f ij = ⨅ (i ∈ s) (j ∈ t i), f ⟨i, j⟩

{ι : Type u_1}
{α : ι → Type u_3}
{β : Type u_5}
[CompleteLattice β]
(s : Set ι)
(t : (i : ι) → Set (α i))
(f : Sigma α → β)

⨅ ij ∈ s.sigma t, f ij = ⨅ i ∈ s, ⨅ j ∈ t i, f ⟨i, j⟩


/-- An antitone function continuous at the indexed supremum over a nonempty `Sort` sends this
indexed supremum to the indexed infimum of the composition. -/
theorem Antitone.map_iSup_of_continuousAt' {ι : Sort*} [Nonempty ι] {f : α → β} {g : ι → α}
    (Cf : ContinuousAt f (iSup g)) (Af : Antitone f)
    (bdd : BddAbove (range g) := by bddDefault) : f (⨆ i, g i) = ⨅ i, f (g i)

(bdd : BddAbove (Set.range g) := by bddDefault)


theorem tsub_tsub_assoc (h₁ : b ≤ a) (h₂ : c ≤ b) : a - (b - c) = a - b + c

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


/-- If `f : X → Y` is continuous and `Y` is equipped with the Borel sigma algebra, then
the push-forward of probability measures `f* : ProbabilityMeasure X → ProbabilityMeasure Y`
is continuous (in the topologies of convergence in distribution). -/
lemma continuous_map {f : Ω → Ω'} (f_cont : Continuous f) :
    Continuous (fun ν ↦ ProbabilityMeasure.map ν f_cont.measurable.aemeasurable)

{Ω : Type u_1}
{Ω' : Type u_2}
[MeasurableSpace Ω]
[MeasurableSpace Ω']
[TopologicalSpace Ω]
[OpensMeasurableSpace Ω]
[TopologicalSpace Ω']
[BorelSpace Ω']
{f : Ω → Ω'}
(f_cont : Continuous f)


theorem IsLUB.isLUB_of_tendsto [Preorder γ] [TopologicalSpace γ] [OrderClosedTopology γ] {f : α → γ}
    {s : Set α} {a : α} {b : γ} (hf : MonotoneOn f s) (ha : IsLUB s a) (hs : s.Nonempty)
    (hb : Tendsto f (𝓝[s] a) (𝓝 b)) : IsLUB (f '' s) b

{α : Type u_1}
{γ : Type u_3}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[Preorder γ]
[TopologicalSpace γ]
[OrderClosedTopology γ]
{f : α → γ}
{s : Set α}
{a : α}
{b : γ}
(hf : MonotoneOn f s)
(ha : IsLUB s a)
(hs : s.Nonempty)
(hb : Filter.Tendsto f (𝓝[s] a) (𝓝 b))


/-- The first marginal of a product probability measure is the first probability measure. -/
@[simp] lemma map_fst_prod : (μ.prod ν).map measurable_fst.aemeasurable = μ

(μ : MeasureTheory.ProbabilityMeasure α)

(ν : MeasureTheory.ProbabilityMeasure β)


theorem lift_castAddHom (x : ℤ) : lift n f (Int.castAddHom (ZMod n) x) = f.1 x

(n : ℕ)
{A : Type u_2}
[AddGroup A]
(f : { f // f ↑n = 0 })
(x : ℤ)

((ZMod.lift n) f) ((Int.castAddHom (ZMod n)) x) = ↑f x


theorem ramificationIdx_spec {n : ℕ} (hle : map f p ≤ P ^ n) (hgt : ¬map f p ≤ P ^ (n + 1)) :
    ramificationIdx f p P = n

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


theorem Continuous'.to_monotone {f : α → β} (hf : Continuous' f) : Monotone f

(hf : OmegaCompletePartialOrder.Continuous' f)


/-- **Rearrangement Inequality**: Pointwise multiplication of `f` and `g` is maximized when `f` and
`g` monovary together. Stated by permuting the entries of `g`. -/
theorem Monovary.sum_mul_comp_perm_le_sum_mul (hfg : Monovary f g) :
    ∑ i, f i * g (σ i) ≤ ∑ i, f i * g i

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

∑ i : ι, f i * g (σ i) ≤ ∑ i : ι, f i * g i


lemma box_succ_disjUnion (n : ℕ) :
    (box (n + 1)).disjUnion (Icc (-n : α) n) (disjoint_box_succ_prod _) =
      Icc (-n.succ : α) n.succ

{α : Type u_1}
[OrderedRing α]
[LocallyFiniteOrder α]
[DecidableEq α]
(n : ℕ)

(Finset.box (n + 1)).disjUnion (Finset.Icc (-↑n) ↑n) ⋯ = Finset.Icc (-↑n.succ) ↑n.succ


@[simp]
theorem mem_innerDualCone (y : H) (s : Set H) : y ∈ s.innerDualCone ↔ ∀ x ∈ s, 0 ≤ ⟪x, y⟫

{H : Type u_5}
[NormedAddCommGroup H]
[InnerProductSpace ℝ H]
(y : H)
(s : Set H)

y ∈ s.innerDualCone ↔ ∀ x ∈ s, 0 ≤ ⟪x, y⟫_ℝ


theorem summable_norm_sum_mul_antidiagonal_of_summable_norm {f g : ℕ → R}
    (hf : Summable fun x => ‖f x‖) (hg : Summable fun x => ‖g x‖) :
    Summable fun n => ‖∑ kl ∈ antidiagonal n, f kl.1 * g kl.2‖

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

Summable fun n => ‖∑ kl ∈ Finset.antidiagonal n, f kl.1 * g kl.2‖


protected lemma «exists» {p : OnePoint X → Prop} :
    (∃ x, p x) ↔ p ∞ ∨ ∃ (x : X), p x

(∃ x, p x) ↔ p OnePoint.infty ∨ ∃ x, p ↑x


theorem smul'_mul {A : Type*} [Semiring A] [Algebra R A] (x : T) (p₁ p₂ : LocalizedModule S A) :
    x • p₁ * p₂ = x • (p₁ * p₂)

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{T : Type u_1}
[CommSemiring T]
[Algebra R T]
[IsLocalization S T]
{A : Type u_2}
[Semiring A]
[Algebra R A]
(x : T)
(p₁ p₂ : LocalizedModule S A)


theorem isStoppingTime_piecewise_const (hij : i ≤ j) (hs : MeasurableSet[𝒢 i] s) :
    IsStoppingTime 𝒢 (s.piecewise (fun _ => i) fun _ => j)

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[Preorder ι]
{𝒢 : MeasureTheory.Filtration ι m}
{i j : ι}
{s : Set Ω}
[DecidablePred fun x => x ∈ s]
(hij : i ≤ j)
(hs : MeasurableSet s)

MeasureTheory.IsStoppingTime 𝒢 (s.piecewise (fun x => i) fun x => j)


/-- A strong epi-mono factorisation is a decomposition `f = e ≫ m` with `e` a strong epimorphism
    and `m` a monomorphism. -/
structure StrongEpiMonoFactorisation {X Y : C} (f : X ⟶ Y) extends MonoFactorisation f where
  [e_strong_epi : StrongEpi e]

(self : CategoryTheory.Limits.StrongEpiMonoFactorisation f)


/-- Typeclass for division rounded up. For each `a > 0`, this asserts the existence of a left
adjoint to the map `b ↦ a • b : β → β`. -/
class CeilDiv where
  /-- Ceiling division. If `a > 0`, then `b ⌈/⌉ a` is the least `c` such that `b ≤ a • c`. -/
  ceilDiv : β → α → β
  /-- Do not use this. Use `gc_smul_ceilDiv` or `gc_mul_ceilDiv` instead. -/
  protected ceilDiv_gc ⦃a⦄ : 0 < a → GaloisConnection (ceilDiv · a) (a • ·)
  /-- Do not use this. Use `ceilDiv_nonpos` instead. -/
  protected ceilDiv_nonpos ⦃a⦄ : a ≤ 0 → ∀ b, ceilDiv b a = 0
  /-- Do not use this. Use `zero_ceilDiv` instead. -/
  protected zero_ceilDiv (a) : ceilDiv 0 a = 0

{α : Type u_2}
{β : Type u_3}
[OrderedAddCommMonoid α]
[OrderedAddCommMonoid β]
[SMulZeroClass α β]
[self : CeilDiv α β]
⦃a : α⦄


/-- Extend the domain of a `Finsupp` by using `0` where `P x` does not hold. -/
@[simps! support toFun]
def extendDomain (f : Subtype P →₀ M) : α →₀ M

{α : Type u_1}
{M : Type u_13}
[Zero M]
{P : α → Prop}
[DecidablePred P]
(f : Subtype P →₀ M)

f.extendDomain.support = Finset.map (Function.Embedding.subtype P) f.support


@[simp]
theorem neg_iff {f : ∀ i, E i} : Memℓp (-f) p ↔ Memℓp f p

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


lemma HasLineDerivAt.hasLineDerivWithinAt (hf : HasLineDerivAt 𝕜 f f' x v) (s : Set E) :
    HasLineDerivWithinAt 𝕜 f f' s x v

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{f : E → F}
{f' : F}
{x v : E}
(hf : HasLineDerivAt 𝕜 f f' x v)
(s : Set E)


theorem isRefl (H : B.IsSymm) : B.IsRefl

{R : Type u_1}
{M : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{I : R →+* R}
{B : M →ₛₗ[I] M →ₗ[R] R}
(H : B.IsSymm)


/-- The first projection of a product is a non-unital ⋆-algebra homomorphism. -/
@[simps!]
def fst : A × B →⋆ₙₐ[R] A

(R : Type u_1)
(A : Type u_2)
(B : Type u_3)
[Monoid R]
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]
[Star B]
(self : A × B)

(NonUnitalStarAlgHom.fst R A B) self = self.1


theorem strictAntiOn_Ici_of_lt_pred [PredOrder α] [IsPredArchimedean α] {n : α}
    (hψ : ∀ m, n < m → ψ m < ψ (pred m)) : StrictAntiOn ψ (Set.Ici n)

(hψ : ∀ (m : α), n < m → ψ m < ψ (Order.pred m))


theorem sin_nat_mul_pi (n : ℕ) : sin (n * π) = 0


theorem dual_node4R (l : Ordnode α) (x : α) (m : Ordnode α) (y : α) (r : Ordnode α) :
    dual (node4R l x m y r) = node4L (dual r) y (dual m) x (dual l)

{α : Type u_1}
(l : Ordnode α)
(x : α)
(m : Ordnode α)
(y : α)
(r : Ordnode α)

(l.node4R x m y r).dual = r.dual.node4L y m.dual x l.dual


@[simp]
theorem «exists» {p : ULift α → Prop} : (∃ x, p x) ↔ ∃ x : α, p (ULift.up x)

{α : Type u}
{p : ULift.{u_1, u} α → Prop}


/-- This is just a special case of the global `mul_smul_comm` lemma that requires less typeclass
search (and was here first). -/
@[simp]
protected theorem mul_smul_comm (s : R) (x y : A) : x * s • y = s • (x * y)

{R : Type u}
{A : Type w}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(s : R)
(x y : A)


/-- Subtracting the first vector passed to `oangle` from the second vector does not change the
sign of the angle. -/
@[simp]
theorem oangle_sign_sub_right (x y : V) : (o.oangle x (y - x)).sign = (o.oangle x y).sign

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


theorem iff_id_eq_zero (X : C) : IsZero X ↔ 𝟙 X = 0

CategoryTheory.Limits.IsZero X ↔ 𝟙 X = 0


/-- A natural isomorphism `R₁ ≅ R₂` induces an equivalence of categories
    `Comma L R₁ ≌ Comma L R₂`. -/
@[simps!]
def mapRightIso (i : R₁ ≅ R₂) : Comma L R₁ ≌ Comma L R₂

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(L : CategoryTheory.Functor A T)
{R₁ R₂ : CategoryTheory.Functor B T}
(i : R₁ ≅ R₂)
(X : CategoryTheory.Comma L R₁)

((CategoryTheory.Comma.mapRightIso L i).functor.obj X).left = X.left


theorem degrees_map_of_injective [CommSemiring S] (p : MvPolynomial σ R) {f : R →+* S}
    (hf : Injective f) : (map f p).degrees = p.degrees

{R : Type u}
{S : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S]
(p : MvPolynomial σ R)
{f : R →+* S}
(hf : Function.Injective ⇑f)

((MvPolynomial.map f) p).degrees = p.degrees


/-- A directed system is a functor from a category (directed poset) to another category. -/
class DirectedSystem (f : ∀ i j, i ≤ j → G i → G j) : Prop where
  map_self' : ∀ i x h, f i i h x = x
  map_map' : ∀ {i j k} (hij hjk x), f j k hjk (f i j hij x) = f i k (le_trans hij hjk) x

{ι : Type v}
[Preorder ι]
{G : ι → Type w}
{f : (i j : ι) → i ≤ j → G i → G j}
[self : DirectedSystem G f]
(i : ι)
(x : G i)
(h : i ≤ i)


/-- A group homomorphism sends inverses to inverses. -/
@[to_additive "An additive group homomorphism sends negations to negations."]
theorem map_inv (hf : IsGroupHom f) (a : α) : f a⁻¹ = (f a)⁻¹

{α : Type u}
{β : Type v}
[AddGroup α]
[AddGroup β]
{f : α → β}
(hf : IsAddGroupHom f)
(a : α)


@[simp]
theorem embDomain_inj {f : α ↪ β} {l₁ l₂ : α →₀ M} : embDomain f l₁ = embDomain f l₂ ↔ l₁ = l₂

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[Zero M]
{f : α ↪ β}
{l₁ l₂ : α →₀ M}

Finsupp.embDomain f l₁ = Finsupp.embDomain f l₂ ↔ l₁ = l₂


/-- If `x = y` then `y ≤ x`. Note: this lemma uses `y ≤ x` instead of `x ≥ y`, because `le` is used
almost exclusively in mathlib. -/
protected theorem ge (h : x = y) : y ≤ x

{α : Type u_2}
[Preorder α]
{x y : α}
(h : x = y)


/-- A version of `isNoetherian_iff_of_finite_iSup_eq_top` using `Scheme.OpenCover`. -/
theorem isNoetherian_iff_of_finite_affine_openCover {𝒰 : Scheme.OpenCover.{v, u} X}
    [Finite 𝒰.J] [∀ i, IsAffine (𝒰.obj i)] :
    IsNoetherian X ↔ ∀ (i : 𝒰.J), IsNoetherianRing Γ(𝒰.obj i, ⊤)

[∀ (i : 𝒰.J), AlgebraicGeometry.IsAffine (𝒰.obj i)]

AlgebraicGeometry.IsNoetherian X ↔ ∀ (i : 𝒰.J), IsNoetherianRing ↑Γ(𝒰.obj i, ⊤)


/-- `#(WType β)` is the least cardinal `κ` such that `sum (fun a : α ↦ κ ^ #(β a)) ≤ κ` -/
theorem cardinal_mk_le_of_le' {κ : Cardinal.{max u v}}
    (hκ : (sum fun a : α => κ ^ lift.{u} #(β a)) ≤ κ) :
    #(WType β) ≤ κ

(hκ : (Cardinal.sum fun a => κ ^ Cardinal.lift.{u, v} (Cardinal.mk (β a))) ≤ κ)


/-- The type of co-Heyting homomorphisms from `α` to `β`. Bounded lattice homomorphisms that
preserve difference. -/
structure CoheytingHom (α β : Type*) [CoheytingAlgebra α] [CoheytingAlgebra β] extends
  LatticeHom α β where
  /-- The proposition that a co-Heyting homomorphism preserves the top element. -/
  protected map_top' : toFun ⊤ = ⊤
  /-- The proposition that a co-Heyting homomorphism preserves the difference operation. -/
  protected map_sdiff' : ∀ a b, toFun (a \ b) = toFun a \ toFun b

{α : Type u_6}
{β : Type u_7}
[CoheytingAlgebra α]
[CoheytingAlgebra β]
(self : CoheytingHom α β)


/-- We say that `l : Filter ℂ` is an *exponential comparison filter* if the real part tends to
infinity along `l` and the imaginary part grows subexponentially compared to the real part. These
properties guarantee that `(fun z ↦ z ^ a₁ * exp (b₁ * z)) =o[l] (fun z ↦ z ^ a₂ * exp (b₂ * z))`
for any complex `a₁`, `a₂` and real `b₁ < b₂`.

In particular, the second property is automatically satisfied if the imaginary part is bounded along
`l`. -/
structure IsExpCmpFilter (l : Filter ℂ) : Prop where
  tendsto_re : Tendsto re l atTop
  isBigO_im_pow_re : ∀ n : ℕ, (fun z : ℂ => z.im ^ n) =O[l] fun z => Real.exp z.re

{l : Filter ℂ}
(self : Complex.IsExpCmpFilter l)
(n : ℕ)

(fun z => z.im ^ n) =O[l] fun z => Real.exp z.re


theorem bijective_algebraMap_iff {R A : Type*} [Field R] [Semiring A] [Nontrivial A]
    [Algebra R A] : Function.Bijective (algebraMap R A) ↔ (⊤ : Subalgebra R A) = ⊥

{R : Type u_1}
{A : Type u_2}
[Field R]
[Semiring A]
[Nontrivial A]
[Algebra R A]

Function.Bijective ⇑(algebraMap R A) ↔ ⊤ = ⊥


protected theorem of_dvd (d : m ∣ n) (h : a ≡ b [ZMOD n]) : a ≡ b [ZMOD m]

{m n a b : ℤ}
(d : m ∣ n)
(h : a ≡ b [ZMOD n])


theorem sumElim_comp_inl (ψ : L'' →ᴸ L') : ϕ.sumElim ψ ∘ᴸ LHom.sumInl = ϕ

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
(ϕ : L →ᴸ L')
{L'' : FirstOrder.Language}
(ψ : L'' →ᴸ L')

(ϕ.sumElim ψ).comp FirstOrder.Language.LHom.sumInl = ϕ


@[simp]
theorem dual_finrank_eq : finrank K (Module.Dual K V) = finrank K V

{K : Type u}
{V : Type v}
[Field K]
[AddCommGroup V]
[Module K V]

FiniteDimensional.finrank K (Module.Dual K V) = FiniteDimensional.finrank K V


@[simp]
theorem opow_zero (a : Ordinal) : a ^ (0 : Ordinal) = 1


lemma frequently_lt_nhds (a : α) [NeBot (𝓝[<] a)] : ∃ᶠ x in 𝓝 a, x < a

{α : Type u_1}
[TopologicalSpace α]
[Preorder α]
(a : α)
[(𝓝[<] a).NeBot]


/-- A family of ring isomorphisms `∀ j, (R j ≃+* S j)` generates a
ring isomorphisms between `∀ j, R j` and `∀ j, S j`.

This is the `RingEquiv` version of `Equiv.piCongrRight`, and the dependent version of
`RingEquiv.arrowCongr`.
-/
@[simps apply]
def piCongrRight {ι : Type*} {R S : ι → Type*} [∀ i, NonUnitalNonAssocSemiring (R i)]
    [∀ i, NonUnitalNonAssocSemiring (S i)] (e : ∀ i, R i ≃+* S i) : (∀ i, R i) ≃+* ∀ i, S i

[(i : ι) → NonUnitalNonAssocSemiring (R i)]

[(i : ι) → NonUnitalNonAssocSemiring (S i)]

(RingEquiv.piCongrRight e) x j = (e j) (x j)


@[gcongr]
theorem sup_le_sup (h₁ : a ≤ b) (h₂ : c ≤ d) : a ⊔ c ≤ b ⊔ d

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


lemma smul_inv_lt_iff_of_neg (h : a < 0) : b₁ < a⁻¹ • b₂ ↔ b₂ < a • b₁

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[OrderedAddCommGroup β]
[Module α β]
{a : α}
{b₁ b₂ : β}
[PosSMulStrictMono α β]
(h : a < 0)

b₁ < a⁻¹ • b₂ ↔ b₂ < a • b₁


theorem one_lt_val_iff (v : Valuation K Γ₀) {x : K} (h : x ≠ 0) : 1 < v x ↔ v x⁻¹ < 1

{K : Type u_1}
[DivisionRing K]
{Γ₀ : Type u_4}
[LinearOrderedCommGroupWithZero Γ₀]
(v : Valuation K Γ₀)
{x : K}
(h : x ≠ 0)


@[simp 1200]
theorem goldConj_sq : ψ ^ 2 = ψ + 1


theorem Pred.rec_top (p : α → Prop) (htop : p ⊤) (hpred : ∀ a, p a → p (pred a)) (a : α) : p a

(hpred : ∀ (a : α), p a → p (Order.pred a))


@[simp]
theorem coe_toSubmonoid (s : Subsemiring R) : (s.toSubmonoid : Set R) = s

{R : Type u}
[NonAssocSemiring R]
(s : Subsemiring R)


theorem mem_span_gramSchmidt (f : ι → E) {i j : ι} (hij : i ≤ j) :
    f i ∈ span 𝕜 (gramSchmidt 𝕜 f '' Set.Iic j)

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_3}
[LinearOrder ι]
[LocallyFiniteOrderBot ι]
[IsWellOrder ι fun x x_1 => x < x_1]
(f : ι → E)
{i j : ι}
(hij : i ≤ j)

f i ∈ Submodule.span 𝕜 (gramSchmidt 𝕜 f '' Set.Iic j)


theorem IsPrime.mem_compl_of_not_mem (hI : IsPrime I) (hxnI : x ∉ I) : xᶜ ∈ I

{P : Type u_1}
[BooleanAlgebra P]
{x : P}
{I : Order.Ideal P}
(hI : I.IsPrime)
(hxnI : x ∉ I)


theorem norm_eq_pow_val {x : ℤ_[p]} (hx : x ≠ 0) : ‖x‖ = (p : ℝ) ^ (-x.valuation)

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{x : ℤ_[p]}
(hx : x ≠ 0)


@[simp] theorem get!_eq_getD [Inhabited α] : ∀ (l : List α) n, l.get! n = l.getD n default

{α : Type u_1}
[Inhabited α]
(l : List α)
(n : Nat)


@[simp]
theorem pred_eq_pred : Order.pred = pred


@[simp]
theorem coe_copy (f : A →ₗc[R] B) (f' : A → B) (h : f' = ⇑f) : ⇑(f.copy f' h) = f'

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[AddCommMonoid B]
[Module R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
(f : A →ₗc[R] B)
(f' : A → B)
(h : f' = ⇑f)


lemma PosSMulReflectLT.lift [PosSMulReflectLT α γ]
    (hf : ∀ {b₁ b₂}, f b₁ ≤ f b₂ ↔ b₁ ≤ b₂)
    (smul : ∀ (a : α) b, f (a • b) = a • f b) : PosSMulReflectLT α β

(hf : ∀ {b₁ b₂ : β}, f b₁ ≤ f b₂ ↔ b₁ ≤ b₂)

(smul : ∀ (a : α) (b : β), f (a • b) = a • f b)


@[simp]
theorem quot_mk_eq_mk {p : Submodule R M} (x : M) : (Quot.mk _ x : M ⧸ p) = (mk : M → M ⧸ p) x

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

Quot.mk Setoid.r x = Submodule.Quotient.mk x


@[simp, norm_cast]
theorem extension_extends (x : K) : extension (x : hat K) = v x

{K : Type u_1}
[Field K]
{Γ₀ : Type u_2}
[LinearOrderedCommGroupWithZero Γ₀]
[hv : Valued K Γ₀]
(x : K)


@[reassoc]
lemma r_f (s : S.Splitting) : s.r ≫ S.f = 𝟙 _ - S.g ≫ s.s

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{S : CategoryTheory.ShortComplex C}
(s : S.Splitting)

CategoryTheory.CategoryStruct.comp s.r S.f =
  CategoryTheory.CategoryStruct.id S.X₂ - CategoryTheory.CategoryStruct.comp S.g s.s


protected lemma GrowsPolynomially.inv {f : ℝ → ℝ} (hf : GrowsPolynomially f) :
    GrowsPolynomially fun x => (f x)⁻¹

(hf : AkraBazziRecurrence.GrowsPolynomially f)

AkraBazziRecurrence.GrowsPolynomially fun x => (f x)⁻¹


theorem IsLittleO.mul {f₁ f₂ : α → R} {g₁ g₂ : α → 𝕜} (h₁ : f₁ =o[l] g₁) (h₂ : f₂ =o[l] g₂) :
    (fun x => f₁ x * f₂ x) =o[l] fun x => g₁ x * g₂ x

{α : Type u_1}
{R : Type u_13}
{𝕜 : Type u_15}
[SeminormedRing R]
[NormedDivisionRing 𝕜]
{l : Filter α}
{f₁ f₂ : α → R}
{g₁ g₂ : α → 𝕜}
(h₁ : f₁ =o[l] g₁)
(h₂ : f₂ =o[l] g₂)


/-- Sakai's definition of a von Neumann algebra as a C^* algebra with a Banach space predual.

So that we can unambiguously talk about these "abstract" von Neumann algebras
in parallel with the "concrete" ones (weakly closed *-subalgebras of B(H)),
we name this definition `WStarAlgebra`.

Note that for now we only assert the mere existence of predual, rather than picking one.
This may later prove problematic, and need to be revisited.
Picking one may cause problems with definitional unification of different instances.
One the other hand, not picking one means that the weak-* topology
(which depends on a choice of predual) must be defined using the choice,
and we may be unhappy with the resulting opaqueness of the definition.
-/
class WStarAlgebra (M : Type u) [NormedRing M] [StarRing M] [CstarRing M] [Module ℂ M]
    [NormedAlgebra ℂ M] [StarModule ℂ M] : Prop where
  /-- There is a Banach space `X` whose dual is isometrically (conjugate-linearly) isomorphic
  to the `WStarAlgebra`. -/
  exists_predual :
    ∃ (X : Type u) (_ : NormedAddCommGroup X) (_ : NormedSpace ℂ X) (_ : CompleteSpace X),
      Nonempty (NormedSpace.Dual ℂ X ≃ₗᵢ⋆[ℂ] M)

{M : Type u}
[NormedRing M]
[StarRing M]
[CstarRing M]
[Module ℂ M]
[NormedAlgebra ℂ M]
[StarModule ℂ M]
[self : WStarAlgebra M]

∃ X x x_1, ∃ (_ : CompleteSpace X), Nonempty (NormedSpace.Dual ℂ X ≃ₗᵢ⋆[ℂ] M)


lemma le_iff_sdiff_subset_lowerClosure {s t : Colex α} :
    s ≤ t ↔ (ofColex s : Set α) \ ofColex t ⊆ lowerClosure (ofColex t \ ofColex s : Set α)

{α : Type u_1}
[PartialOrder α]
{s t : Finset.Colex α}

s ≤ t ↔ ↑s.ofColex \ ↑t.ofColex ⊆ ↑(lowerClosure (↑t.ofColex \ ↑s.ofColex))


@[to_additive]
theorem le_iff_forall_one_lt_le_mul : a ≤ b ↔ ∀ ε, 1 < ε → a ≤ b * ε

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


@[simp]
theorem asHom_apply {G : AddCommGrp.{0}} (g : G) (i : ℤ) :
    @DFunLike.coe (ℤ →+ ↑G) ℤ (fun _ ↦ ↑G) _ (asHom g) i = i • g


@[simp]
theorem norm_diagonal [DecidableEq n] (v : n → α) : ‖diagonal v‖ = ‖v‖

{n : Type u_4}
{α : Type u_5}
[Fintype n]
[SeminormedAddCommGroup α]
[DecidableEq n]
(v : n → α)


/-- Naturally isomorphic endofunctors give equivalent categories of coalgebras.
Furthermore, they are equivalent as categories over `C`, that is,
we have `equiv_of_nat_iso h ⋙ forget = forget`.
-/
@[simps]
def equivOfNatIso {F G : C ⥤ C} (α : F ≅ G) : Coalgebra F ≌ Coalgebra G

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F G : CategoryTheory.Functor C C}
(α : F ≅ G)

(CategoryTheory.Endofunctor.Coalgebra.equivOfNatIso α).functor =
  CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans α.hom


/-- If a function `f : ℝ → ℝ` is differentiable at a (real) point `x`, then it is also
differentiable as a function `ℝ → ℂ`. -/
theorem HasDerivAt.ofReal_comp {f : ℝ → ℝ} {u : ℝ} (hf : HasDerivAt f u z) :
    HasDerivAt (fun y : ℝ => ↑(f y) : ℝ → ℂ) u z

{z : ℝ}
{f : ℝ → ℝ}
{u : ℝ}
(hf : HasDerivAt f u z)


protected theorem _root_.Embedding.isSeparable_preimage {f : β → α} [TopologicalSpace β]
    (hf : Embedding f) {s : Set α} (hs : IsSeparable s) : IsSeparable (f ⁻¹' s)

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
{f : β → α}
[TopologicalSpace β]
(hf : Embedding f)
{s : Set α}
(hs : TopologicalSpace.IsSeparable s)


theorem inter_maximals_preimage_inter_eq_of_rel_iff_rel_on {x : Set α}
    (hf : ∀ ⦃a a'⦄, a ∈ x → a' ∈ x → (r a a' ↔ s (f a) (f a'))) (y : Set β) :
    x ∩ f ⁻¹' (maximals s ((f '' x) ∩ y)) = maximals r (x ∩ f ⁻¹' y)

(hf : ∀ ⦃a a' : α⦄, a ∈ x → a' ∈ x → (r a a' ↔ s (f a) (f a')))

x ∩ f ⁻¹' maximals s (f '' x ∩ y) = maximals r (x ∩ f ⁻¹' y)


theorem Continuous.comp_lowerSemicontinuousOn {g : γ → δ} {f : α → γ} (hg : Continuous g)
    (hf : LowerSemicontinuousOn f s) (gmon : Monotone g) : LowerSemicontinuousOn (g ∘ f) s

{α : Type u_1}
[TopologicalSpace α]
{s : Set α}
{γ : Type u_3}
[LinearOrder γ]
[TopologicalSpace γ]
[OrderTopology γ]
{δ : Type u_4}
[LinearOrder δ]
[TopologicalSpace δ]
[OrderTopology δ]
{g : γ → δ}
{f : α → γ}
(hg : Continuous g)
(hf : LowerSemicontinuousOn f s)
(gmon : Monotone g)


@[simp]
theorem ι_comp_lift {A : Type*} [Semiring A] [Algebra R A] (f : M →ₗ[R] A) :
    (lift R f).toLinearMap.comp (ι R) = f

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{A : Type u_3}
[Semiring A]
[Algebra R A]
(f : M →ₗ[R] A)

((TensorAlgebra.lift R) f).toLinearMap ∘ₗ TensorAlgebra.ι R = f


/-- A family of generators of a `R`-algebra `S` consists of
1. `vars`: The type of variables.
2. `val : vars → S`: The assignment of each variable to a value in `S`.
3. `σ`: A section of `R[X] → S`. -/
structure Algebra.Generators where
  /-- The type of variables.  -/
  vars : Type w
  /-- The assignment of each variable to a value in `S`. -/
  val : vars → S
  /-- A section of `R[X] → S`. -/
  σ' : S → MvPolynomial vars R
  aeval_val_σ' : ∀ s, aeval val (σ' s) = s

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
(self : Algebra.Generators R S)
(s : S)

(MvPolynomial.aeval self.val) (self.σ' s) = s


/-- To show that two subobjects are equal, it suffices to exhibit an isomorphism commuting with
    the arrows. -/
@[ext]
theorem eq_of_comm {B : C} {X Y : Subobject B} (f : (X : C) ≅ (Y : C))
    (w : f.hom ≫ Y.arrow = X.arrow) : X = Y

(f : CategoryTheory.Subobject.underlying.obj X ≅ CategoryTheory.Subobject.underlying.obj Y)

(w : CategoryTheory.CategoryStruct.comp f.hom Y.arrow = X.arrow)


theorem op_le_iff {S₁ : Subsemiring R} {S₂ : Subsemiring Rᵐᵒᵖ} : S₁.op ≤ S₂ ↔ S₁ ≤ S₂.unop

{R : Type u_2}
[NonAssocSemiring R]
{S₁ : Subsemiring R}
{S₂ : Subsemiring Rᵐᵒᵖ}


@[simp]
theorem piecewise_univ [∀ i : α, Decidable (i ∈ (Set.univ : Set α))] :
    piecewise Set.univ f g = f

{α : Type u_1}
{δ : α → Sort u_6}
(f g : (i : α) → δ i)
[(i : α) → Decidable (i ∈ Set.univ)]


/-- A Galois insertion is a Galois connection where `l ∘ u = id`. It also contains a constructive
choice function, to give better definitional equalities when lifting order structures. Dual
to `GaloisCoinsertion` -/
structure GaloisInsertion {α β : Type*} [Preorder α] [Preorder β] (l : α → β) (u : β → α) where
  /-- A contructive choice function for images of `l`. -/
  choice : ∀ x : α, u (l x) ≤ x → β
  /-- The Galois connection associated to a Galois insertion. -/
  gc : GaloisConnection l u
  /-- Main property of a Galois insertion. -/
  le_l_u : ∀ x, x ≤ l (u x)
  /-- Property of the choice function. -/
  choice_eq : ∀ a h, choice a h = l a

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(self : GaloisInsertion l u)
(x : β)


theorem HasStrictFDerivAt.congr_fderiv (h : HasStrictFDerivAt f f' x) (h' : f' = g') :
    HasStrictFDerivAt f g' x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' g' : E →L[𝕜] F}
{x : E}
(h : HasStrictFDerivAt f f' x)
(h' : f' = g')


/-- Taking kernels is an order-reversing map from the quotient objects of `X` to the subobjects of
    `X`. -/
@[simps]
def kernelOrderHom [HasKernels C] (X : C) : (Subobject (op X))ᵒᵈ →o Subobject X

∀ (a : CategoryTheory.Subobject (Opposite.op X)),
  (CategoryTheory.Limits.kernelOrderHom X) a =
    CategoryTheory.Subobject.lift (fun A f x => CategoryTheory.Subobject.mk (CategoryTheory.Limits.kernel.ι f.unop)) ⋯ a


@[to_additive (attr := simp)]
theorem toLex_mul [Mul α] (a b : α) : toLex (a * b) = toLex a * toLex b


/-- The natural map `UniformFun.toFun` from `α →ᵤ β` to `α → β` is uniformly continuous.

In other words, the uniform structure of uniform convergence is finer than that of pointwise
convergence, aka the product uniform structure. -/
protected theorem uniformContinuous_toFun : UniformContinuous (toFun : (α →ᵤ β) → α → β)

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


/-- A (possibly nonlinear) right inverse to a continuous linear map, which doesn't have to be
linear itself but which satisfies a bound `‖inverse x‖ ≤ C * ‖x‖`. A surjective continuous linear
map doesn't always have a continuous linear right inverse, but it always has a nonlinear inverse
in this sense, by Banach's open mapping theorem. -/
structure NonlinearRightInverse where
  toFun : F → E
  nnnorm : ℝ≥0
  bound' : ∀ y, ‖toFun y‖ ≤ nnnorm * ‖y‖
  right_inv' : ∀ y, f (toFun y) = y

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
{σ : 𝕜 →+* 𝕜'}
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜' F]
{f : E →SL[σ] F}
(self : f.NonlinearRightInverse)
(y : F)


theorem Filter.map_mapsTo_Iic_iff_mapsTo {s : Set α} {t : Set β} {m : α → β} :
    MapsTo (map m) (Iic <| 𝓟 s) (Iic <| 𝓟 t) ↔ MapsTo m s t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{m : α → β}

Set.MapsTo (Filter.map m) (Set.Iic (𝓟 s)) (Set.Iic (𝓟 t)) ↔ Set.MapsTo m s t


lemma exists_finset_linearIndependent_of_le_finrank {n : ℕ} (hn : n ≤ finrank R M) :
    ∃ s : Finset M, s.card = n ∧ LinearIndependent R ((↑) : s → M)

(hn : n ≤ FiniteDimensional.finrank R M)

∃ s, s.card = n ∧ LinearIndependent R Subtype.val


theorem one_mem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) :
    (isLocallyFraction 𝒜).pred (1 : ∀ x : U.unop, at x.1)

(U : (TopologicalSpace.Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ)


/-- The `Finset` version of `Equiv.subset_symm_image`. -/
theorem subset_map_symm {t : Finset β} {f : α ≃ β} : s ⊆ t.map f.symm ↔ s.map f ⊆ t

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}
{f : α ≃ β}

s ⊆ Finset.map f.symm.toEmbedding t ↔ Finset.map f.toEmbedding s ⊆ t


/-- If `f` is nonnegative a.e.-everywhere and it is integrable on the unordered interval
`Set.uIoc a b`, then its integral over `a..b` is positive if and only if `a < b` and the
measure of `Function.support f ∩ Set.Ioc a b` is positive. -/
theorem integral_pos_iff_support_of_nonneg_ae (hf : 0 ≤ᵐ[μ] f) (hfi : IntervalIntegrable f μ a b) :
    (0 < ∫ x in a..b, f x ∂μ) ↔ a < b ∧ 0 < μ (support f ∩ Ioc a b)

{f : ℝ → ℝ}
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
(hf : 0 ≤ᵐ[μ] f)
(hfi : IntervalIntegrable f μ a b)

0 < ∫ (x : ℝ) in a..b, f x ∂μ ↔ a < b ∧ 0 < μ (Function.support f ∩ Set.Ioc a b)


theorem span_smul (a : α) (s : Set M) : span R (a • s) = a • span R s

{α : Type u_1}
{R : Type u_2}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Monoid α]
[DistribMulAction α M]
[SMulCommClass α R M]
(a : α)
(s : Set M)

Submodule.span R (a • s) = a • Submodule.span R s


@[simp]
theorem prod_base_smul (h : H) (w : NormalWord d) :
    (h • w).prod = base φ h * w.prod

{d : Monoid.PushoutI.NormalWord.Transversal φ}

(h • w).prod = (Monoid.PushoutI.base φ) h * w.prod


/-- If `f : M → N` is a submultiplicative function, `f (x * y) ≤ f x * f y` and `g i`, `i ∈ s`, is a
nonempty finite family of elements of `M`, then `f (∏ i ∈ s, g i) ≤ ∏ i ∈ s, f (g i)`. -/
@[to_additive le_sum_nonempty_of_subadditive]
theorem le_prod_nonempty_of_submultiplicative (f : M → N) (h_mul : ∀ x y, f (x * y) ≤ f x * f y)
    {s : Finset ι} (hs : s.Nonempty) (g : ι → M) : f (∏ i ∈ s, g i) ≤ ∏ i ∈ s, f (g i)

(h_mul : ∀ (x y : M), f (x * y) ≤ f x * f y)


/-- See also `Matrix.coeff_charpolyRev_eq_neg_trace`. -/
theorem trace_eq_neg_charpoly_coeff [Nonempty n] (M : Matrix n n R) :
    trace M = -M.charpoly.coeff (Fintype.card n - 1)

{R : Type u}
[CommRing R]
{n : Type v}
[DecidableEq n]
[Fintype n]
[Nonempty n]
(M : Matrix n n R)

M.trace = -M.charpoly.coeff (Fintype.card n - 1)


@[ext]
theorem ext ⦃f g : M ≃[L] N⦄ (h : ∀ x, f x = g x) : f = g

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
⦃f g : L.Equiv M N⦄
(h : ∀ (x : M), f x = g x)


@[simp]
theorem zero_mass : (0 : FiniteMeasure Ω).mass = 0


@[simp]
theorem hasseDualIso_apply (a : αᵒᵈ) : hasseDualIso a = ofDual a

SimpleGraph.hasseDualIso a = OrderDual.ofDual a


nonrec theorem IsIntegral.sub {x y : A} (hx : IsIntegral R x) (hy : IsIntegral R y) :
    IsIntegral R (x - y)

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]
{x y : A}
(hx : IsIntegral R x)
(hy : IsIntegral R y)


@[simp, mfld_simps]
theorem mem_trivializationAt_proj_source {x : TotalSpace F E} :
    x ∈ (trivializationAt F E x.proj).source

[TopologicalSpace (Bundle.TotalSpace F E)]


@[simp]
lemma nonsingularLift_iff (P : Fin 3 → R) : W.NonsingularLift ⟦P⟧ ↔ W.Nonsingular P

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Projective R)
(P : Fin 3 → R)


@[to_additive (attr := simp)]
theorem units_val_iff {a x y : Mˣ} : SemiconjBy (a : M) x y ↔ SemiconjBy a x y


@[simp]
theorem blockDiagonal_zero : blockDiagonal (0 : o → Matrix m n α) = 0

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
[DecidableEq o]
[Zero α]


@[to_additive]
lemma mul [Mul β] {g : α → β} (hf : EventuallyConst f l) (hg : EventuallyConst g l) :
    EventuallyConst (f * g) l

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
{f : α → β}
[Add β]
{g : α → β}
(hf : Filter.EventuallyConst f l)
(hg : Filter.EventuallyConst g l)


@[to_additive (attr := simp)]
theorem tprod_pi_single [DecidableEq β] (b : β) (a : α) : ∏' b', Pi.mulSingle b a b' = a

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
[DecidableEq β]
(b : β)
(a : α)


theorem length_simple_mul (w : W) (i : B) :
    ℓ (s i * w) = ℓ w + 1 ∨ ℓ (s i * w) + 1 = ℓ w

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(w : W)
(i : B)

cs.length (cs.simple i * w) = cs.length w + 1 ∨ cs.length (cs.simple i * w) + 1 = cs.length w


@[simp]
theorem head_cyclicPermutations (l : List α) :
    (cyclicPermutations l).head (cyclicPermutations_ne_nil l) = l


@[simp]
theorem add_bind (f : α → FreeAbelianGroup β) (x y : FreeAbelianGroup α) :
    x + y >>= f = (x >>= f) + (y >>= f)

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


@[to_additive]
theorem prod.unique (g : FreeGroup α →* α) (hg : ∀ x, g (FreeGroup.of x) = x) {x} : g x = prod x

(hg : ∀ (x : α), g (FreeAddGroup.of x) = x)


@[to_additive (attr := simp)]
theorem edist_inv_inv [PseudoEMetricSpace G] [IsometricSMul G G] [IsometricSMul Gᵐᵒᵖ G]
    (a b : G) : edist a⁻¹ b⁻¹ = edist a b

{G : Type v}
[Group G]
[PseudoEMetricSpace G]
[IsometricSMul G G]
[IsometricSMul Gᵐᵒᵖ G]
(a b : G)


/-- Tower law: if `A` is a `K`-module and `K` is an extension of `F` then
$\operatorname{rank}_F(A) = \operatorname{rank}_F(K) * \operatorname{rank}_K(A)$.

The universe polymorphic version of `rank_mul_rank` below. -/
theorem lift_rank_mul_lift_rank :
    Cardinal.lift.{w} (Module.rank F K) * Cardinal.lift.{v} (Module.rank K A) =
      Cardinal.lift.{v} (Module.rank F A)

(F : Type u)
(K : Type v)
(A : Type w)
[Ring F]
[Ring K]
[AddCommGroup A]
[Module F K]
[Module K A]
[Module F A]
[IsScalarTower F K A]
[StrongRankCondition F]
[StrongRankCondition K]
[Module.Free F K]
[Module.Free K A]

Cardinal.lift.{w, v} (Module.rank F K) * Cardinal.lift.{v, w} (Module.rank K A) = Cardinal.lift.{v, w} (Module.rank F A)


theorem degree_pos_of_root {p : R[X]} (hp : p ≠ 0) (h : IsRoot p a) : 0 < degree p

{R : Type u}
{a : R}
[Semiring R]
{p : R[X]}
(hp : p ≠ 0)
(h : p.IsRoot a)


/-- `Matrix.trace` as a `LinearMap` -/
@[simps]
def traceLinearMap [Semiring α] [Module α R] : Matrix n n R →ₗ[α] R

(n : Type u_3)
(α : Type u_5)
(R : Type u_6)
[Fintype n]
[AddCommMonoid R]
[Semiring α]
[Module α R]
(A : Matrix n n R)

(Matrix.traceLinearMap n α R) A = A.trace