/-- Every topological vector space over ℝ is path connected.

Not an instance, because it creates enormous TC subproblems (turn on `pp.all`).
-/
protected theorem TopologicalAddGroup.pathConnectedSpace : PathConnectedSpace E

{E : Type u_3}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul ℝ E]


theorem inj_iff {x y} : e x = e y ↔ x = y

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{e : α → β}
(de : DenseEmbedding e)
{x y : α}


@[simp]
theorem toNonUnitalSubsemiring_eq_top {S : NonUnitalSubalgebra R A} :
    S.toNonUnitalSubsemiring = ⊤ ↔ S = ⊤

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
{S : NonUnitalSubalgebra R A}


/-- Assumes left covariance. -/
theorem Left.mul_lt_of_lt_of_le_one_of_nonneg [PosMulMono α] (ha : a < 1) (hb : b ≤ 1)
    (a0 : 0 ≤ a) : a * b < 1

{α : Type u_1}
{a b : α}
[MulOneClass α]
[Zero α]
[Preorder α]
[PosMulMono α]
(ha : a < 1)
(hb : b ≤ 1)
(a0 : 0 ≤ a)


theorem finrank_le_of_rank_le {n : ℕ} (h : Module.rank R M ≤ ↑n) : finrank R M ≤ n

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
{n : ℕ}
(h : Module.rank R M ≤ ↑n)


protected theorem map_neg (f : S →A[R] B) (x : S) : f (-x) = -f x

(R : Type u_1)
[CommSemiring R]
{S : Type u_3}
[Ring S]
[TopologicalSpace S]
[Algebra R S]
{B : Type u_4}
[Ring B]
[TopologicalSpace B]
[Algebra R B]
(f : S →A[R] B)
(x : S)


theorem coe_toAddMonoidHom (f : α →ₙ+* β) : ⇑f.toAddMonoidHom = f

{α : Type u_2}
{β : Type u_3}
[NonUnitalNonAssocSemiring α]
[NonUnitalNonAssocSemiring β]
(f : α →ₙ+* β)


@[simp]
theorem map_coe_Ioo_atBot {a b : α} (h : a < b) : map ((↑) : Ioo a b → α) atBot = 𝓝[>] a

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

Filter.map Subtype.val Filter.atBot = 𝓝[>] a


@[simp]
theorem _root_.Polynomial.toLaurent_C (r : R) : toLaurent (Polynomial.C r) = C r

Polynomial.toLaurent (Polynomial.C r) = LaurentPolynomial.C r


/-- The kernel of `biproduct.toSubtype f p` is `⨁ Subtype.restrict pᶜ f`. -/
@[simps!]
def kernelBiproductToSubtypeIso (p : Set K) :
    kernel (biproduct.toSubtype f p) ≅ ⨁ Subtype.restrict pᶜ f

(CategoryTheory.Limits.kernelBiproductToSubtypeIso f p).inv =
  CategoryTheory.Limits.limit.lift
    (CategoryTheory.Limits.parallelPair (CategoryTheory.Limits.biproduct.toSubtype f p) 0)
    (CategoryTheory.Limits.KernelFork.ofι (CategoryTheory.Limits.biproduct.fromSubtype f pᶜ) ⋯)


@[simp]
theorem mk_eq_of (a : G) : Quot.mk _ a = of a

Quot.mk Setoid.r a = Abelianization.of a


theorem ball_finset_sup' (p : ι → Seminorm 𝕜 E) (s : Finset ι) (H : s.Nonempty) (e : E) (r : ℝ) :
    ball (s.sup' H p) e r = s.inf' H fun i => ball (p i) e r

{𝕜 : Type u_3}
{E : Type u_7}
{ι : Type u_12}
[SeminormedRing 𝕜]
[AddCommGroup E]
[SMul 𝕜 E]
(p : ι → Seminorm 𝕜 E)
(s : Finset ι)
(H : s.Nonempty)
(e : E)
(r : ℝ)

(s.sup' H p).ball e r = s.inf' H fun i => (p i).ball e r


@[simp]
theorem ofDual_top [Bot α] : ofDual ⊤ = (⊥ : α)


theorem Sorted.tail {r : α → α → Prop} {l : List α} (h : Sorted r l) : Sorted r l.tail

{α : Type u}
{r : α → α → Prop}
{l : List α}
(h : List.Sorted r l)


@[simp]
theorem inclusion_self (S : L.Substructure M) : inclusion (le_refl S) = Embedding.refl L S

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
(S : L.Substructure M)

FirstOrder.Language.Substructure.inclusion ⋯ = FirstOrder.Language.Embedding.refl L ↥S


@[simp]
theorem id_compRel {r : Set (α × α)} : idRel ○ r = r


theorem IsUniversalColimit.of_iso {F : J ⥤ C} {c c' : Cocone F} (hc : IsUniversalColimit c)
    (e : c ≅ c') : IsUniversalColimit c'

(hc : CategoryTheory.IsUniversalColimit c)


theorem repeatEq_iff_eq {α : TypeVec n} {i x y} :
    ofRepeat (repeatEq α i (prod.mk _ x y)) ↔ x = y

{n : ℕ}
{α : TypeVec.{u_1} n}
{i : Fin2 n}
{x y : α i}

TypeVec.ofRepeat (α.repeatEq i (TypeVec.prod.mk i x y)) ↔ x = y


@[to_additive]
theorem inv [Inv Y] ⦃f : X → Y⦄ (hf : IsLocallyConstant f) : IsLocallyConstant f⁻¹

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


theorem length_lt_card_boundaries : c.length < c.boundaries.card


theorem pentagon :
    whiskerRight (associator F G H).hom K ≫
        (associator F (G ⋙ H) K).hom ≫ whiskerLeft F (associator G H K).hom =
      (associator (F ⋙ G) H K).hom ≫ (associator F G (H ⋙ K)).hom

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
{E : Type u₅}
[CategoryTheory.Category.{v₅, u₅} E]
(F : CategoryTheory.Functor A B)
(G : CategoryTheory.Functor B C)
(H : CategoryTheory.Functor C D)
(K : CategoryTheory.Functor D E)

CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerRight (F.associator G H).hom K)
    (CategoryTheory.CategoryStruct.comp (F.associator (G.comp H) K).hom
      (CategoryTheory.whiskerLeft F (G.associator H K).hom)) =
  CategoryTheory.CategoryStruct.comp ((F.comp G).associator H K).hom (F.associator G (H.comp K)).hom


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

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{e : PartialHomeomorph X Y}
{s : Set X}
{t : Set Y}
{x : X}
(h : e.IsImage s t)
(hx : x ∈ e.source)


theorem true_eq_false_of_false : False → (True = False)


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

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

c.toOver.pt = CategoryTheory.Over.mk (CategoryTheory.CategoryStruct.id c.pt)


private theorem esymm_to_weight (k : ℕ) : k * esymm σ R k =
    (-1) ^ k * ∑ t ∈ filter (fun t ↦ card t.fst = k) (pairs σ k), weight σ R k t

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

↑k * MvPolynomial.esymm σ R k =
  (-1) ^ k *
    ∑ t ∈ Finset.filter (fun t => t.1.card = k) (MvPolynomial.NewtonIdentities.pairs σ k),
      MvPolynomial.NewtonIdentities.weight σ R k t


theorem ext_iff : e = e' ↔ ∀ x, e x = e' x

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
{e e' : A ≃ₐc[R] B}


theorem fG_of_fG_toSubalgebra (S : IntermediateField F E) (h : S.toSubalgebra.FG) : S.FG

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
(S : IntermediateField F E)
(h : S.FG)


/-- If the Lie span of a set is the whole Lie algebra, then two Lie derivations equal on this set
are equal on the whole Lie algebra. -/
theorem ext_of_lieSpan_eq_top (s : Set L) (hs : LieSubalgebra.lieSpan R L s = ⊤)
    (h : Set.EqOn D1 D2 s) : D1 = D2

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
{D1 D2 : LieDerivation R L M}
(s : Set L)
(hs : LieSubalgebra.lieSpan R L s = ⊤)
(h : Set.EqOn (⇑D1) (⇑D2) s)


@[to_additive]
protected lemma MulAction.surjective (g : α) : Function.Surjective (g • · : β → β)

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


theorem iInf_add_iInf (h : ∀ i j, ∃ k, f k + g k ≤ f i + g j) : iInf f + iInf g = ⨅ a, f a + g a

(h : ∀ (i j : ι), ∃ k, f k + g k ≤ f i + g j)


theorem eventually_forall_le_dist_cast_rat_of_den_le (hx : Irrational x) (n : ℕ) :
    ∀ᶠ ε : ℝ in 𝓝 0, ∀ r : ℚ, r.den ≤ n → ε ≤ dist x r

∀ᶠ (ε : ℝ) in 𝓝 0, ∀ (r : ℚ), r.den ≤ n → ε ≤ dist x ↑r


@[to_additive]
theorem mul_apply [Mul Y] (f g : LocallyConstant X Y) (x : X) : (f * g) x = f x * g x

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


/-- The functor `HomologicalComplex (Karoubi C) c ⥤ Karoubi (HomologicalComplex C c)`,
on objects -/
@[simps]
def obj (K : HomologicalComplex (Karoubi C) c) : Karoubi (HomologicalComplex C c)

(K : HomologicalComplex (CategoryTheory.Idempotents.Karoubi C) c)

(CategoryTheory.Idempotents.KaroubiHomologicalComplexEquivalence.Inverse.obj K).p.f n = (K.X n).p


lemma smul_univ₀' [Fintype β] {s : Finset α} (hs : s.Nontrivial) : s • (univ : Finset β) = univ

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[GroupWithZero α]
[MulAction α β]
[Fintype β]
{s : Finset α}
(hs : s.Nontrivial)


theorem rank_fun {M η : Type u} [Fintype η] [AddCommGroup M] [Module R M] [Module.Free R M] :
    Module.rank R (η → M) = Fintype.card η * Module.rank R M

{R : Type u}
[Ring R]
[StrongRankCondition R]
{M η : Type u}
[Fintype η]
[AddCommGroup M]
[Module R M]
[Module.Free R M]

Module.rank R (η → M) = ↑(Fintype.card η) * Module.rank R M


theorem getElem?_reverse' : ∀ {l : List α} (i j), i + j + 1 = length l →
    l.reverse[i]? = l[j]?

i + j + 1 = l.length → l.reverse[i]? = l[j]?


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

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

(AddMagma.FreeAddSemigroup.lift f) (AddMagma.FreeAddSemigroup.of x) = f x


theorem _root_.MonotoneOn.mono (h : MonotoneOn f s) (h' : s₂ ⊆ s) : MonotoneOn f s₂

{α : Type u_1}
{β : Type u_2}
{s s₂ : Set α}
{f : α → β}
[Preorder α]
[Preorder β]
(h : MonotoneOn f s)
(h' : s₂ ⊆ s)


@[simp]
theorem j_mul_k : q.j * q.k = -c₂ • q.i

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[Ring A]
[Algebra R A]
{c₁ c₂ : R}
(q : QuaternionAlgebra.Basis A c₁ c₂)


@[to_additive]
theorem alternatingProd_reverse :
    ∀ l : List α, alternatingProd (reverse l) = alternatingProd l ^ (-1 : ℤ) ^ (length l + 1)

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

l.reverse.alternatingProd = l.alternatingProd ^ (-1) ^ (l.length + 1)


lemma cfcₙ_neg : cfcₙ (fun x ↦ - (f x)) a = - (cfcₙ f a)


/-- If `f` is strictly antitone both on `(-∞, a]` and `[a, ∞)`, then it is strictly antitone on the
whole line. -/
protected theorem StrictAntiOn.Iic_union_Ici (h₁ : StrictAntiOn f (Iic a))
    (h₂ : StrictAntiOn f (Ici a)) : StrictAnti f

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[Preorder β]
{a : α}
{f : α → β}
(h₁ : StrictAntiOn f (Set.Iic a))
(h₂ : StrictAntiOn f (Set.Ici a))


@[simp]
theorem neighborSet_inf {H H' : G.Subgraph} (v : V) :
    (H ⊓ H').neighborSet v = H.neighborSet v ∩ H'.neighborSet v

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


theorem dist_eq_zero_of_not_reachable (h : ¬G.Reachable u v) : G.dist u v = 0

{V : Type u_1}
{G : SimpleGraph V}
{u v : V}
(h : ¬G.Reachable u v)


@[to_additive]
theorem ContMDiffOn.div {f g : M → G} {s : Set M} (hf : ContMDiffOn I' I n f s)
    (hg : ContMDiffOn I' I n g s) : ContMDiffOn I' I n (fun x => f x / g x) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_5}
[TopologicalSpace G]
[ChartedSpace H G]
[Group G]
[LieGroup I G]
{E' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_7}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H' M]
{n : ℕ∞}
{f g : M → G}
{s : Set M}
(hf : ContMDiffOn I' I n f s)
(hg : ContMDiffOn I' I n g s)


theorem sum_nodalWeight_mul_inv_sub_ne_zero (hvs : Set.InjOn v s) (hx : ∀ i ∈ s, x ≠ v i)
    (hs : s.Nonempty) : (∑ i ∈ s, nodalWeight s v i * (x - v i)⁻¹) ≠ 0

{F : Type u_1}
[Field F]
{ι : Type u_2}
[DecidableEq ι]
{s : Finset ι}
{v : ι → F}
{x : F}
(hvs : Set.InjOn v ↑s)
(hx : ∀ i ∈ s, x ≠ v i)
(hs : s.Nonempty)

∑ i ∈ s, Lagrange.nodalWeight s v i * (x - v i)⁻¹ ≠ 0


theorem one_of_isUnit (hv : Integers v O) {x : O} (hx : IsUnit x) : v (algebraMap O R x) = 1

{R : Type u}
{Γ₀ : Type v}
[CommRing R]
[LinearOrderedCommGroupWithZero Γ₀]
{v : Valuation R Γ₀}
{O : Type w}
[CommRing O]
[Algebra O R]
(hv : v.Integers O)
{x : O}
(hx : IsUnit x)


theorem boundaries_nonempty : c.boundaries.Nonempty


@[simp]
theorem dedup_eq_nil (l : List α) : l.dedup = [] ↔ l = []

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


theorem inv_smul_mem_iff₀ (ha : a ≠ 0) : a⁻¹ • b ∈ s ↔ b ∈ a • s

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

a⁻¹ • b ∈ s ↔ b ∈ a • s


@[simp]
theorem toFinsupp_neg [AddGroup M] [∀ m : M, Decidable (m ≠ 0)] (f : Π₀ _ : ι, M) :
    (toFinsupp (-f) : ι →₀ M) = -toFinsupp f

{ι : Type u_1}
{M : Type u_3}
[DecidableEq ι]
[AddGroup M]
[(m : M) → Decidable (m ≠ 0)]
(f : Π₀ (x : ι), M)


@[simp]
theorem mod'_to_nat (n d) : (mod' n d : ℕ) = n % d


/-- A variant of `lift_unique` with `Z` an initial object. -/
@[simps!]
def liftToInitialUnique {D : Type*} [Category D] {Z : D} (F : C ⥤ D) (hZ : Limits.IsInitial Z)
    (G : WithInitial C ⥤ D) (h : incl ⋙ G ≅ F) (hG : G.obj star ≅ Z) : G ≅ liftToInitial F hZ

(hZ : CategoryTheory.Limits.IsInitial Z)

(G : CategoryTheory.Functor (CategoryTheory.WithInitial C) D)

(h : CategoryTheory.WithInitial.incl.comp G ≅ F)

(hG : G.obj CategoryTheory.WithInitial.star ≅ Z)

(CategoryTheory.WithInitial.liftToInitialUnique F hZ G h hG).inv.app X =
  (match X with
    | CategoryTheory.WithInitial.of x => h.app x
    | CategoryTheory.WithInitial.star => hG).inv


theorem indicator_ae_eq_of_restrict_compl_ae_eq_zero (hs : MeasurableSet s)
    (hf : f =ᵐ[μ.restrict sᶜ] 0) : s.indicator f =ᵐ[μ] f

{α : Type u_2}
{β : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s : Set α}
{f : α → β}
[Zero β]
(hs : MeasurableSet s)
(hf : f =ᵐ[μ.restrict sᶜ] 0)


theorem gcd_assoc' [GCDMonoid α] (m n k : α) : Associated (gcd (gcd m n) k) (gcd m (gcd n k))

{α : Type u_1}
[CancelCommMonoidWithZero α]
[GCDMonoid α]
(m n k : α)


@[to_additive]
theorem embedding_embedProduct : Embedding (embedProduct M)

{M : Type u_1}
[TopologicalSpace M]
[AddMonoid M]


theorem nat_add (h : Irrational x) (m : ℕ) : Irrational (m + x)


theorem not_ex_isQF (φ : L.BoundedFormula α (n + 1)) : ¬φ.ex.IsQF

{L : FirstOrder.Language}
{α : Type u'}
{n : ℕ}
(φ : L.BoundedFormula α (n + 1))


theorem min_orderTop_le_orderTop_sub {Γ} [LinearOrder Γ] {x y : HahnSeries Γ R} :
    min x.orderTop y.orderTop ≤ (x - y).orderTop

{R : Type u_2}
[AddGroup R]
{Γ : Type u_3}
[LinearOrder Γ]
{x y : HahnSeries Γ R}


@[to_additive (attr := simp, norm_cast)]
theorem min_val [Monoid α] [LinearOrder α] {a b : αˣ} : (min a b).val = min a.val b.val

{α : Type u_1}
[AddMonoid α]
[LinearOrder α]
{a b : AddUnits α}


theorem ofNat_sub_ofNat {n} (x y : Nat) : BitVec.ofNat n x - BitVec.ofNat n y = .ofNat n ((2^n - y % 2^n) + x)

BitVec.ofNat n x - BitVec.ofNat n y = BitVec.ofNat n (2 ^ n - y % 2 ^ n + x)


/-- If `p` is a prime natural number and `x` is a natural number, then there exist natural numbers
`a ≤ p / 2` and `b ≤ p / 2` such that `a ^ 2 + b ^ 2 ≡ x [MOD p]`. This is a version of
`ZMod.sq_add_sq` with estimates on `a` and `b`. -/
theorem Nat.sq_add_sq_modEq (p : ℕ) [Fact p.Prime] (x : ℕ) :
    ∃ a b : ℕ, a ≤ p / 2 ∧ b ≤ p / 2 ∧ a ^ 2 + b ^ 2 ≡ x [MOD p]

∃ a b, a ≤ p / 2 ∧ b ≤ p / 2 ∧ a ^ 2 + b ^ 2 ≡ x [MOD p]


lemma MapsTo.prodMap (h₁ : MapsTo f₁ s₁ t₁) (h₂ : MapsTo f₂ s₂ t₂) :
    MapsTo (fun x ↦ (f₁ x.1, f₂ x.2)) (s₁ ×ˢ s₂) (t₁ ×ˢ t₂)

{α₁ : Type u_6}
{α₂ : Type u_7}
{β₁ : Type u_8}
{β₂ : Type u_9}
{s₁ : Set α₁}
{s₂ : Set α₂}
{t₁ : Set β₁}
{t₂ : Set β₂}
{f₁ : α₁ → β₁}
{f₂ : α₂ → β₂}
(h₁ : Set.MapsTo f₁ s₁ t₁)
(h₂ : Set.MapsTo f₂ s₂ t₂)

Set.MapsTo (fun x => (f₁ x.1, f₂ x.2)) (s₁ ×ˢ s₂) (t₁ ×ˢ t₂)


theorem left_mem_Ico : a ∈ Ico a b ↔ a < b


theorem image_coe_Icc : (some : α → WithTop α) '' Icc a b = Icc (a : WithTop α) b

WithTop.some '' Set.Icc a b = Set.Icc ↑a ↑b


theorem nadd_lt_nadd_iff_left : ∀ (a) {b c}, a ♯ b < a ♯ c ↔ b < c

(a : Ordinal.{u_1})
{b c : Ordinal.{u_1}}


/-- The right unitor, a natural isomorphism `(F ⋙ (𝟭 B)) ≅ F`.
-/
@[simps]
def rightUnitor (F : A ⥤ B) :
    F ⋙ 𝟭 B ≅ F

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

F.rightUnitor.hom.app X = CategoryTheory.CategoryStruct.id (F.obj X)


/-- The counit isomorphism of the
equivalence `triangleOpEquivalence C : (Triangle C)ᵒᵖ ≌ Triangle Cᵒᵖ` . -/
@[simps!]
noncomputable def counitIso : inverse C ⋙ functor C ≅ 𝟭 _

(X : CategoryTheory.Pretriangulated.Triangle Cᵒᵖ)

((CategoryTheory.Pretriangulated.TriangleOpEquivalence.counitIso C).inv.app X).hom₁ =
  CategoryTheory.CategoryStruct.id X.obj₁


theorem extChartAt_source_mem_nhds' {x x' : M} (h : x' ∈ (extChartAt I x).source) :
    (extChartAt I x).source ∈ 𝓝 x'

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(I : ModelWithCorners 𝕜 E H)
[ChartedSpace H M]
{x x' : M}
(h : x' ∈ (extChartAt I x).source)


@[simp]
theorem mem_restrictScalars {U : Subalgebra S A} {x : A} : x ∈ restrictScalars R U ↔ x ∈ U

(R : Type u)
{S : Type v}
{A : Type w}
[CommSemiring R]
[CommSemiring S]
[Semiring A]
[Algebra R S]
[Algebra S A]
[Algebra R A]
[IsScalarTower R S A]
{U : Subalgebra S A}
{x : A}

x ∈ Subalgebra.restrictScalars R U ↔ x ∈ U


/-- If a measure `μ` on a quotient satisfies `QuotientMeasureEqMeasurePreimage` with respect to a
sigma-finite measure `ν`, then it is itself `SigmaFinite`. -/
@[to_additive]
lemma QuotientMeasureEqMeasurePreimage.sigmaFiniteQuotient
    [i : SigmaFinite ν] [i' : HasFundamentalDomain G α ν]
    (μ : Measure (Quotient α_mod_G)) [QuotientMeasureEqMeasurePreimage ν μ] :
    SigmaFinite μ

[MeasureTheory.VAddInvariantMeasure G α ν]

[i' : MeasureTheory.HasAddFundamentalDomain G α ν]

(μ : MeasureTheory.Measure (Quotient (AddAction.orbitRel G α)))


theorem Nodup.erase [DecidableEq α] (a : α) : Nodup l → Nodup (l.erase a)

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


@[simp, fun_prop]
theorem Differentiable.smul (hc : Differentiable 𝕜 c) (hf : Differentiable 𝕜 f) :
    Differentiable 𝕜 fun y => c y • f y

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{𝕜' : Type u_6}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{c : E → 𝕜'}
(hc : Differentiable 𝕜 c)
(hf : Differentiable 𝕜 f)


theorem ciInf_le' (f : ι → α) (i : ι) : iInf f ≤ f i

{α : Type u_1}
{ι : Sort u_4}
[ConditionallyCompleteLinearOrderBot α]
(f : ι → α)
(i : ι)


@[simp]
theorem map_valEmbedding_Ioc : (Ioc a b).map Fin.valEmbedding = Ioc ↑a ↑b

Finset.map Fin.valEmbedding (Finset.Ioc a b) = Finset.Ioc ↑a ↑b


{R : Type u_4}
[CommRing R]
{n : ℕ}
(hn : 1 < n)
{ζ : R}
(hζ : IsPrimitiveRoot ζ n)


theorem lift_reindex
    (e : ι ≃ ι₂) (φ : MultilinearMap R (fun i ↦ s (e.symm i)) E) (x : ⨂[R] i, s i) :
    lift φ (reindex R s e x) = lift ((domDomCongrLinearEquiv' R R s _ e).symm φ) x

(e : ι ≃ ι₂)

(φ : MultilinearMap R (fun i => s (e.symm i)) E)

(PiTensorProduct.lift φ) ((PiTensorProduct.reindex R s e) x) =
  (PiTensorProduct.lift ((MultilinearMap.domDomCongrLinearEquiv' R R s E e).symm φ)) x


theorem set_biInter_biUnion (s : Finset γ) (t : γ → Finset α) (f : α → Set β) :
    ⋂ y ∈ s.biUnion t, f y = ⋂ (x ∈ s) (y ∈ t x), f y

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[DecidableEq α]
(s : Finset γ)
(t : γ → Finset α)
(f : α → Set β)

⋂ y ∈ s.biUnion t, f y = ⋂ x ∈ s, ⋂ y ∈ t x, f y


/-- If `s` is a neighborhood of the origin, then `gauge s` is continuous at the origin.
See also `continuousAt_gauge`. -/
theorem continuousAt_gauge_zero (hs : s ∈ 𝓝 0) : ContinuousAt (gauge s) 0

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
[TopologicalSpace E]
[ContinuousSMul ℝ E]
(hs : s ∈ 𝓝 0)


@[fun_prop]
theorem DifferentiableAt.clm_apply (hc : DifferentiableAt 𝕜 c x) (hu : DifferentiableAt 𝕜 u x) :
    DifferentiableAt 𝕜 (fun y => (c y) (u y)) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{x : E}
{H : Type u_6}
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
{c : E → G →L[𝕜] H}
{u : E → G}
(hc : DifferentiableAt 𝕜 c x)
(hu : DifferentiableAt 𝕜 u x)


@[simp]
theorem iInf_eq_top : iInf s = ⊤ ↔ ∀ i, s i = ⊤

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
{s : ι → α}


theorem btw_of_sbtw {a b c : α} (h : sbtw a b c) : btw a b c

{α : Type u_1}
[CircularPreorder α]
{a b c : α}
(h : sbtw a b c)


@[to_additive]
theorem tprod_eq_one_of_not_multipliable (h : ¬Multipliable f) : ∏' b, f b = 1

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


@[to_additive]
theorem iff_card_le_one [DecidableEq G] (ha0 : a0 ∈ A) (hb0 : b0 ∈ B) :
    UniqueMul A B a0 b0 ↔ ((A ×ˢ B).filter (fun p ↦ p.1 * p.2 = a0 * b0)).card ≤ 1

{G : Type u_1}
[Add G]
{A B : Finset G}
{a0 b0 : G}
[DecidableEq G]
(ha0 : a0 ∈ A)
(hb0 : b0 ∈ B)

UniqueAdd A B a0 b0 ↔ (Finset.filter (fun p => p.1 + p.2 = a0 + b0) (A ×ˢ B)).card ≤ 1


@[simp]
theorem sameCycle_inv : SameCycle f⁻¹ x y ↔ SameCycle f x y

{α : Type u_2}
{f : Equiv.Perm α}
{x y : α}


theorem compactOperator_topologicalClosure {𝕜₁ 𝕜₂ : Type*} [NontriviallyNormedField 𝕜₁]
    [NormedField 𝕜₂] {σ₁₂ : 𝕜₁ →+* 𝕜₂} {M₁ M₂ : Type*} [SeminormedAddCommGroup M₁]
    [AddCommGroup M₂] [NormedSpace 𝕜₁ M₁] [Module 𝕜₂ M₂] [UniformSpace M₂] [UniformAddGroup M₂]
    [ContinuousConstSMul 𝕜₂ M₂] [T2Space M₂] [CompleteSpace M₂] :
    (compactOperator σ₁₂ M₁ M₂).topologicalClosure = compactOperator σ₁₂ M₁ M₂

{𝕜₁ : Type u_1}
{𝕜₂ : Type u_2}
[NontriviallyNormedField 𝕜₁]
[NormedField 𝕜₂]
{σ₁₂ : 𝕜₁ →+* 𝕜₂}
{M₁ : Type u_3}
{M₂ : Type u_4}
[SeminormedAddCommGroup M₁]
[AddCommGroup M₂]
[NormedSpace 𝕜₁ M₁]
[Module 𝕜₂ M₂]
[UniformSpace M₂]
[UniformAddGroup M₂]
[ContinuousConstSMul 𝕜₂ M₂]
[T2Space M₂]
[CompleteSpace M₂]


@[to_additive]
theorem csInf_inv (hs₀ : s.Nonempty) (hs₁ : BddAbove s) : sInf s⁻¹ = (sSup s)⁻¹

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

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


lemma IsConj.ext {σ₁ σ₂ : K ≃ₐ[k] K} (h₁ : IsConj φ σ₁) (h₂ : IsConj φ σ₂) : σ₁ = σ₂

(h₁ : NumberField.ComplexEmbedding.IsConj φ σ₁)

(h₂ : NumberField.ComplexEmbedding.IsConj φ σ₂)


theorem toConjAct_one : toConjAct (1 : G) = 1


/--
If `a₀ -r→ a₁ -r→ ... -r→ aₙ` is an `r`-series and `a` is such that
`aᵢ -r→ a -r→ a_ᵢ₊₁`, then
`a₀ -r→ a₁ -r→ ... -r→ aᵢ -r→ a -r→ aᵢ₊₁ -r→ ... -r→ aₙ`
is another `r`-series
-/
@[simps]
def insertNth (p : RelSeries r) (i : Fin p.length) (a : α)
    (prev_connect : r (p (Fin.castSucc i)) a) (connect_next : r a (p i.succ)) : RelSeries r

(prev_connect : r (p.toFun i.castSucc) a)

(p.insertNth i a prev_connect connect_next).length = p.length + 1


@[to_additive (attr := simp)]
theorem inv_subset_closure (S : Set G) : S⁻¹ ⊆ closure S


theorem HasBasis.liminf_eq_sSup_iUnion_iInter {ι ι' : Type*} {f : ι → α} {v : Filter ι}
    {p : ι' → Prop} {s : ι' → Set ι} (hv : v.HasBasis p s) :
    liminf f v = sSup (⋃ (j : Subtype p), ⋂ (i : s j), Iic (f i))

{α : Type u_1}
[ConditionallyCompleteLattice α]
{ι : Type u_6}
{ι' : Type u_7}
{f : ι → α}
{v : Filter ι}
{p : ι' → Prop}
{s : ι' → Set ι}
(hv : v.HasBasis p s)

Filter.liminf f v = sSup (⋃ j, ⋂ i, Set.Iic (f ↑i))


@[to_additive]
theorem comap_comap_center {H₁ : Subgroup G} [H₁.Normal] {H₂ : Subgroup (G ⧸ H₁)} [H₂.Normal] :
    ((Subgroup.center ((G ⧸ H₁) ⧸ H₂)).comap (mk' H₂)).comap (mk' H₁) =
      (Subgroup.center (G ⧸ H₂.comap (mk' H₁))).comap (mk' (H₂.comap (mk' H₁)))

{G : Type u}
[AddGroup G]
{H₁ : AddSubgroup G}
[H₁.Normal]
{H₂ : AddSubgroup (G ⧸ H₁)}
[H₂.Normal]

AddSubgroup.comap (QuotientAddGroup.mk' H₁)
    (AddSubgroup.comap (QuotientAddGroup.mk' H₂) (AddSubgroup.center ((G ⧸ H₁) ⧸ H₂))) =
  AddSubgroup.comap (QuotientAddGroup.mk' (AddSubgroup.comap (QuotientAddGroup.mk' H₁) H₂))
    (AddSubgroup.center (G ⧸ AddSubgroup.comap (QuotientAddGroup.mk' H₁) H₂))


theorem IsMinFilter.sup (hf : IsMinFilter f l a) (hg : IsMinFilter g l a) :
    IsMinFilter (fun x => f x ⊔ g x) l a

{α : Type u}
{β : Type v}
[SemilatticeSup β]
{f g : α → β}
{a : α}
{l : Filter α}
(hf : IsMinFilter f l a)
(hg : IsMinFilter g l a)


@[to_additive]
theorem mul_iff_left [CommGroup β] [TopologicalGroup β] (hf : AEStronglyMeasurable f μ) :
    AEStronglyMeasurable (g * f) μ ↔ AEStronglyMeasurable g μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEStronglyMeasurable (g + f) μ ↔ MeasureTheory.AEStronglyMeasurable g μ


@[simp] lemma directLimitLeft_tmul_of {i : ι} (g : G i) (m : M) :
    directLimitLeft f M (of _ _ _ _ _ g ⊗ₜ m) = of _ _ _ (f ▷ M) _ (g ⊗ₜ m)

{R : Type u_1}
[CommRing R]
{ι : Type u_2}
[DecidableEq ι]
[Preorder ι]
{G : ι → Type u_3}
[(i : ι) → AddCommGroup (G i)]
[(i : ι) → Module R (G i)]
(f : (i j : ι) → i ≤ j → G i →ₗ[R] G j)
(M : Type u_4)
[AddCommGroup M]
[Module R M]
[IsDirected ι fun x x_1 => x ≤ x_1]
{i : ι}
(g : G i)
(m : M)

(TensorProduct.directLimitLeft f M) ((Module.DirectLimit.of R ι G f i) g ⊗ₜ[R] m) =
  (Module.DirectLimit.of R ι (fun i => G i ⊗[R] M) (fun i j h => LinearMap.rTensor M (f i j h)) i) (g ⊗ₜ[R] m)


theorem Finset.card_eq_of_equiv {s : Finset α} {t : Finset β} (i : s ≃ t) : s.card = t.card

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}
(i : { x // x ∈ s } ≃ { x // x ∈ t })


/-- See `add_tsub_cancel_right` for the equality if `ContravariantClass α α (+) (≤)`. -/
theorem add_tsub_le_right : a + b - b ≤ a

{α : Type u_1}
[Preorder α]
[Add α]
[Sub α]
[OrderedSub α]
{a b : α}


/-- Compatibility of `changeFunctor` with the composition of isomorphisms of functors -/
theorem changeFunctor_trans (e : C ≌ D) {G G' : C ⥤ D} (iso₁ : e.functor ≅ G) (iso₂ : G ≅ G') :
    (e.changeFunctor iso₁).changeFunctor iso₂ = e.changeFunctor (iso₁ ≪≫ iso₂)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(e : C ≌ D)
{G G' : CategoryTheory.Functor C D}
(iso₁ : e.functor ≅ G)
(iso₂ : G ≅ G')


/-- An `L : Addsubgroup E` where `E` is a vector space over a normed field `K` is a `ℤ`-lattice if
it is discrete and spans `E` over `K`. -/
class IsZlattice (K : Type*) [NormedField K] {E : Type*} [NormedAddCommGroup E] [NormedSpace K E]
    (L : AddSubgroup E) [DiscreteTopology L] : Prop where
  /-- `L` spans the full space `E` over `K`. -/
  span_top : span K (L : Set E) = ⊤

{K : Type u_1}
[NormedField K]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace K E]
{L : AddSubgroup E}
[DiscreteTopology ↥L]
[self : IsZlattice K L]


@[reassoc (attr := simp)]
lemma inr_f_snd_v (p : ℤ) :
    (inr φ).f p ≫ (snd φ).v p p (add_zero p) = 𝟙 _

(CochainComplex.mappingCone.inr φ).f p ≫ (CochainComplex.mappingCone.snd φ).v p p ⋯ = 𝟙 (G.X p)


theorem finSuccEquiv_X_succ {j : Fin n} : finSuccEquiv R n (X j.succ) = Polynomial.C (X j)

{R : Type u}
[CommSemiring R]
{n : ℕ}
{j : Fin n}

(MvPolynomial.finSuccEquiv R n) (MvPolynomial.X j.succ) = Polynomial.C (MvPolynomial.X j)


@[simp]
theorem intrinsicClosure_eq_closure : intrinsicClosure 𝕜 s = closure s

(𝕜 : Type u_1)
{V : Type u_2}
{P : Type u_5}
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
[NormedAddCommGroup V]
[NormedSpace 𝕜 V]
[FiniteDimensional 𝕜 V]
[MetricSpace P]
[NormedAddTorsor V P]
(s : Set P)


theorem comp_apply (g : β →ᵈ γ) (f : α →ᵈ β) (x : α) : (g.comp f : α → γ) x = g (f x)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
[PseudoEMetricSpace γ]
(g : β →ᵈ γ)
(f : α →ᵈ β)
(x : α)


@[to_additive (attr := simp, nolint simpComm)]
theorem commute_unop [Mul α] {x y : αᵐᵒᵖ} : Commute (unop x) (unop y) ↔ Commute x y

AddCommute (AddOpposite.unop x) (AddOpposite.unop y) ↔ AddCommute x y


theorem lt_length_left_of_zipWith {f : α → β → γ} {i : ℕ} {l : List α} {l' : List β}
    (h : i < (zipWith f l l').length) : i < l.length

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


lemma Hom.sub_one_tmul (f g : Hom P P') (x) :
    f.sub g (1 ⊗ₜ .D _ _ x) = Cotangent.mk (f.subToKer g x)

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
{R' : Type u'}
{S' : Type v'}
[CommRing R']
[CommRing S']
[Algebra R' S']
{P' : Algebra.Generators R' S'}
[Algebra R R']
[Algebra S S']
[Algebra R S']
[IsScalarTower R R' S']
[IsScalarTower R S S']
(f g : P.Hom P')
(x : P.Ring)

(f.sub g) (1 ⊗ₜ[P.Ring] (KaehlerDifferential.D R P.Ring) x) = Algebra.Generators.Cotangent.mk ((f.subToKer g) x)


protected theorem Connected.ofBoxProdRight (h : (G □ H).Connected) : H.Connected

{α : Type u_1}
{β : Type u_2}
{G : SimpleGraph α}
{H : SimpleGraph β}
(h : (G □ H).Connected)


@[simp] lemma toFun_eq_coe (f : sInfHom α β) : f.toFun = f

{α : Type u_2}
{β : Type u_3}
[InfSet α]
[InfSet β]
(f : sInfHom α β)


theorem lintegral_mul_eq_lintegral_mul_lintegral_of_indepFun'' (h_meas_f : AEMeasurable f μ)
    (h_meas_g : AEMeasurable g μ) (h_indep_fun : IndepFun f g μ) :
    ∫⁻ ω, f ω * g ω ∂μ = (∫⁻ ω, f ω ∂μ) * ∫⁻ ω, g ω ∂μ

(h_indep_fun : ProbabilityTheory.IndepFun f g μ)

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


lemma AddMonoidHom.mulRight_eq_mulLeft_iff_forall_commute {b : R} :
    mulRight b = mulLeft b ↔ ∀ a, Commute a b

{R : Type u_1}
[NonUnitalNonAssocSemiring R]
{b : R}

AddMonoidHom.mulRight b = AddMonoidHom.mulLeft b ↔ ∀ (a : R), Commute a b


theorem substr_num_den' (q r : ℚ) :
    (q - r).num * q.den * r.den = (q.num * r.den - r.num * q.den) * (q - r).den

(q - r).num * ↑q.den * ↑r.den = (q.num * ↑r.den - r.num * ↑q.den) * ↑(q - r).den


theorem hasSum_mul_right_iff (h : a₂ ≠ 0) : HasSum (fun i ↦ f i * a₂) (a₁ * a₂) ↔ HasSum f a₁

{ι : Type u_1}
{α : Type u_4}
[DivisionSemiring α]
[TopologicalSpace α]
[TopologicalSemiring α]
{f : ι → α}
{a₁ a₂ : α}
(h : a₂ ≠ 0)

HasSum (fun i => f i * a₂) (a₁ * a₂) ↔ HasSum f a₁


/-- The identity is `C^∞`.
-/
theorem contDiff_id : ContDiff 𝕜 n (id : E → E)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{n : ℕ∞}


/-- Consider the differential of the inclusion of the sphere in `E` at the point `v` as a continuous
linear map from `TangentSpace (𝓡 n) v` to `E`.  This map is injective. -/
theorem mfderiv_coe_sphere_injective {n : ℕ} [Fact (finrank ℝ E = n + 1)] (v : sphere (0 : E) 1) :
    Injective (mfderiv (𝓡 n) 𝓘(ℝ, E) ((↑) : sphere (0 : E) 1 → E) v)

[Fact (FiniteDimensional.finrank ℝ E = n + 1)]

Function.Injective ⇑(mfderiv 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) 𝓘(ℝ, E) Subtype.val v)


@[simp]
theorem congr_apply (f : M ≃ₗ[R] N) (x : AdicCompletion I M) :
    congr I f x = map I f x

{R : Type u_1}
[CommRing R]
(I : Ideal R)
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{N : Type u_3}
[AddCommGroup N]
[Module R N]
(f : M ≃ₗ[R] N)
(x : AdicCompletion I M)

(AdicCompletion.congr I f) x = (AdicCompletion.map I ↑f) x


theorem candidatesBOfCandidates_mem (f : ProdSpaceFun X Y) (fA : f ∈ candidates X Y) :
    candidatesBOfCandidates f fA ∈ candidatesB X Y

(fA : f ∈ GromovHausdorff.candidates X Y)

GromovHausdorff.candidatesBOfCandidates f fA ∈ GromovHausdorff.candidatesB X Y


theorem one_kronecker_one [MulZeroOneClass α] [DecidableEq m] [DecidableEq n] :
    (1 : Matrix m m α) ⊗ₖ (1 : Matrix n n α) = 1

{α : Type u_2}
{m : Type u_9}
{n : Type u_10}
[MulZeroOneClass α]
[DecidableEq m]
[DecidableEq n]

Matrix.kroneckerMap (fun x x_1 => x * x_1) 1 1 = 1


theorem noTopOrder_iff_noMaxOrder (α : Type*) [LinearOrder α] : NoTopOrder α ↔ NoMaxOrder α


theorem continuousWithinAt_star {s : Set R} {x : R} : ContinuousWithinAt star s x

{R : Type u_2}
[TopologicalSpace R]
[Star R]
[ContinuousStar R]
{s : Set R}
{x : R}


/-- An arrow in the groupoid defines, by conjugation, an isomorphism of groups between
its endpoints.
-/
@[simps]
def vertexGroupIsomOfMap {c d : C} (f : c ⟶ d) : (c ⟶ c) ≃* (d ⟶ d)

{C : Type u}
[CategoryTheory.Groupoid C]
{c d : C}
(f : c ⟶ d)
(δ : d ⟶ d)

(CategoryTheory.Groupoid.vertexGroupIsomOfMap f).symm δ =
  CategoryTheory.CategoryStruct.comp f (CategoryTheory.CategoryStruct.comp δ (CategoryTheory.Groupoid.inv f))


protected theorem lt_of_sub_neg {a b : Int} (h : a - b < 0) : a < b


@[simp]
theorem im_imJ : a.im.imJ = a.imJ

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(a : ℍ[R,c₁,c₂])


theorem descPochhammer_eq_factorial_smul_choose [NatPowAssoc R] (r : R) (n : ℕ) :
    (descPochhammer ℤ n).smeval r = n.factorial • choose r n

{R : Type u_1}
[NonAssocRing R]
[Pow R ℕ]
[BinomialRing R]
[NatPowAssoc R]
(r : R)
(n : ℕ)

(descPochhammer ℤ n).smeval r = n.factorial • Ring.choose r n


@[simp]
theorem update_inl_comp_inr [DecidableEq (α ⊕ β)] {f : α ⊕ β → γ} {i : α} {x : γ} :
    update f (inl i) x ∘ inr = f ∘ inr

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

Function.update f (Sum.inl i) x ∘ Sum.inr = f ∘ Sum.inr


@[simp] theorem cast_symm {α β} (h : α = β) : (Equiv.cast h).symm = Equiv.cast h.symm


@[simp] theorem freeOn_base_iff : (freeOn E).Base B ↔ B = E


theorem total_dualBasis (f : ι →₀ R) (i : ι) :
    Finsupp.total ι (Dual R M) R b.dualBasis f (b i) = f i

{R : Type uR}
{M : Type uM}
{ι : Type uι}
[CommRing R]
[AddCommGroup M]
[Module R M]
[DecidableEq ι]
(b : Basis ι R M)
[Finite ι]
(f : ι →₀ R)
(i : ι)

((Finsupp.total ι (Module.Dual R M) R ⇑b.dualBasis) f) (b i) = f i


/-- A number that divides an `s`-factored number is itself `s`-factored. -/
lemma mem_factoredNumbers_of_dvd {s : Finset ℕ} {m k : ℕ} (h : m ∈ factoredNumbers s)
    (h' : k ∣ m) :
    k ∈ factoredNumbers s

{s : Finset ℕ}
{m k : ℕ}
(h : m ∈ Nat.factoredNumbers s)
(h' : k ∣ m)


@[simp, norm_cast]
theorem nnnorm_coe (a : ℝ) : ‖(a : ℍ)‖₊ = ‖a‖₊

‖↑a‖₊ = ‖a‖₊


@[reassoc]
theorem leftUnitor_tensor'' (X Y : C) :
    (α_ (𝟙_ C) X Y).hom ≫ (λ_ (X ⊗ Y)).hom = (λ_ X).hom ⊗ 𝟙 Y

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.MonoidalCategory C]
(X Y : C)

(CategoryTheory.MonoidalCategory.associator (𝟙_ C) X Y).hom ≫
    (CategoryTheory.MonoidalCategory.leftUnitor (CategoryTheory.MonoidalCategory.tensorObj X Y)).hom =
  CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.MonoidalCategory.leftUnitor X).hom (𝟙 Y)


/-- `comap` preserves equivalence. -/
theorem comap {S : Type*} [Ring S] (f : S →+* R) (h : v₁.IsEquiv v₂) :
    (v₁.comap f).IsEquiv (v₂.comap f)

{R : Type u_3}
{Γ₀ : Type u_4}
{Γ'₀ : Type u_5}
[LinearOrderedAddCommMonoidWithTop Γ₀]
[LinearOrderedAddCommMonoidWithTop Γ'₀]
[Ring R]
{v₁ : AddValuation R Γ₀}
{v₂ : AddValuation R Γ'₀}
{S : Type u_7}
[Ring S]
(f : S →+* R)
(h : v₁.IsEquiv v₂)

(AddValuation.comap f v₁).IsEquiv (AddValuation.comap f v₂)


/-- The functor `(F ⋙ G, S) ⥤ (G, S)`. -/
@[simps!]
def pre (F : B ⥤ C) (G : C ⥤ D) (S : D) : CostructuredArrow (F ⋙ G) S ⥤ CostructuredArrow G S

(X : CategoryTheory.Comma (F.comp G) (CategoryTheory.Functor.fromPUnit S))

((CategoryTheory.CostructuredArrow.pre F G S).obj X).hom = X.hom


@[to_additive]
lemma Submonoid.units_mono : Monotone (Submonoid.units (M := M))


theorem eq_of_eq_of_eq {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b = 0) : a + b = 0

{α : Type u_1}
[OrderedSemiring α]
{a b : α}
(ha : a = 0)
(hb : b = 0)


theorem IsLUB.mem_of_isClosed {a : α} {s : Set α} (ha : IsLUB s a) (hs : s.Nonempty)
    (sc : IsClosed s) : a ∈ s

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


theorem le_mod_add_mod_of_dvd_add_of_not_dvd {a b c : ℕ} (h : c ∣ a + b) (ha : ¬c ∣ a) :
    c ≤ a % c + b % c


@[to_additive (attr := simp)]
lemma stabilizer_subgroup (s : Subgroup G) : stabilizer G (s : Set G) = s

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


@[simp]
theorem curry_apply (f : α × β →o γ) (x : α) (y : β) : curry f x y = f (x, y)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Preorder α]
[Preorder β]
[Preorder γ]
(f : α × β →o γ)
(x : α)
(y : β)


/-- The product of two partial homeomorphisms, as a partial homeomorphism on the product space. -/
@[simps! (config := mfld_cfg) toPartialEquiv apply,
  simps! (config := .lemmasOnly) source target symm_apply]
def prod (eX : PartialHomeomorph X X') (eY : PartialHomeomorph Y Y') :
    PartialHomeomorph (X × Y) (X' × Y')

{X : Type u_1}
{X' : Type u_2}
{Y : Type u_3}
{Y' : Type u_4}
[TopologicalSpace X]
[TopologicalSpace X']
[TopologicalSpace Y]
[TopologicalSpace Y']
(eX : PartialHomeomorph X X')
(eY : PartialHomeomorph Y Y')

(eX.prod eY).target = eX.target ×ˢ eY.target


/-- When a function has a limit at infinity `l`, and its derivative is nonnegative, then the
integral of the derivative on `(a, +∞)` is `l - g a` (and the derivative is integrable, see
`integrable_on_Ioi_deriv_of_nonneg`). Version assuming differentiability on `(a, +∞)` and
continuity at `a⁺`. -/
theorem integral_Ioi_of_hasDerivAt_of_nonneg (hcont : ContinuousWithinAt g (Ici a) a)
    (hderiv : ∀ x ∈ Ioi a, HasDerivAt g (g' x) x) (g'pos : ∀ x ∈ Ioi a, 0 ≤ g' x)
    (hg : Tendsto g atTop (𝓝 l)) : ∫ x in Ioi a, g' x = l - g a

(hcont : ContinuousWithinAt g (Set.Ici a) a)

(hderiv : ∀ x ∈ Set.Ioi a, HasDerivAt g (g' x) x)

(hg : Filter.Tendsto g Filter.atTop (𝓝 l))


theorem integrable_inv_smul_measure {f : α → β} {c : ℝ≥0∞} (h₁ : c ≠ 0) (h₂ : c ≠ ∞) :
    Integrable f (c⁻¹ • μ) ↔ Integrable f μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{f : α → β}
{c : ℝ≥0∞}
(h₁ : c ≠ 0)
(h₂ : c ≠ ⊤)

MeasureTheory.Integrable f (c⁻¹ • μ) ↔ MeasureTheory.Integrable f μ


/-- A version of `WithBot.map` for `OneHom`s. -/
@[to_additive (attr := simps (config := .asFn))
  "A version of `WithBot.map` for `ZeroHom`s"]
protected def _root_.OneHom.withBotMap {M N : Type*} [One M] [One N] (f : OneHom M N) :
    OneHom (WithBot M) (WithBot N)

{M : Type u_1}
{N : Type u_2}
[Zero M]
[Zero N]
(f : ZeroHom M N)


lemma IsLowerSet.isUpperSet_preimage_coe (hs : IsLowerSet s) :
    IsUpperSet ((↑) ⁻¹' t : Set s) ↔ ∀ b ∈ s, ∀ c ∈ t, c ≤ b → b ∈ t

{α : Type u_1}
[LE α]
{s t : Set α}
(hs : IsLowerSet s)

IsUpperSet (Subtype.val ⁻¹' t) ↔ ∀ b ∈ s, ∀ c ∈ t, c ≤ b → b ∈ t


theorem strictConvex_iff_openSegment_subset :
    StrictConvex 𝕜 s ↔ s.Pairwise fun x y => openSegment 𝕜 x y ⊆ interior s

{𝕜 : Type u_1}
{E : Type u_3}
[OrderedSemiring 𝕜]
[TopologicalSpace E]
[AddCommMonoid E]
[SMul 𝕜 E]
{s : Set E}


@[simp]
theorem leadingCoeff_of_b_ne_zero (ha : P.a = 0) (hb : P.b ≠ 0) : P.toPoly.leadingCoeff = P.b

{R : Type u_1}
{P : Cubic R}
[Semiring R]
(ha : P.a = 0)
(hb : P.b ≠ 0)


@[to_additive]
theorem le_of_forall_one_lt_div_le (h : ∀ ε : α, 1 < ε → a / ε ≤ b) : a ≤ b

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


theorem remainder_vars (n : ℕ) : (remainder p n).vars ⊆ univ ×ˢ range (n + 1)

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

(WittVector.remainder p n).vars ⊆ Finset.univ ×ˢ Finset.range (n + 1)


theorem ne' [Preorder α] {x y : α} (h : x < y) : y ≠ x

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


theorem norm_star_mul_self {x : E} : ‖x⋆ * x‖ = ‖x‖ * ‖x‖

{E : Type u_2}
[NonUnitalNormedRing E]
[StarRing E]
[CstarRing E]
{x : E}

‖x⋆ * x‖ = ‖x‖ * ‖x‖


theorem differentiable_cosh : Differentiable ℂ cosh


theorem stoppedValue_stoppedProcess {u : ι → Ω → β} {τ σ : Ω → ι} :
    stoppedValue (stoppedProcess u τ) σ = stoppedValue u fun ω => min (σ ω) (τ ω)

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
[LinearOrder ι]
{u : ι → Ω → β}
{τ σ : Ω → ι}

MeasureTheory.stoppedValue (MeasureTheory.stoppedProcess u τ) σ = MeasureTheory.stoppedValue u fun ω => min (σ ω) (τ ω)


@[to_additive (attr := simp)]
theorem mem_toSubmonoid (K : Subgroup G) (x : G) : x ∈ K.toSubmonoid ↔ x ∈ K

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


theorem toDirectSum_tensorPower_tprod {n} (x : Fin n → M) :
    toDirectSum (tprod R M n x) = DirectSum.of _ n (PiTensorProduct.tprod R x)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{n : ℕ}
(x : Fin n → M)

TensorAlgebra.toDirectSum ((TensorAlgebra.tprod R M n) x) =
  (DirectSum.of (fun i => ⨂[R]^i M) n) ((PiTensorProduct.tprod R) x)


@[simp]
theorem id_comp (f : α →ᵈ β) : (Dilation.id β).comp f = f

{α : Type u_1}
{β : Type u_2}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(f : α →ᵈ β)


@[simp]
theorem closure_empty : closure (∅ : Set R) = ⊥


@[to_additive]
theorem smul_set_subset_iff : a • s ⊆ t ↔ ∀ ⦃b⦄, b ∈ s → a • b ∈ t

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{s t : Set β}
{a : α}

a +ᵥ s ⊆ t ↔ ∀ ⦃b : β⦄, b ∈ s → a +ᵥ b ∈ t


lemma ltTrichotomy_ne (h : x ≠ y) :
    ltTrichotomy x y p q r = if x < y then p else r

{α : Type u_2}
[LinearOrder α]
{P : Sort u_5}
{x y : α}
{p q r : P}
(h : x ≠ y)


@[simp]
theorem Pi.sdiff_apply [∀ i, SDiff (π i)] (x y : ∀ i, π i) (i : ι) :
    (x \ y) i = x i \ y i

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


theorem ext_iff {f g : M ↪[L] N} : f = g ↔ ∀ x, f x = g x

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
{f g : L.Embedding M N}


theorem Metric.cobounded_eq_cocompact [ProperSpace α] : cobounded α = cocompact α

{α : Type u}
[PseudoMetricSpace α]
[ProperSpace α]

Bornology.cobounded α = Filter.cocompact α


theorem IsMaximal.iso_refl {x y : X} (h : IsMaximal x y) : Iso (x, y) (x, y)

{X : Type u}
[Lattice X]
[JordanHolderLattice X]
{x y : X}
(h : JordanHolderLattice.IsMaximal x y)


private theorem coprime_sq_sub_mul {m n : ℤ} (h : Int.gcd m n = 1)
    (hmn : m % 2 = 0 ∧ n % 2 = 1 ∨ m % 2 = 1 ∧ n % 2 = 0) :
    Int.gcd (m ^ 2 - n ^ 2) (2 * m * n) = 1


@[simp]
theorem map_add_int (x : ℝ) (m : ℤ) : f (x + m) = f x + m


/-- A ring homomorphism `f : R →+* S` is flat if `S` is flat as an `R` algebra. -/
class RingHom.Flat {R : Type u} {S : Type v} [CommRing R] [CommRing S] (f : R →+* S) : Prop where
  out : f.toAlgebra.Flat := by infer_instance

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
{f : R →+* S}
[self : f.Flat]


@[reassoc] -- Porting note (#10618): simp can prove this, removed attribute
theorem π_desc (W : C) (k : ∀ b, I.right b ⟶ W)
    (h : ∀ a, I.fst a ≫ k (I.fstFrom a) = I.snd a ≫ k (I.sndFrom a)) (b) :
    Multicoequalizer.π I b ≫ Multicoequalizer.desc I _ k h = k _

(I : CategoryTheory.Limits.MultispanIndex C)

(h :
  ∀ (a : I.L),
    CategoryTheory.CategoryStruct.comp (I.fst a) (k (I.fstFrom a)) =
      CategoryTheory.CategoryStruct.comp (I.snd a) (k (I.sndFrom a)))

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.Multicoequalizer.π I b)
    (CategoryTheory.Limits.Multicoequalizer.desc I W k h) =
  k b


theorem uniformEquicontinuous_iInf_rng {u : κ → UniformSpace α'} {F : ι → β → α'} :
    UniformEquicontinuous (uα := ⨅ k, u k) F ↔ ∀ k, UniformEquicontinuous (uα := u k) F

{ι : Type u_1}
{κ : Type u_2}
{α' : Type u_8}
{β : Type u_9}
[uβ : UniformSpace β]
{u : κ → UniformSpace α'}
{F : ι → β → α'}

UniformEquicontinuous F ↔ ∀ (k : κ), UniformEquicontinuous F


@[simp]
theorem selfZPow_natCast (d : ℕ) : selfZPow x B d = algebraMap R B x ^ d

{R : Type u_1}
[CommRing R]
(x : R)
(B : Type u_2)
[CommRing B]
[Algebra R B]
[IsLocalization.Away x B]
(d : ℕ)

selfZPow x B ↑d = (algebraMap R B) x ^ d


@[simp]
theorem coeAddMonoidHom_of {M S : Type*} [DecidableEq ι] [AddCommMonoid M] [SetLike S M]
    [AddSubmonoidClass S M] (A : ι → S) (i : ι) (x : A i) :
    DirectSum.coeAddMonoidHom A (of (fun i => A i) i x) = x

{ι : Type v}
{M : Type u_1}
{S : Type u_2}
[DecidableEq ι]
[AddCommMonoid M]
[SetLike S M]
[AddSubmonoidClass S M]
(A : ι → S)
(i : ι)
(x : ↥(A i))

(DirectSum.coeAddMonoidHom A) ((DirectSum.of (fun i => ↥(A i)) i) x) = ↑x


theorem mul_sub_div (x n p : Nat) (h₁ : x < n*p) : (n * p - (x + 1)) / n = p - ((x / n) + 1)


@[fun_prop]
theorem hasFDerivAt_update (x : ∀ i, E i) {i : ι} (y : E i) :
    HasFDerivAt (Function.update x i) (.pi (Pi.single i (.id 𝕜 (E i)))) y

{𝕜 : Type u_1}
{ι : Type u_2}
[DecidableEq ι]
[Fintype ι]
[NontriviallyNormedField 𝕜]
{E : ι → Type u_3}
[(i : ι) → NormedAddCommGroup (E i)]
[(i : ι) → NormedSpace 𝕜 (E i)]
(x : (i : ι) → E i)
{i : ι}
(y : E i)

HasFDerivAt (Function.update x i) (ContinuousLinearMap.pi (Pi.single i (ContinuousLinearMap.id 𝕜 (E i)))) y


lemma dens_ne_zero : dens s ≠ 0 ↔ s.Nonempty

{α : Type u_2}
[Fintype α]
{s : Finset α}


theorem nfpBFamily_eq_nfpFamily {o : Ordinal} (f : ∀ b < o, Ordinal → Ordinal) :
    nfpBFamily.{u, v} o f = nfpFamily.{u, v} (familyOfBFamily o f)

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

o.nfpBFamily f = Ordinal.nfpFamily (o.familyOfBFamily f)


theorem add_lf_add_of_lf_of_le {w x y z : PGame} (hwx : w ⧏ x) (hyz : y ≤ z) : w + y ⧏ x + z

{w x y z : SetTheory.PGame}
(hwx : w.LF x)
(hyz : y ≤ z)


theorem normalCore_idempotent (H : Subgroup G) : H.normalCore.normalCore = H.normalCore

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


theorem equivMapDomain_trans (f : α ≃ β) (g : β ≃ γ) (l : α →₀ M) :
    equivMapDomain (f.trans g) l = equivMapDomain g (equivMapDomain f l)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{M : Type u_5}
[Zero M]
(f : α ≃ β)
(g : β ≃ γ)
(l : α →₀ M)

Finsupp.equivMapDomain (f.trans g) l = Finsupp.equivMapDomain g (Finsupp.equivMapDomain f l)


theorem hasDerivAt_iff_tendsto_slope_zero :
    HasDerivAt f f' x ↔ Tendsto (fun t ↦ t⁻¹ • (f (x + t) - f x)) (𝓝[≠] 0) (𝓝 f')

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

HasDerivAt f f' x ↔ Filter.Tendsto (fun t => t⁻¹ • (f (x + t) - f x)) (𝓝[≠] 0) (𝓝 f')


/-- An `EquivFunctor` is only functorial with respect to equivalences.

To construct an `EquivFunctor`, it suffices to supply just the function `f α → f β` from
an equivalence `α ≃ β`, and then prove the functor laws. It's then a consequence that
this function is part of an equivalence, provided by `EquivFunctor.mapEquiv`.
-/
class EquivFunctor (f : Type u₀ → Type u₁) where
  /-- The action of `f` on isomorphisms. -/
  map : ∀ {α β}, α ≃ β → f α → f β
  /-- `map` of `f` preserves the identity morphism. -/
  map_refl' : ∀ α, map (Equiv.refl α) = @id (f α) := by rfl
  /-- `map` is functorial on equivalences. -/
  map_trans' : ∀ {α β γ} (k : α ≃ β) (h : β ≃ γ), map (k.trans h) = map h ∘ map k := by rfl

{f : Type u₀ → Type u₁}
[self : EquivFunctor f]
(α : Type u₀)


/-- A functor `F : C ⥤ D` sends isomorphisms `i : X ≅ Y` to isomorphisms `F.obj X ≅ F.obj Y` -/
@[simps]
def mapIso (F : C ⥤ D) {X Y : C} (i : X ≅ Y) : F.obj X ≅ F.obj Y

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


theorem smul_inf_le [SMul M α] [SemilatticeInf α] [CovariantClass M α HSMul.hSMul LE.le]
    (m : M) (a₁ a₂ : α) : m • (a₁ ⊓ a₂) ≤ m • a₁ ⊓ m • a₂

{M : Type u_2}
{α : Type u_3}
[SMul M α]
[SemilatticeInf α]
[CovariantClass M α HSMul.hSMul LE.le]
(m : M)
(a₁ a₂ : α)

m • (a₁ ⊓ a₂) ≤ m • a₁ ⊓ m • a₂


theorem bind_congr {f g : α → Option β} {x : Option α}
    (h : ∀ a ∈ x, f a = g a) : x.bind f = x.bind g

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


@[simp]
theorem image_const_sub_Ico : (fun x => a - x) '' Ico b c = Ioc (a - c) (a - b)

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

(fun x => a - x) '' Set.Ico b c = Set.Ioc (a - c) (a - b)


theorem zero_apply [Zero β] : (0 : C₀(α, β)) x = 0

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
(x : α)
[Zero β]


@[to_additive]
theorem Continuous.units_map [Monoid M] [Monoid N] [TopologicalSpace M] [TopologicalSpace N]
    (f : M →* N) (hf : Continuous f) : Continuous (Units.map f)

{M : Type u_3}
{N : Type u_4}
[AddMonoid M]
[AddMonoid N]
[TopologicalSpace M]
[TopologicalSpace N]
(f : M →+ N)
(hf : Continuous ⇑f)


protected theorem map_mul (x y : R) : abv (x * y) = abv x * abv y

{R : Type u_5}
{S : Type u_6}
[Semiring R]
[OrderedSemiring S]
(abv : AbsoluteValue R S)
(x y : R)


theorem range_eq {α β} (f : Option α → β) : range f = insert (f none) (range (f ∘ some))

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

Set.range f = insert (f none) (Set.range (f ∘ some))


@[to_additive]
lemma smul_left_cancel (g : α) {x y : β} (h : g • x = g • y) : x = y

{α : Type u_1}
{β : Type u_2}
[Group α]
[MulAction α β]
(g : α)
{x y : β}
(h : g • x = g • y)


@[to_additive (attr := simp (default + 1))]
lemma sup_mul_le [SemilatticeSup β] [OrderBot β] {s t : Finset α} {f : α → β} {a : β} :
    sup (s * t) f ≤ a ↔ ∀ x ∈ s, ∀ y ∈ t, f (x * y) ≤ a

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[Add α]
[SemilatticeSup β]
[OrderBot β]
{s t : Finset α}
{f : α → β}
{a : β}

(s + t).sup f ≤ a ↔ ∀ x ∈ s, ∀ y ∈ t, f (x + y) ≤ a


theorem IsBlock.preimage {H Y : Type*} [Group H] [MulAction H Y]
    {φ : H → G} (j : Y →ₑ[φ] X) {B : Set X} (hB : IsBlock G B) :
    IsBlock H (j ⁻¹' B)

{G : Type u_1}
[Group G]
{X : Type u_2}
[MulAction G X]
{H : Type u_3}
{Y : Type u_4}
[Group H]
[MulAction H Y]
{φ : H → G}
(j : Y →ₑ[φ] X)
{B : Set X}
(hB : MulAction.IsBlock G B)


lemma MapsTo.comp_right {s : Set β} {t : Set γ} (hg : MapsTo g s t) (f : α → β) :
    MapsTo (g ∘ f) (f ⁻¹' s) t

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{g : β → γ}
{s : Set β}
{t : Set γ}
(hg : Set.MapsTo g s t)
(f : α → β)


/-- A set is called a neighborhood of `x` if it contains an open set around `x`. The set of all
neighborhoods of `x` forms a filter, the neighborhood filter at `x`, is here defined as the
infimum over the principal filters of all open sets containing `x`. -/
irreducible_def nhds (x : X) : Filter X

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


theorem foldlM_eq_foldlM_data.aux [Monad m]
    (f : β → α → m β) (arr : Array α) (i j) (H : arr.size ≤ i + j) (b) :
    foldlM.loop f arr arr.size (Nat.le_refl _) i j b = (arr.data.drop j).foldlM f b

{m : Type u_1 → Type u_2}
{β : Type u_1}
{α : Type u_3}
[Monad m]
(f : β → α → m β)
(arr : Array α)
(i j : Nat)
(H : arr.size ≤ i + j)
(b : β)

Array.foldlM.loop f arr arr.size ⋯ i j b = List.foldlM f b (List.drop j arr.data)


@[simp, norm_cast]
theorem lift_add : (↑(X + Y) : Derivation 𝕜 C^∞⟮I, G; 𝕜⟯ C^∞⟮I, G; 𝕜⟯) = X + Y

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Monoid G]
[SmoothMul I G]
(X Y : LeftInvariantDerivation I G)


@[simp]
theorem dvd_mul_right (a b : α) : a ∣ a * b


@[to_additive]
theorem smul_subset_iff : s • t ⊆ u ↔ ∀ a ∈ s, ∀ b ∈ t, a • b ∈ u

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

s +ᵥ t ⊆ u ↔ ∀ a ∈ s, ∀ b ∈ t, a +ᵥ b ∈ u


/-- Converts identity in the category of groupoids to the functor identity -/
theorem id_to_functor {C : Grpd.{v, u}} : 𝟭 C = 𝟙 C

CategoryTheory.Functor.id ↑C = CategoryTheory.CategoryStruct.id C


theorem eq_castSucc_or_eq_last {n : Nat} (i : Fin (n + 1)) :
    (∃ j : Fin n, i = j.castSucc) ∨ i = last n


/-- **Phragmen-Lindelöf principle** in the fourth quadrant. Let `f : ℂ → E` be a function such that

* `f` is differentiable in the open fourth quadrant and is continuous on its closure;
* `‖f z‖` is bounded from above by `A * exp(B * (abs z) ^ c)` on the open fourth quadrant
  for some `c < 2`;
* `‖f z‖` is bounded from above by a constant `C` on the boundary of the fourth quadrant.

Then `‖f z‖` is bounded from above by the same constant on the closed fourth quadrant. -/
theorem quadrant_IV (hd : DiffContOnCl ℂ f (Ioi 0 ×ℂ Iio 0))
    (hB : ∃ c < (2 : ℝ), ∃ B,
      f =O[cobounded ℂ ⊓ 𝓟 (Ioi 0 ×ℂ Iio 0)] fun z => expR (B * abs z ^ c))
    (hre : ∀ x : ℝ, 0 ≤ x → ‖f x‖ ≤ C) (him : ∀ x : ℝ, x ≤ 0 → ‖f (x * I)‖ ≤ C) (hz_re : 0 ≤ z.re)
    (hz_im : z.im ≤ 0) : ‖f z‖ ≤ C

(hd : DiffContOnCl ℂ f (Set.Ioi 0 ×ℂ Set.Iio 0))

(hB : ∃ c < 2, ∃ B, f =O[Bornology.cobounded ℂ ⊓ 𝓟 (Set.Ioi 0 ×ℂ Set.Iio 0)] fun z => expR (B * Complex.abs z ^ c))

(him : ∀ x ≤ 0, ‖f (↑x * Complex.I)‖ ≤ C)


theorem trunc_succ (f : R⟦X⟧) (n : ℕ) :
    trunc n.succ f = trunc n f + Polynomial.monomial n (coeff R n f)

{R : Type u_1}
[Semiring R]
(f : PowerSeries R)
(n : ℕ)

PowerSeries.trunc n.succ f = PowerSeries.trunc n f + (Polynomial.monomial n) ((PowerSeries.coeff R n) f)


theorem mul_lt_mul_of_le_of_lt_of_pos_of_nonneg [PosMulStrictMono α] [MulPosMono α]
    (h₁ : a ≤ b) (h₂ : c < d) (a0 : 0 < a) (d0 : 0 ≤ d) : a * c < b * d

{α : Type u_1}
{a b c d : α}
[Mul α]
[Zero α]
[Preorder α]
[PosMulStrictMono α]
[MulPosMono α]
(h₁ : a ≤ b)
(h₂ : c < d)
(a0 : 0 < a)
(d0 : 0 ≤ d)


lemma eq_top_of_isAtom (I : LieIdeal R L) (hI : IsAtom I) : I = ⊤

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsSimple R L]
(I : LieIdeal R L)
(hI : IsAtom I)


@[simp]
theorem insert_diff_of_mem (s) (h : a ∈ t) : insert a s \ t = s \ t

{α : Type u}
{a : α}
{t : Set α}
(s : Set α)
(h : a ∈ t)


theorem HasBasis.sup {ι ι' : Type*} {p : ι → Prop} {s : ι → Set α} {p' : ι' → Prop}
    {s' : ι' → Set α} (hl : l.HasBasis p s) (hl' : l'.HasBasis p' s') :
    (l ⊔ l').HasBasis (fun i : ι × ι' => p i.1 ∧ p' i.2) fun i => s i.1 ∪ s' i.2

{α : Type u_1}
{l l' : Filter α}
{ι : Type u_6}
{ι' : Type u_7}
{p : ι → Prop}
{s : ι → Set α}
{p' : ι' → Prop}
{s' : ι' → Set α}
(hl : l.HasBasis p s)
(hl' : l'.HasBasis p' s')

(l ⊔ l').HasBasis (fun i => p i.1 ∧ p' i.2) fun i => s i.1 ∪ s' i.2


@[to_additive]
theorem Step.append_right : ∀ {L₁ L₂ L₃ : List (α × Bool)}, Step L₁ L₂ → Step (L₁ ++ L₃) (L₂ ++ L₃)

{α : Type u}
{L₁ L₂ L₃ : List (α × Bool)}

FreeAddGroup.Red.Step L₁ L₂ → FreeAddGroup.Red.Step (L₁ ++ L₃) (L₂ ++ L₃)


@[simp]
theorem quasispectrum.preimage_algebraMap (S : Type*) {R A : Type*} [Semifield R] [Field S]
    [NonUnitalRing A] [Algebra R S] [Module S A] [IsScalarTower S A A]
    [SMulCommClass S A A] [Module R A] [IsScalarTower R S A] {a : A} :
    algebraMap R S ⁻¹' quasispectrum S a = quasispectrum R a

(S : Type u_3)
{R : Type u_4}
{A : Type u_5}
[Semifield R]
[Field S]
[NonUnitalRing A]
[Algebra R S]
[Module S A]
[IsScalarTower S A A]
[SMulCommClass S A A]
[Module R A]
[IsScalarTower R S A]
{a : A}

⇑(algebraMap R S) ⁻¹' quasispectrum S a = quasispectrum R a


theorem SigmaFinite.out (h : SigmaFinite μ) : Nonempty (μ.FiniteSpanningSetsIn univ)

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(h : MeasureTheory.SigmaFinite μ)


theorem mem_merge_left (s : α → α → Bool) (h : x ∈ l) : x ∈ merge s l r

{α : Type u_1}
{x : α}
{l r : List α}
(s : α → α → Bool)
(h : x ∈ l)


protected theorem le_trans {a b c : Int} (h₁ : a ≤ b) (h₂ : b ≤ c) : a ≤ c


@[refl]
protected theorem Equiv.refl : ∀ x, Equiv x x


@[simp] lemma toLawson_ofLawson (a : WithLawson α) : toLawson (ofLawson a) = a

{α : Type u_1}
(a : Topology.WithLawson α)

Topology.WithLawson.toLawson (Topology.WithLawson.ofLawson a) = a


/-- The following statements are equivalent:

0. `s` is a neighborhood of `b` within `(-∞, b]`
1. `s` is a neighborhood of `b` within `[a, b]`
2. `s` is a neighborhood of `b` within `(a, b]`
3. `s` includes `(l, b]` for some `l ∈ [a, b)`
4. `s` includes `(l, b]` for some `l < b` -/
theorem TFAE_mem_nhdsWithin_Iic {a b : α} (h : a < b) (s : Set α) :
    TFAE [s ∈ 𝓝[≤] b,-- 0 : `s` is a neighborhood of `b` within `(-∞, b]`
      s ∈ 𝓝[Icc a b] b,-- 1 : `s` is a neighborhood of `b` within `[a, b]`
      s ∈ 𝓝[Ioc a b] b,-- 2 : `s` is a neighborhood of `b` within `(a, b]`
      ∃ l ∈ Ico a b, Ioc l b ⊆ s,-- 3 : `s` includes `(l, b]` for some `l ∈ [a, b)`
      ∃ l ∈ Iio b, Ioc l b ⊆ s]

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a b : α}
(h : a < b)
(s : Set α)

[s ∈ 𝓝[≤] b, s ∈ 𝓝[Set.Icc a b] b, s ∈ 𝓝[Set.Ioc a b] b, ∃ l ∈ Set.Ico a b, Set.Ioc l b ⊆ s,
    ∃ l ∈ Set.Iio b, Set.Ioc l b ⊆ s].TFAE


@[simp] theorem op_reverse (x : CliffordAlgebra Q) : op (reverse x) = reverseOp x

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

MulOpposite.op (CliffordAlgebra.reverse x) = CliffordAlgebra.reverseOp x


theorem coeff_eq_zero_of_totalDegree_lt {f : MvPolynomial σ R} {d : σ →₀ ℕ}
    (h : f.totalDegree < ∑ i ∈ d.support, d i) : coeff d f = 0

{d : σ →₀ ℕ}


/-- The tuple `(1)_v` is a finite adèle. -/
theorem one : (1 : K_hat R K).IsFiniteAdele

{R : Type u_1}
{K : Type u_2}
[CommRing R]
[IsDedekindDomain R]
[Field K]
[Algebra R K]
[IsFractionRing R K]


@[simp] lemma nilpotencyClass_eq_one [Nontrivial R] :
    nilpotencyClass x = 1 ↔ x = 0

{R : Type u_1}
{x : R}
[MonoidWithZero R]
[Nontrivial R]


@[simp]
theorem default_coe_singleton (x : α) : (default : ({x} : Set α)) = ⟨x, rfl⟩


theorem IndepSets.indep' {_mΩ : MeasurableSpace Ω}
    {κ : Kernel α Ω} {μ : Measure α} [IsMarkovKernel κ]
    {p1 p2 : Set (Set Ω)} (hp1m : ∀ s ∈ p1, MeasurableSet s) (hp2m : ∀ s ∈ p2, MeasurableSet s)
    (hp1 : IsPiSystem p1) (hp2 : IsPiSystem p2) (hyp : IndepSets p1 p2 κ μ) :
    Indep (generateFrom p1) (generateFrom p2) κ μ

(hyp : ProbabilityTheory.Kernel.IndepSets p1 p2 κ μ)

ProbabilityTheory.Kernel.Indep (MeasurableSpace.generateFrom p1) (MeasurableSpace.generateFrom p2) κ μ


@[simp]
theorem sigmaCongrRight_one {α : Type*} {β : α → Type*} :
    sigmaCongrRight (1 : ∀ a, Equiv.Perm <| β a) = 1


theorem induced_orderTopology {α : Type u} {β : Type v} [Preorder α] [ta : TopologicalSpace β]
    [Preorder β] [OrderTopology β] (f : α → β) (hf : ∀ {x y}, f x < f y ↔ x < y)
    (H : ∀ {x y}, x < y → ∃ a, x < f a ∧ f a < y) : @OrderTopology _ (induced f ta) _

(H : ∀ {x y : β}, x < y → ∃ a, x < f a ∧ f a < y)


/-- `PiTensorProduct.tprod` as a `MonoidHom`. -/
@[simps]
def tprodMonoidHom : (Π i, A i) →* ⨂[R] i, A i

[∀ (i : ι), SMulCommClass R (A i) (A i)]

[∀ (i : ι), IsScalarTower R (A i) (A i)]

(PiTensorProduct.tprodMonoidHom R) a = (PiTensorProduct.tprod R) a


@[simp] theorem prod_apply (v : OrthonormalBasis ι₁ 𝕜 E) (w : OrthonormalBasis ι₂ 𝕜 F) :
    ∀ i : ι₁ ⊕ ι₂, v.prod w i =
      Sum.elim ((LinearMap.inl 𝕜 E F) ∘ v) ((LinearMap.inr 𝕜 E F) ∘ w) i

{𝕜 : Type u_1}
{ι₁ : Type u_2}
{ι₂ : Type u_3}
{E : Type u_4}
{F : Type u_5}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[Fintype ι₁]
[Fintype ι₂]
(v : OrthonormalBasis ι₁ 𝕜 E)
(w : OrthonormalBasis ι₂ 𝕜 F)
(i : ι₁ ⊕ ι₂)

(v.prod w) i = Sum.elim (⇑(LinearMap.inl 𝕜 E F) ∘ ⇑v) (⇑(LinearMap.inr 𝕜 E F) ∘ ⇑w) i


@[simp] theorem map_append (f : α → β) : ∀ l₁ l₂, map f (l₁ ++ l₂) = map f l₁ ++ map f l₂

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(l₁ l₂ : List α)

List.map f (l₁ ++ l₂) = List.map f l₁ ++ List.map f l₂


protected theorem injective : Injective e

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


theorem reaches₁_fwd {σ} {f : σ → Option σ} {a b c} (h₁ : Reaches₁ f a c) (h₂ : b ∈ f a) :
    Reaches f b c

{σ : Type u_1}
{f : σ → Option σ}
{a b c : σ}
(h₁ : Turing.Reaches₁ f a c)
(h₂ : b ∈ f a)


/-- Identity isomorphism. -/
@[refl, simps]
def refl (X : C) : X ≅ X

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

(CategoryTheory.Iso.refl X).inv = CategoryTheory.CategoryStruct.id X


@[to_additive card_le_one_iff_eq_bot]
theorem card_le_one_iff_eq_bot : card S ≤ 1 ↔ S = ⊥

{M : Type u_1}
[Monoid M]
{S : Submonoid M}
[Fintype ↥S]


theorem down (f : r ≺i s) : ∀ {b : β}, s b f.top ↔ ∃ a, f a = b

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(f : r ≺i s)
{b : β}


@[elab_as_elim]
theorem induction_on {x y : A}
    (hy : y ∈ elementalStarAlgebra R x) {P : (u : A) → u ∈ elementalStarAlgebra R x → Prop}
    (self : P x (self_mem R x)) (star_self : P (star x) (star_self_mem R x))
    (algebraMap : ∀ r, P (algebraMap R A r) (_root_.algebraMap_mem _ r))
    (add : ∀ u hu v hv, P u hu → P v hv → P (u + v) (add_mem hu hv))
    (mul : ∀ u hu v hv, P u hu → P v hv → P (u * v) (mul_mem hu hv))
    (closure : ∀ s : Set A, (hs : s ⊆ elementalStarAlgebra R x) → (∀ u, (hu : u ∈ s) →
      P u (hs hu)) → ∀ v, (hv : v ∈ closure s) → P v (closure_minimal hs (isClosed R x) hv)) :
    P y hy

(algebraMap : ∀ (r : R), P ((algebraMap R A) r) ⋯)

(add :
  ∀ (u : A) (hu : u ∈ elementalStarAlgebra R x) (v : A) (hv : v ∈ elementalStarAlgebra R x),
    P u hu → P v hv → P (u + v) ⋯)

(mul :
  ∀ (u : A) (hu : u ∈ elementalStarAlgebra R x) (v : A) (hv : v ∈ elementalStarAlgebra R x),
    P u hu → P v hv → P (u * v) ⋯)

(closure :
  ∀ (s : Set A) (hs : s ⊆ ↑(elementalStarAlgebra R x)),
    (∀ (u : A) (hu : u ∈ s), P u ⋯) → ∀ (v : A) (hv : v ∈ closure s), P v ⋯)


theorem sub_eq_add' : HSub.hSub = ((· + ·) : R → R → R)


@[simp] theorem down_bot [Bot α] : down (⊥ : ULift α) = ⊥


lemma image2_range (f : α' → β' → γ) (g : α → α') (h : β → β') :
    image2 f (range g) (range h) = range fun x : α × β ↦ f (g x.1) (h x.2)

{α : Type u_1}
{α' : Type u_2}
{β : Type u_3}
{β' : Type u_4}
{γ : Type u_5}
(f : α' → β' → γ)
(g : α → α')
(h : β → β')

Set.image2 f (Set.range g) (Set.range h) = Set.range fun x => f (g x.1) (h x.2)


theorem residue_eq_zero_iff_sMod_eq_zero (p : ℕ) (w : 1 < p) :
    lucasLehmerResidue p = 0 ↔ sMod p (p - 2) = 0

lucasLehmerResidue p = 0 ↔ LucasLehmer.sMod p (p - 2) = 0


/-- Same as `moveLeft_lt`, but for `Surreal` instead of `PGame` -/
theorem mk_moveLeft_lt_mk {x : PGame} (o : Numeric x) (i) :
    Surreal.mk (x.moveLeft i) (Numeric.moveLeft o i) < Surreal.mk x o

{x : SetTheory.PGame}
(o : x.Numeric)
(i : x.LeftMoves)

Surreal.mk (x.moveLeft i) ⋯ < Surreal.mk x o


@[simp]
theorem map_copy (hu : u = u') (hv : v = v') :
    (p.copy hu hv).map f = (p.map f).copy (hu ▸ rfl) (hv ▸ rfl)

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

SimpleGraph.Walk.map f (p.copy hu hv) = (SimpleGraph.Walk.map f p).copy ⋯ ⋯


theorem TopologicalSpace.Clopens.exists_prod_subset (W : Clopens (X × Y)) {a : X × Y} (h : a ∈ W) :
    ∃ U : Clopens X, a.1 ∈ U ∧ ∃ V : Clopens Y, a.2 ∈ V ∧ U ×ˢ V ≤ W

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[CompactSpace Y]
(W : TopologicalSpace.Clopens (X × Y))
{a : X × Y}
(h : a ∈ W)

∃ U, a.1 ∈ U ∧ ∃ V, a.2 ∈ V ∧ U ×ˢ V ≤ W


/-- An open map `f : X ⟶ Y` induces a functor `Opens X ⥤ Opens Y`.
-/
@[simps obj_coe]
def IsOpenMap.functor {X Y : TopCat} {f : X ⟶ Y} (hf : IsOpenMap f) : Opens X ⥤ Opens Y

{X Y : TopCat}
{f : X ⟶ Y}
(hf : IsOpenMap ⇑f)
(U : TopologicalSpace.Opens ↑X)


/-- Two products which differ by an equivalence in the indexing type,
and up to isomorphism in the factors, are isomorphic.
-/
@[simps]
def Pi.whiskerEquiv {J K : Type*} {f : J → C} {g : K → C} (e : J ≃ K) (w : ∀ j, g (e j) ≅ f j)
    [HasProduct f] [HasProduct g] : ∏ᶜ f ≅ ∏ᶜ g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{J : Type u_1}
{K : Type u_2}
{f : J → C}
{g : K → C}
(e : J ≃ K)
(w : (j : J) → g (e j) ≅ f j)
[CategoryTheory.Limits.HasProduct f]
[CategoryTheory.Limits.HasProduct g]

(CategoryTheory.Limits.Pi.whiskerEquiv e w).inv = CategoryTheory.Limits.Pi.map' ⇑e fun j => (w j).hom


@[simp]
theorem inverseAssociator_map_inr_inr {X Y : E} (f : inr (inr X) ⟶ inr (inr Y)) :
    (inverseAssociator C D E).map f = f

(f : Sum.inr (Sum.inr X) ⟶ Sum.inr (Sum.inr Y))

(CategoryTheory.sum.inverseAssociator C D E).map f = f


@[to_additive]
theorem dist_mulIndicator (s t : Set α) (f : α → E) (x : α) :
    dist (s.mulIndicator f x) (t.mulIndicator f x) = ‖(s ∆ t).mulIndicator f x‖

{α : Type u_3}
{E : Type u_6}
[SeminormedGroup E]
(s t : Set α)
(f : α → E)
(x : α)

dist (s.mulIndicator f x) (t.mulIndicator f x) = ‖(symmDiff s t).mulIndicator f x‖


/-- Convert a `BinaryBicone` into a `Bicone` over a pair. -/
@[simps]
def toBiconeFunctor {X Y : C} : BinaryBicone X Y ⥤ Bicone (pairFunction X Y)

(b : CategoryTheory.Limits.BinaryBicone X Y)

(CategoryTheory.Limits.BinaryBicone.toBiconeFunctor.obj b).ι j = CategoryTheory.Limits.WalkingPair.casesOn j b.inl b.inr


lemma eq_induced : haveI := F.reflects_preregular
    regularTopology C =
      F.inducedTopology (regularTopology _)

CategoryTheory.regularTopology C = F.inducedTopology (CategoryTheory.regularTopology D)


theorem liftR_iff {α : TypeVec n} (r : ∀ /- ⦃i⦄ -/ {i}, α i → α i → Prop) (x y : F α) :
    LiftR r x y ↔ ∃ a f₀ f₁, x = abs ⟨a, f₀⟩ ∧ y = abs ⟨a, f₁⟩ ∧ ∀ i j, r (f₀ i j) (f₁ i j)

{n : ℕ}
{F : TypeVec.{u} n → Type u_1}
[q : MvQPF F]
{α : TypeVec.{u} n}
(r : {i : Fin2 n} → α i → α i → Prop)
(x y : F α)

MvFunctor.LiftR (fun {i} => r) x y ↔
  ∃ a f₀ f₁, x = MvQPF.abs ⟨a, f₀⟩ ∧ y = MvQPF.abs ⟨a, f₁⟩ ∧ ∀ (i : Fin2 n) (j : (MvQPF.P F).B a i), r (f₀ i j) (f₁ i j)


@[to_additive (attr := mono)]
theorem div_subset_div : s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ / t₁ ⊆ s₂ / t₂

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

s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ - t₁ ⊆ s₂ - t₂


/-- An infinite sum of functions with summable sup norm is the uniform limit of its partial sums.
Version relative to a set, with index set `ℕ`. -/
theorem tendstoUniformlyOn_tsum_nat {f : ℕ → β → F} {u : ℕ → ℝ} (hu : Summable u) {s : Set β}
    (hfu : ∀ n x, x ∈ s → ‖f n x‖ ≤ u n) :
    TendstoUniformlyOn (fun N => fun x => ∑ n ∈ Finset.range N, f n x) (fun x => ∑' n, f n x) atTop
      s

(hfu : ∀ (n : ℕ), ∀ x ∈ s, ‖f n x‖ ≤ u n)

TendstoUniformlyOn (fun N x => ∑ n ∈ Finset.range N, f n x) (fun x => ∑' (n : ℕ), f n x) Filter.atTop s


lemma toHomeomorph_trans (e : X ≃ Y) (f : Y ≃ Z) (he hf) :
    (e.trans f).toHomeomorph (fun _s ↦ (he _).trans (hf _)) =
    (e.toHomeomorph he).trans (f.toHomeomorph hf)

(he : ∀ (s : Set Y), IsOpen (⇑e ⁻¹' s) ↔ IsOpen s)

(hf : ∀ (s : Set Z), IsOpen (⇑f ⁻¹' s) ↔ IsOpen s)

(e.trans f).toHomeomorph ⋯ = (e.toHomeomorph he).trans (f.toHomeomorph hf)


@[simp, norm_cast]
theorem coe_ringHom_mk {f : A →+* B} (h) : ((⟨f, h⟩ : A →ₐ[R] B) : A →+* B) = f

(h : ∀ (r : R), (↑↑f).toFun ((algebraMap R A) r) = (algebraMap R B) r)


theorem mem_center_iff {a : A} : a ∈ center R A ↔ ∀ b : A, b * a = a * b

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
{a : A}

a ∈ NonUnitalSubalgebra.center R A ↔ ∀ (b : A), b * a = a * b


theorem uniqueBaseOn_restrict (h : I ⊆ E) (R : Set α) :
    (uniqueBaseOn I E) ↾ R = uniqueBaseOn (I ∩ R) R

{α : Type u_1}
{E I : Set α}
(h : I ⊆ E)
(R : Set α)

(Matroid.uniqueBaseOn I E).restrict R = Matroid.uniqueBaseOn (I ∩ R) R


@[simp]
theorem Set.Ici.isAtom_iff {b : Set.Ici a} : IsAtom b ↔ a ⋖ b

{α : Type u_2}
[PartialOrder α]
{a : α}
{b : ↑(Set.Ici a)}


/-- An `AddTorsor G P` gives a structure to the nonempty type `P`,
acted on by an `AddGroup G` with a transitive and free action given
by the `+ᵥ` operation and a corresponding subtraction given by the
`-ᵥ` operation. In the case of a vector space, it is an affine
space. -/
class AddTorsor (G : outParam Type*) (P : Type*) [AddGroup G] extends AddAction G P,
  VSub G P where
  [nonempty : Nonempty P]
  /-- Torsor subtraction and addition with the same element cancels out. -/
  vsub_vadd' : ∀ p₁ p₂ : P, (p₁ -ᵥ p₂ : G) +ᵥ p₂ = p₁
  /-- Torsor addition and subtraction with the same element cancels out. -/
  vadd_vsub' : ∀ (g : G) (p : P), g +ᵥ p -ᵥ p = g

{G : outParam (Type u_1)}
{P : Type u_2}
[AddGroup G]
[self : AddTorsor G P]
(g : G)
(p : P)


lemma support_floorDiv_subset : (f ⌊/⌋ a).support ⊆ f.support

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommMonoid α]
[OrderedAddCommMonoid β]
[SMulZeroClass α β]
[FloorDiv α β]
{f : ι →₀ β}
{a : α}


theorem isInt_neg {α} [Ring α] : ∀ {f : α → α} {a : α} {a' b : ℤ},
    f = Neg.neg → IsInt a a' → Int.neg a' = b → IsInt (-a) b

{α : Type u_1}
[Ring α]
{f : α → α}
{a : α}
{a' b : ℤ}

f = Neg.neg → Mathlib.Meta.NormNum.IsInt a a' → a'.neg = b → Mathlib.Meta.NormNum.IsInt (-a) b


theorem sum_lt_lift_of_isRegular {ι : Type u} {f : ι → Cardinal} {c : Cardinal} (hc : IsRegular c)
    (hι : Cardinal.lift.{v, u} #ι < c) (hf : ∀ i, f i < c) : sum f < c

{ι : Type u}
{f : ι → Cardinal.{max u v}}
{c : Cardinal.{max u v}}
(hc : c.IsRegular)
(hι : Cardinal.lift.{v, u} #ι < c)
(hf : ∀ (i : ι), f i < c)


@[simp, norm_cast] lemma cast_le : (p : K) ≤ q ↔ p ≤ q

{p q : ℚ}
{K : Type u_5}
[LinearOrderedField K]

↑p ≤ ↑q ↔ p ≤ q


protected theorem eq_iff {n m : ℝ≥0} : n = m ↔ (n : ℝ) = (m : ℝ)


lemma isTheta_cpow_exp_re_mul_log (hl : IsExpCmpFilter l) (a : ℂ) :
    (· ^ a) =Θ[l] fun z ↦ Real.exp (re a * Real.log (abs z))

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

(fun x => x ^ a) =Θ[l] fun z => Real.exp (a.re * Real.log (Complex.abs z))


theorem preimage_restrictPreimage {u : Set t} :
    t.restrictPreimage f ⁻¹' u = (fun a : f ⁻¹' t ↦ f a) ⁻¹' (Subtype.val '' u)

{α : Type u_1}
{β : Type u_2}
(t : Set β)
{f : α → β}
{u : Set ↑t}

t.restrictPreimage f ⁻¹' u = (fun a => f ↑a) ⁻¹' (Subtype.val '' u)


theorem subtypeVal_toSubtype' {α : TypeVec n} (r : α ⊗ α ⟹ «repeat» n Prop) :
    subtypeVal r ⊚ toSubtype' r = fun i x => prod.mk i x.1.fst x.1.snd

(r : (α.prod α).Arrow (TypeVec.repeat n Prop))

TypeVec.comp (TypeVec.subtypeVal r) (TypeVec.toSubtype' r) = fun i x => TypeVec.prod.mk i (↑x).1 (↑x).2


/-- See also `Finset.prod_boole`. -/
@[to_additive "See also `Finset.sum_boole`."]
theorem prod_ite_one (s : Finset α) (p : α → Prop) [DecidablePred p]
    (h : ∀ i ∈ s, ∀ j ∈ s, p i → p j → i = j) (a : β) :
    ∏ i ∈ s, ite (p i) a 1 = ite (∃ i ∈ s, p i) a 1

(∑ i ∈ s, if p i then a else 0) = if ∃ i ∈ s, p i then a else 0


theorem isPartition_unionComplToSubordinate (π₁ : TaggedPrepartition I) (π₂ : Prepartition I)
    (hU : π₂.iUnion = ↑I \ π₁.iUnion) (r : (ι → ℝ) → Ioi (0 : ℝ)) :
    IsPartition (π₁.unionComplToSubordinate π₂ hU r)

{ι : Type u_1}
[Fintype ι]
{I : BoxIntegral.Box ι}
(π₁ : BoxIntegral.TaggedPrepartition I)
(π₂ : BoxIntegral.Prepartition I)
(hU : π₂.iUnion = ↑I \ π₁.iUnion)
(r : (ι → ℝ) → ↑(Set.Ioi 0))

(π₁.unionComplToSubordinate π₂ hU r).IsPartition


theorem nhds_basis_zero_abs_sub_lt [NoMaxOrder α] :
    (𝓝 (0 : α)).HasBasis (fun ε : α => (0 : α) < ε) fun ε => { b | |b| < ε }

(α : Type u_1)
[TopologicalSpace α]
[LinearOrderedAddCommGroup α]
[OrderTopology α]
[NoMaxOrder α]

(𝓝 0).HasBasis (fun ε => 0 < ε) fun ε => {b | |b| < ε}


theorem mul_boole {α} [MulZeroOneClass α] (P : Prop) [Decidable P] (a : α) :
    (a * if P then 1 else 0) = if P then a else 0

{α : Type u_1}
[MulZeroOneClass α]
(P : Prop)
[Decidable P]
(a : α)


@[simp]
theorem replace_toFinmap (a : α) (b : β a) (s : AList β) :
    replace a b ⟦s⟧ = (⟦s.replace a b⟧ : Finmap β)

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(b : β a)
(s : AList β)

Finmap.replace a b ⟦s⟧ = ⟦AList.replace a b s⟧


@[simp] protected lemma lt_mul_iff_one_lt_right (ha : 0 < a) : a < a * b ↔ 1 < b


@[to_additive]
theorem trivial_eq_closure : trivial G = Group.closure ∅


/-- If the inner product of two vectors is equal to the product of their norms (i.e.,
`⟪x, y⟫ = ‖x‖ * ‖y‖`), then the two vectors are nonnegative real multiples of each other. One form
of the equality case for Cauchy-Schwarz.
Compare `norm_inner_eq_norm_iff`, which takes the weaker hypothesis `abs ⟪x, y⟫ = ‖x‖ * ‖y‖`. -/
theorem inner_eq_norm_mul_iff {x y : E} :
    ⟪x, y⟫ = (‖x‖ : 𝕜) * ‖y‖ ↔ (‖y‖ : 𝕜) • x = (‖x‖ : 𝕜) • y

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{x y : E}

⟪x, y⟫_𝕜 = ↑‖x‖ * ↑‖y‖ ↔ ↑‖y‖ • x = ↑‖x‖ • y


@[simp, nolint simpNF] lemma ofEquiv_inj {a b : Specialization α} : ofEquiv a = ofEquiv b ↔ a = b

Specialization.ofEquiv a = Specialization.ofEquiv b ↔ a = b


@[to_additive]
theorem codisjoint_subgroupOf_sup (H K : Subgroup G) :
    Codisjoint (H.subgroupOf (H ⊔ K)) (K.subgroupOf (H ⊔ K))

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

Codisjoint (H.addSubgroupOf (H ⊔ K)) (K.addSubgroupOf (H ⊔ K))


theorem ne_top_of_le_ne_top (hb : b ≠ ⊤) (hab : a ≤ b) : a ≠ ⊤

{α : Type u}
[PartialOrder α]
[OrderTop α]
{a b : α}
(hb : b ≠ ⊤)
(hab : a ≤ b)


@[simp]
lemma mapsTo_range_iff {g : ι → α} : MapsTo f (range g) t ↔ ∀ i, f (g i) ∈ t

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{t : Set β}
{f : α → β}
{g : ι → α}

Set.MapsTo f (Set.range g) t ↔ ∀ (i : ι), f (g i) ∈ t


@[simp] theorem getElem?_eq_none_iff : l[n]? = none ↔ length l ≤ n

∀ {α : Type u_1} {l : List α} {n : Nat}, l[n]? = none ↔ l.length ≤ n


theorem ContinuousOn.lowerSemicontinuousOn {f : α → γ} (h : ContinuousOn f s) :
    LowerSemicontinuousOn f s

{α : Type u_1}
[TopologicalSpace α]
{s : Set α}
{γ : Type u_3}
[LinearOrder γ]
[TopologicalSpace γ]
[OrderTopology γ]
{f : α → γ}
(h : ContinuousOn f s)


private theorem mul_nonneg_of_nonneg_of_pos [OrderedSemiring α] {a b : α}
    (ha : 0 ≤ a) (hb : 0 < b) : 0 ≤ a * b

{α : Type u_1}
[OrderedSemiring α]
{a b : α}
(ha : 0 ≤ a)
(hb : 0 < b)


@[simp] lemma reverse_mul_X (p : R[X]) : reverse (p * X) = reverse p

{R : Type u_1}
[Semiring R]
(p : Polynomial R)


@[to_additive (attr := simp)]
theorem coe_smul [SMul K β] (c : K) (f : α →ₛ β) : ⇑(c • f) = c • ⇑f

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{K : Type u_5}
[SMul K β]
(c : K)
(f : MeasureTheory.SimpleFunc α β)


@[simp] lemma map_add_right_Ioc (a b c : α) :
    (Ioc a b).map (addRightEmbedding c) = Ioc (a + c) (b + c)

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

Finset.map (addRightEmbedding c) (Finset.Ioc a b) = Finset.Ioc (a + c) (b + c)


@[simp]
theorem ofHom_apply {R : Type u} [CommRing R] {X Y : Type v} [Ring X] [Algebra R X] [Ring Y]
    [Algebra R Y] (f : X →ₐ[R] Y) (x : X) : ofHom f x = f x


/-- If a group has `UniqueProds`, then it actually has `TwoUniqueProds`.
  For an example of a semigroup `G` embeddable into a group that has `UniqueProds`
  but not `TwoUniqueProds`, see Example 10.13 in
  [J. Okniński, *Semigroup Algebras*][Okninski1991]. -/
@[to_additive] theorem toTwoUniqueProds_of_group {G}
    [Group G] [UniqueProds G] : TwoUniqueProds G

{G : Type u_1}
[Group G]
[UniqueProds G]


theorem div_tendsto_atBot_of_degree_gt' (hdeg : Q.degree < P.degree)
    (hneg : P.leadingCoeff / Q.leadingCoeff < 0) :
    Tendsto (fun x => eval x P / eval x Q) atTop atBot

Filter.Tendsto (fun x => Polynomial.eval x P / Polynomial.eval x Q) Filter.atTop Filter.atBot


@[simp]
theorem coe_copy (f : α →ₙ+* β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f'

{α : Type u_2}
{β : Type u_3}
[NonUnitalNonAssocSemiring α]
[NonUnitalNonAssocSemiring β]
(f : α →ₙ+* β)
(f' : α → β)
(h : f' = ⇑f)


theorem nondegenerate_iff_det_ne_zero {B : BilinForm A M₃} (b : Basis ι A M₃) :
    B.Nondegenerate ↔ (BilinForm.toMatrix b B).det ≠ 0

{M₃ : Type u_8}
[AddCommGroup M₃]
{A : Type u_11}
[CommRing A]
[IsDomain A]
[Module A M₃]
{ι : Type u_12}
[DecidableEq ι]
[Fintype ι]
{B : LinearMap.BilinForm A M₃}
(b : Basis ι A M₃)

B.Nondegenerate ↔ ((BilinForm.toMatrix b) B).det ≠ 0


@[to_additive]
theorem Multipliable.multipliable_compl_iff {s : Set β} (hf : Multipliable (f ∘ (↑) : s → α)) :
    Multipliable (f ∘ (↑) : ↑sᶜ → α) ↔ Multipliable f

{α : Type u_1}
{β : Type u_2}
[CommGroup α]
[TopologicalSpace α]
[TopologicalGroup α]
{f : β → α}
{s : Set β}
(hf : Multipliable (f ∘ Subtype.val))

Multipliable (f ∘ Subtype.val) ↔ Multipliable f


lemma not_boundaryGE_next' [e.IsRelIff] {j k : ι} (hj : ¬ e.BoundaryGE j) (hk : c.next j = k) :
    ¬ e.BoundaryGE k

{ι : Type u_1}
{ι' : Type u_2}
{c : ComplexShape ι}
{c' : ComplexShape ι'}
(e : c.Embedding c')
[e.IsRelIff]
{j k : ι}
(hj : ¬e.BoundaryGE j)
(hk : c.next j = k)


lemma add_eq_two_iff : m + n = 2 ↔ m = 0 ∧ n = 2 ∨ m = 1 ∧ n = 1 ∨ m = 2 ∧ n = 0


lemma ae_iff_of_countable [Countable α] {p : α → Prop} : (∀ᵐ x ∂μ, p x) ↔ ∀ x, μ {x} ≠ 0 → p x

{α : Type u_1}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}
[Countable α]
{p : α → Prop}

(∀ᵐ (x : α) ∂μ, p x) ↔ ∀ (x : α), μ {x} ≠ 0 → p x


@[inherit_doc IsLocalization.exists_of_eq]
theorem eq_iff_exists {x y} : algebraMap R S x = algebraMap R S y ↔ ∃ c : M, ↑c * x = ↑c * y

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

(algebraMap R S) x = (algebraMap R S) y ↔ ∃ c, ↑c * x = ↑c * y


@[measurability]
theorem AEMeasurable.const_pow (hg : AEMeasurable g μ) (c : β) :
    AEMeasurable (fun x => c ^ g x) μ

{β : Type u_2}
{γ : Type u_3}
{α : Type u_4}
[MeasurableSpace β]
[MeasurableSpace γ]
[Pow β γ]
[MeasurablePow β γ]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{g : α → γ}
(hg : AEMeasurable g μ)
(c : β)


@[simp]
theorem erase_eq_of_not_mem {a : α} {s : Finset α} (h : a ∉ s) : erase s a = s

{α : Type u_1}
[DecidableEq α]
{a : α}
{s : Finset α}
(h : a ∉ s)


/-- The power basis `1, root f, ..., root f ^ (d - 1)` for `AdjoinRoot f`,
where `f` is an irreducible polynomial over a field of degree `d`. -/
@[simps!]  -- Porting note: was `[simps]`
def powerBasis (hf : f ≠ 0) : PowerBasis K (AdjoinRoot f)

{K : Type w}
[Field K]
{f : K[X]}
(hf : f ≠ 0)

(AdjoinRoot.powerBasis hf).gen = AdjoinRoot.root f


theorem Lcomplement {P : M} (h : IsLprojection X P) : IsLprojection X (1 - P)

{X : Type u_1}
[NormedAddCommGroup X]
{M : Type u_2}
[Ring M]
[Module M X]
{P : M}
(h : IsLprojection X P)


lemma IsOpen.exterior_subset_iff (ht : IsOpen t) : exterior s ⊆ t ↔ s ⊆ t

{α : Type u_3}
[TopologicalSpace α]
{s t : Set α}
(ht : IsOpen t)


theorem MulPosReflectLT.toMulPosReflectLE [MulPosReflectLT α] : MulPosReflectLE α

{α : Type u_1}
[CancelMonoidWithZero α]
[PartialOrder α]
[MulPosReflectLT α]


theorem exists_prime_mul_pow_div_factorial_lt_one [LinearOrderedField K] [FloorRing K]
    (n : ℕ) (a c : K) :
    ∃ p > n, p.Prime ∧ a * c ^ p / (p - 1)! < 1

{K : Type u_1}
[LinearOrderedField K]
[FloorRing K]
(n : ℕ)
(a c : K)

∃ p > n, Nat.Prime p ∧ a * c ^ p / ↑(p - 1).factorial < 1


@[to_additive (attr := simp)]
theorem const_eq_one : const ι a = 1 ↔ a = 1

{ι : Type u_1}
{α : Type u_2}
[Zero α]
[Nonempty ι]
{a : α}


lemma isConnected :
    IsConnected ((TwoSquare.mk Φ.functor (Φ.functor ⋙ L) L (𝟭 _)
      (Functor.rightUnitor _).inv).CostructuredArrowDownwards y)

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)

[∀ (X₂ : C₂), CategoryTheory.IsConnected (Φ.RightResolution X₂)]

CategoryTheory.IsConnected
  ((CategoryTheory.TwoSquare.mk Φ.functor (Φ.functor.comp L) L (CategoryTheory.Functor.id D)
        (Φ.functor.comp L).rightUnitor.inv).CostructuredArrowDownwards
    y)


@[simp]
theorem swap_mem_interedges_iff (hr : Symmetric r) {x : α × α} :
    x.swap ∈ interedges r s t ↔ x ∈ interedges r t s

{α : Type u_4}
{r : α → α → Prop}
[DecidableRel r]
{s t : Finset α}
(hr : Symmetric r)
{x : α × α}

x.swap ∈ Rel.interedges r s t ↔ x ∈ Rel.interedges r t s


@[simp]
theorem continuousWithinAt_Ioo_iff_Iio (h : a < b) :
    ContinuousWithinAt f (Ioo a b) b ↔ ContinuousWithinAt f (Iio b) b

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIicTopology α]
[TopologicalSpace β]
{a b : α}
{f : α → β}
(h : a < b)

ContinuousWithinAt f (Set.Ioo a b) b ↔ ContinuousWithinAt f (Set.Iio b) b


theorem le_normalClosure {H : Subgroup G} : H ≤ normalClosure ↑H

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


@[simp]
theorem rmap_rmap (r : Rel α β) (s : Rel β γ) (l : Filter α) :
    rmap s (rmap r l) = rmap (r.comp s) l

{α : Type u}
{β : Type v}
{γ : Type w}
(r : Rel α β)
(s : Rel β γ)
(l : Filter α)

Filter.rmap s (Filter.rmap r l) = Filter.rmap (r.comp s) l


theorem repr_one : repr (ofNat 1) = (1 : ℕ)


@[simp, norm_cast] lemma ratCast_imK (q : ℚ) : (q : ℍ[R]).imK = 0

{R : Type u_1}
[LinearOrderedField R]
(q : ℚ)


@[to_additive]
theorem isOpenMap_div_left (a : G) : IsOpenMap (a / ·)

{G : Type w}
[AddGroup G]
[TopologicalSpace G]
[TopologicalAddGroup G]
(a : G)


theorem leftInvSeq_take (ω : List B) (j : ℕ) :
    lis (ω.take j) = (lis ω).take j

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

cs.leftInvSeq (List.take j ω) = List.take j (cs.leftInvSeq ω)


@[to_additive]
theorem comp_noncommCoprod {Q : Type*} [Semigroup Q] (h : P →ₙ* Q)
    (comm : ∀ m n, Commute (f m) (g n)) :
    h.comp (f.noncommCoprod g comm) =
      (h.comp f).noncommCoprod (h.comp g) (fun m n ↦ (comm m n).map h)

(comm : ∀ (m : M) (n : N), AddCommute (f m) (g n))

h.comp (f.noncommCoprod g comm) = (h.comp f).noncommCoprod (h.comp g) ⋯


/-- If `χ` is a multiplicative function such that `J(a | p) = χ p` for all odd primes `p`,
then `J(a | b)` equals `χ b` for all odd natural numbers `b`. -/
theorem value_at (a : ℤ) {R : Type*} [CommSemiring R] (χ : R →* ℤ)
    (hp : ∀ (p : ℕ) (pp : p.Prime), p ≠ 2 → @legendreSym p ⟨pp⟩ a = χ p) {b : ℕ} (hb : Odd b) :
    J(a | b) = χ b

(hp : ∀ (p : ℕ) (pp : Nat.Prime p), p ≠ 2 → legendreSym p a = χ ↑p)


theorem add_neg_one (i : Int) : i + -1 = i - 1


/-- An alternative definition of `orderedInsert` using `takeWhile` and `dropWhile`. -/
theorem orderedInsert_eq_take_drop (a : α) :
    ∀ l : List α,
      l.orderedInsert r a = (l.takeWhile fun b => ¬a ≼ b) ++ a :: l.dropWhile fun b => ¬a ≼ b

{α : Type u}
(r : α → α → Prop)
[DecidableRel r]
(a : α)
(l : List α)

List.orderedInsert r a l = List.takeWhile (fun b => decide ¬r a b) l ++ a :: List.dropWhile (fun b => decide ¬r a b) l


theorem Adapted.integrable_upcrossingsBefore [IsFiniteMeasure μ] (hf : Adapted ℱ f) (hab : a < b) :
    Integrable (fun ω => (upcrossingsBefore a b f N ω : ℝ)) μ

{Ω : Type u_1}
{m0 : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
{a b : ℝ}
{f : ℕ → Ω → ℝ}
{N : ℕ}
{ℱ : MeasureTheory.Filtration ℕ m0}
[MeasureTheory.IsFiniteMeasure μ]
(hf : MeasureTheory.Adapted ℱ f)
(hab : a < b)

MeasureTheory.Integrable (fun ω => ↑(MeasureTheory.upcrossingsBefore a b f N ω)) μ


theorem sizeOf_lt_sizeOf_of_mem [SizeOf α] {x : α} {s : Multiset α} (hx : x ∈ s) :
    SizeOf.sizeOf x < SizeOf.sizeOf s

{α : Type u_1}
[SizeOf α]
{x : α}
{s : Multiset α}
(hx : x ∈ s)


theorem restrict_nonzero_iff (μ : FiniteMeasure Ω) (A : Set Ω) : μ.restrict A ≠ 0 ↔ μ A ≠ 0

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


@[reassoc]
theorem prod.lift_fst {W X Y : C} [HasBinaryProduct X Y] (f : W ⟶ X) (g : W ⟶ Y) :
    prod.lift f g ≫ prod.fst = f

CategoryTheory.Limits.prod.lift f g ≫ CategoryTheory.Limits.prod.fst = f


@[measurability]
theorem HasPDF.aemeasurable (X : Ω → E) (ℙ : Measure Ω)
    (μ : Measure E) [hX : HasPDF X ℙ μ] : AEMeasurable X ℙ

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

∀ {x : MeasurableSpace Ω} (X : Ω → E) (ℙ : MeasureTheory.Measure Ω) (μ : MeasureTheory.Measure E)
  [hX : MeasureTheory.HasPDF X ℙ μ], AEMeasurable X ℙ


theorem UInt8.toNat_div (x y : UInt8) : (x / y).toNat = x.toNat / y.toNat


@[simp]
theorem cocone_naturality_components (j j' : J) (f : j ⟶ j') (x : F.obj j) :
    (coconeMorphism.{w} F j') (F.map f x) = (coconeMorphism F j) x

{J : Type u}
[CategoryTheory.Category.{v, u} J]
(F : J ⥤ AddCommGrp)
(j j' : J)
(f : j ⟶ j')
(x : ↑(F.obj j))

(AddCommGrp.Colimits.coconeMorphism F j') ((F.map f) x) = (AddCommGrp.Colimits.coconeMorphism F j) x


@[simp]
theorem coe_sub : ⇑(f - g) = f - g

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
[AddGroup β]
[TopologicalAddGroup β]
(f g : α →C₀ β)


theorem HasStrictFDerivAt.cpow (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x)
    (h0 : f x ∈ slitPlane) : HasStrictFDerivAt (fun x => f x ^ g x)
      ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * Complex.log (f x)) • g') x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f g : E → ℂ}
{f' g' : E →L[ℂ] ℂ}
{x : E}
(hf : HasStrictFDerivAt f f' x)
(hg : HasStrictFDerivAt g g' x)
(h0 : f x ∈ Complex.slitPlane)


theorem Expr.eq_of_toPoly_eq (ctx : Context) (a b : Expr) (h : a.toPoly == b.toPoly) : a.denote ctx = b.denote ctx

(ctx : Nat.Linear.Context)
(a b : Nat.SOM.Expr)
(h : (a.toPoly == b.toPoly) = true)

Nat.SOM.Expr.denote ctx a = Nat.SOM.Expr.denote ctx b


@[simp] theorem head?_map (f : α → β) (l : List α) : head? (map f l) = (head? l).map f

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

(List.map f l).head? = Option.map f l.head?


@[simp]
protected theorem cast_symm {α β : Type u} {r : α → α → Prop} {s : β → β → Prop} (h₁ : α = β)
    (h₂ : HEq r s) : (RelIso.cast h₁ h₂).symm = RelIso.cast h₁.symm h₂.symm

(RelIso.cast h₁ h₂).symm = RelIso.cast ⋯ ⋯


/-- Construct a lax prefunctor from a map on objects, and prefunctors between the corresponding
hom types. -/
@[simps]
def mkOfHomPrefunctors (F : B → C) (F' : (a : B) → (b : B) → Prefunctor (a ⟶ b) (F a ⟶ F b)) :
    PrelaxFunctorStruct B C

(F' : (a b : B) → (a ⟶ b) ⥤q (F a ⟶ F b))

∀ (a_1 : a ⟶ b), (CategoryTheory.PrelaxFunctorStruct.mkOfHomPrefunctors F F').map a_1 = (F' a b).obj a_1


@[to_additive addOrderOf_add_eq_mul_addOrderOf_of_coprime]
theorem orderOf_mul_eq_mul_orderOf_of_coprime (h : Commute x y)
    (hco : (orderOf x).Coprime (orderOf y)) : orderOf (x * y) = orderOf x * orderOf y

(hco : (addOrderOf x).Coprime (addOrderOf y))

addOrderOf (x + y) = addOrderOf x * addOrderOf y


@[simp]
theorem liftAux_I : liftAux I I_mul_I = AlgHom.id ℝ ℂ

Complex.liftAux Complex.I Complex.I_mul_I = AlgHom.id ℝ ℂ


lemma mk₁_surjective (X : ComposableArrows C 1) : ∃ (X₀ X₁ : C) (f : X₀ ⟶ X₁), X = mk₁ f

(X : CategoryTheory.ComposableArrows C 1)

∃ X₀ X₁ f, X = CategoryTheory.ComposableArrows.mk₁ f


lemma deriv_eqOn {f' : 𝕜 → F} (hs : IsOpen s) (hf' : ∀ x ∈ s, HasDerivWithinAt f (f' x) s x) :
    s.EqOn (deriv f) f'


theorem range'_concat (s n : Nat) : range' s (n + 1) step = range' s n step ++ [s + step * n]

List.range' s (n + 1) step = List.range' s n step ++ [s + step * n]


/-- The functor `Comma L R ⥤ Comma L R` induced by the identity natural transformation on `R` is
    naturally isomorphic to the identity functor. -/
@[simps!]
def mapRightId : mapRight 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 : CategoryTheory.Functor B T)
(X : CategoryTheory.Comma L R)

((CategoryTheory.Comma.mapRightId L R).inv.app X).right = CategoryTheory.CategoryStruct.id X.right


theorem submatrix_map (f : α → β) (e₁ : l → m) (e₂ : o → n) (A : Matrix m n α) :
    (A.map f).submatrix e₁ e₂ = (A.submatrix e₁ e₂).map f

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
{β : Type w}
(f : α → β)
(e₁ : l → m)
(e₂ : o → n)
(A : Matrix m n α)


theorem uncurry_eq (g : Y ⟶ A ⟶[C] X) : uncurry g = (A ◁ g) ≫ (ihom.ev A).app X

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
{A X Y : C}
[CategoryTheory.Closed A]
(g : Y ⟶ (CategoryTheory.ihom A).obj X)

CategoryTheory.MonoidalClosed.uncurry g =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerLeft A g)
    ((CategoryTheory.ihom.ev A).app X)


@[simp]
theorem sInter_diff_singleton_univ (s : Set (Set α)) : ⋂₀ (s \ {univ}) = ⋂₀ s


lemma Indep.insert_indep_iff (hI : M.Indep I) :
    M.Indep (insert e I) ↔ e ∈ M.E \ M.closure I ∨ e ∈ I

{α : Type u_2}
{M : Matroid α}
{e : α}
{I : Set α}
(hI : M.Indep I)


theorem splits_mul_iff {f g : K[X]} (hf : f ≠ 0) (hg : g ≠ 0) :
    (f * g).Splits i ↔ f.Splits i ∧ g.Splits i

{K : Type v}
{L : Type w}
[Field K]
[Field L]
(i : K →+* L)
{f g : K[X]}
(hf : f ≠ 0)
(hg : g ≠ 0)

Polynomial.Splits i (f * g) ↔ Polynomial.Splits i f ∧ Polynomial.Splits i g


@[simp] lemma erase_idem (s : LowerSet α) (a : α) : (s.erase a).erase a = s.erase a

{α : Type u_1}
[Preorder α]
(s : LowerSet α)
(a : α)


theorem MeasurableSet.map_coe_volume {s : Set α} (hs : MeasurableSet s) :
    volume.map ((↑) : s → α) = restrict volume s

{α : Type u_2}
[MeasureTheory.MeasureSpace α]
{s : Set α}
(hs : MeasurableSet s)

MeasureTheory.Measure.map Subtype.val MeasureTheory.volume = MeasureTheory.volume.restrict s


@[to_additive]
lemma comp_left_injective (e : M ≃* N) : Injective fun f : N →* P ↦ f.comp (e : M →* N)

{M : Type u_6}
{N : Type u_7}
{P : Type u_8}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass P]
(e : M ≃+ N)


theorem ne_of_lt {a b : Nat} (h : a < b) : a ≠ b


@[to_additive nnnorm_add_le]
theorem nnnorm_mul_le' (a b : E) : ‖a * b‖₊ ≤ ‖a‖₊ + ‖b‖₊

{E : Type u_6}
[SeminormedAddGroup E]
(a b : E)

‖a + b‖₊ ≤ ‖a‖₊ + ‖b‖₊


@[simp]
theorem ε_inv_app_obj (n : M) (X : C) :
    F.εIso.inv.app ((F.obj n).obj X) = (F.μ n (𝟙_ M)).app X ≫ (F.map (ρ_ n).hom).app X

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

F.εIso.inv.app ((F.obj n).obj X) =
  CategoryTheory.CategoryStruct.comp ((F.μ n (𝟙_ M)).app X)
    ((F.map (CategoryTheory.MonoidalCategory.rightUnitor n).hom).app X)


theorem _root_.Measurable.setLIntegral_kernel {f : β → ℝ≥0∞} (hf : Measurable f) {s : Set β}
    (hs : MeasurableSet s) : Measurable fun a => ∫⁻ b in s, f b ∂κ a

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{κ : ProbabilityTheory.Kernel α β}
[ProbabilityTheory.IsSFiniteKernel κ]
{f : β → ℝ≥0∞}
(hf : Measurable f)
{s : Set β}
(hs : MeasurableSet s)

Measurable fun a => ∫⁻ (b : β) in s, f b ∂κ a


@[trans]
theorem EventuallyEq.trans {l : Filter α} {f g h : α → β} (H₁ : f =ᶠ[l] g) (H₂ : g =ᶠ[l] h) :
    f =ᶠ[l] h

{α : Type u}
{β : Type v}
{l : Filter α}
{f g h : α → β}
(H₁ : f =ᶠ[l] g)
(H₂ : g =ᶠ[l] h)


@[simp]
theorem toDualLeft_apply (a : M) : p.toDualLeft a = p a

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(p : PerfectPairing R M N)
(a : M)


theorem HasDerivAtFilter.isBigO_sub (h : HasDerivAtFilter f f' x L) :
    (fun x' => f x' - f x) =O[L] fun x' => x' - x

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


theorem eval₂_denom_ne_zero {x : RatFunc K} (h : eval f a x ≠ 0) :
    Polynomial.eval₂ f a (denom x) ≠ 0

{K : Type u}
[Field K]
{L : Type u}
[Field L]
{f : K →+* L}
{a : L}
{x : RatFunc K}
(h : RatFunc.eval f a x ≠ 0)


/-- A morphism of monoid objects induces a "restriction" or "comap" functor
between the categories of module objects.
-/
@[simps]
def comap {A B : Mon_ C} (f : A ⟶ B) : Mod_ B ⥤ Mod_ A

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{A B : Mon_ C}
(f : A ⟶ B)
(M : Mod_ B)

((Mod_.comap f).obj M).act = f.hom ▷ M.X ≫ M.act


@[simp]
theorem congr_symm_tprod (f : Π i, s i ≃ₗ[R] t i) (p : Π i, t i) :
    (congr f).symm (tprod R p) = tprod R (fun (i : ι) ↦ (f i).symm (p i))

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

(PiTensorProduct.congr f).symm ((PiTensorProduct.tprod R) p) = ⨂ₜ[R] (i : ι), (f i).symm (p i)


@[simp]
theorem reduceOption_cons_of_none (l : List (Option α)) :
    reduceOption (none :: l) = l.reduceOption

(none :: l).reduceOption = l.reduceOption


@[to_additive]
theorem dist_prod_prod_le (s : Finset ι) (f a : ι → E) :
    dist (∏ b ∈ s, f b) (∏ b ∈ s, a b) ≤ ∑ b ∈ s, dist (f b) (a b)

{ι : Type u_4}
{E : Type u_6}
[SeminormedCommGroup E]
(s : Finset ι)
(f a : ι → E)


@[simp]
theorem nonempty_psum {α β} : Nonempty (α ⊕' β) ↔ Nonempty α ∨ Nonempty β


/-- A module with a finite ring of scalars is additively torsion. -/
theorem IsTorsion.module_of_finite [Ring R] [Finite R] [Module R M] : IsTorsion M

(R : Type u_3)
(M : Type u_4)
[AddCommMonoid M]
[Ring R]
[Finite R]
[Module R M]


/-- The parameterized integral `x ↦ ∫ y, g (y⁻¹ * x) ∂μ` depends continuously on `y` when `g` is a
compactly supported continuous function on a topological group `G`, and `μ` is finite on compact
sets. -/
@[to_additive]
lemma continuous_integral_apply_inv_mul
    {G : Type*} [TopologicalSpace G] [LocallyCompactSpace G] [Group G] [TopologicalGroup G]
    [MeasurableSpace G] [BorelSpace G]
    {μ : Measure G} [IsFiniteMeasureOnCompacts μ] {E : Type*} [NormedAddCommGroup E]
    [NormedSpace ℝ E] {g : G → E}
    (hg : Continuous g) (h'g : HasCompactSupport g) :
    Continuous (fun (x : G) ↦ ∫ y, g (y⁻¹ * x) ∂μ)

Continuous fun x => ∫ (y : G), g (-y + x) ∂μ


@[simp]
theorem edgeSet_bot : (⊥ : Subgraph G).edgeSet = ∅


@[simp]
theorem coe_mk' {s : Set R} {sm : Subsemigroup R} (hm : ↑sm = s) {sa : AddSubgroup R}
    (ha : ↑sa = s) : (NonUnitalSubring.mk' s sm sa hm ha : Set R) = s

{R : Type u}
[NonUnitalNonAssocRing R]
{s : Set R}
{sm : Subsemigroup R}
(hm : ↑sm = s)
{sa : AddSubgroup R}
(ha : ↑sa = s)

↑(NonUnitalSubring.mk' s sm sa hm ha) = s


/-- The homset equivalence which helps show that `R` is a right adjoint. -/
@[simps!] -- Porting note: Originally `@[simps (config := { rhsMd := semireducible })]`
noncomputable def constructLeftAdjointEquiv [∀ X : B, RegularEpi (adj₁.counit.app X)] (Y : A)
    (X : B) : (constructLeftAdjointObj _ _ adj₁ adj₂ X ⟶ Y) ≃ (X ⟶ R.obj Y)

[(X : B) → CategoryTheory.RegularEpi (adj₁.counit.app X)]

∀ (a : X ⟶ R.obj Y),
  (CategoryTheory.LiftAdjoint.constructLeftAdjointEquiv R F' adj₁ adj₂ Y X).symm a =
    (CategoryTheory.Limits.Cofork.IsColimit.homIso
          (CategoryTheory.Limits.colimit.isColimit
            (CategoryTheory.Limits.parallelPair (F'.map (U.map (adj₁.counit.app X)))
              (CategoryTheory.LiftAdjoint.otherMap R F' adj₁ adj₂ X)))
          Y).symm
      ⟨(adj₂.homEquiv (U.obj X) Y).symm
          (CategoryTheory.CategoryStruct.comp (adj₁.unit.app (U.obj X))
            (U.map
              ↑((CategoryTheory.Limits.Cofork.IsColimit.homIso (CategoryTheory.LiftAdjoint.counitCoequalises adj₁ X)
                    (R.obj Y))
                  a))),
        ⋯⟩


theorem sum_smul_index' [AddMonoid M] [DistribSMul R M] [AddCommMonoid N] {g : α →₀ M} {b : R}
    {h : α → M → N} (h0 : ∀ i, h i 0 = 0) : (b • g).sum h = g.sum fun i c => h i (b • c)

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
{R : Type u_11}
[AddMonoid M]
[DistribSMul R M]
[AddCommMonoid N]
{g : α →₀ M}
{b : R}
{h : α → M → N}
(h0 : ∀ (i : α), h i 0 = 0)


@[elab_as_elim]
theorem head_induction_on {P : ∀ a : α, ReflTransGen r a b → Prop} {a : α} (h : ReflTransGen r a b)
    (refl : P b refl)
    (head : ∀ {a c} (h' : r a c) (h : ReflTransGen r c b), P c h → P a (h.head h')) : P a h

{P : (a : α) → Relation.ReflTransGen r a b → Prop}

(head : ∀ {a c : α} (h' : r a c) (h : Relation.ReflTransGen r c b), P c h → P a ⋯)


/-- Evaluation of a `MonoidHom` at a point as a monoid homomorphism. See also `MonoidHom.apply`
for the evaluation of any function at a point. -/
@[to_additive (attr := simps!)
      "Evaluation of an `AddMonoidHom` at a point as an additive monoid homomorphism.
      See also `AddMonoidHom.apply` for the evaluation of any function at a point."]
def eval [MulOneClass M] [CommMonoid N] : M →* (M →* N) →* N

{M : Type uM}
{N : Type uN}
[MulOneClass M]
[CommMonoid N]
(y : M)
(x : M →* N)


/-- A lax monoidal functor induces a lax monoidal functor between
the categories of `G`-actions within those categories. -/
@[simps!]
def mapActionLax (F : LaxMonoidalFunctor V W) (G : MonCat.{u}) :
    LaxMonoidalFunctor (Action V G) (Action W G)

(F : CategoryTheory.LaxMonoidalFunctor V W)

(CategoryTheory.MonoidalFunctor.mapActionLax F G).ε.hom = F.ε


theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) :
    DifferentiableAt ℝ (fun x => ⟪f x, g x⟫) x

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{f g : G → E}
{x : G}
(hf : DifferentiableAt ℝ f x)
(hg : DifferentiableAt ℝ g x)

DifferentiableAt ℝ (fun x => ⟪f x, g x⟫_𝕜) x


lemma forall' {p : ∀ a, β a → Prop} : (∀ a b, p a b) ↔ ∀ x : Σ a, β a, p x.1 x.2

{α : Type u_1}
{β : α → Type u_4}
{p : (a : α) → β a → Prop}

(∀ (a : α) (b : β a), p a b) ↔ ∀ (x : (a : α) × β a), p x.fst x.snd


@[simp]
theorem coe_subtype : (subtype s : s → R) = Subtype.val

{R : Type u}
{S : Type v}
[NonUnitalNonAssocRing R]
[SetLike S R]
[hSR : NonUnitalSubringClass S R]
(s : S)

⇑(NonUnitalSubringClass.subtype s) = Subtype.val


theorem Filtration.adapted_natural [MetrizableSpace β] [mβ : MeasurableSpace β] [BorelSpace β]
    {u : ι → Ω → β} (hum : ∀ i, StronglyMeasurable[m] (u i)) :
    Adapted (Filtration.natural u hum) u

{u : ι → Ω → β}

(hum : ∀ (i : ι), MeasureTheory.StronglyMeasurable (u i))

MeasureTheory.Adapted (MeasureTheory.Filtration.natural u hum) u


theorem morphismRestrict_base_coe {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) (x) :
    @Coe.coe U Y (⟨fun x => x.1⟩) ((f ∣_ U).val.base x) = f.val.base x.1

(x : ↑↑(↑((TopologicalSpace.Opens.map f.val.base).obj U)).toPresheafedSpace)

Coe.coe ((f ∣_ U).val.base x) = f.val.base ↑x


/-- There are `min n r` parts in a graph on `n` vertices satisfying `G.IsTuranMaximal r`.
`min` handles the `n < r` case, when `G` is complete but still `r + 1`-cliquefree
for having insufficiently many vertices. -/
theorem card_parts : h.finpartition.parts.card = min (Fintype.card V) r

{V : Type u_1}
[Fintype V]
[DecidableEq V]
{G : SimpleGraph V}
[DecidableRel G.Adj]
{r : ℕ}
(h : G.IsTuranMaximal r)


theorem coe_inv : ↑A⁻¹ = (↑A : Matrix n n R)⁻¹

{n : Type u}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
(A : GL n R)

↑A⁻¹ = (↑A)⁻¹


@[to_additive]
theorem MonotoneOn.inv (hf : MonotoneOn f s) : AntitoneOn (fun x => (f x)⁻¹) s

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

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


@[simp]
theorem shiftRight_neg (m n : ℤ) : m >>> (-n) = m <<< n


theorem inner_sub_right (x y z : F) : ⟪x, y - z⟫ = ⟪x, y⟫ - ⟪x, z⟫

{𝕜 : Type u_1}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup F]
[Module 𝕜 F]
[c : InnerProductSpace.Core 𝕜 F]
(x y z : F)


theorem eLpNorm'_congr_norm_ae {f g : α → F} (hfg : ∀ᵐ x ∂μ, ‖f x‖ = ‖g x‖) :
    eLpNorm' f q μ = eLpNorm' g q μ

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{q : ℝ}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
{f g : α → F}
(hfg : ∀ᵐ (x : α) ∂μ, ‖f x‖ = ‖g x‖)

MeasureTheory.eLpNorm' f q μ = MeasureTheory.eLpNorm' g q μ


@[to_additive]
lemma mk_inv_mul_mk_eq_one (S : Submonoid M) {x : Mˣ} (h : x ∈ S.units) :
    (⟨_, h.2⟩ : S) * ⟨_, h.1⟩ = 1

{M : Type u_1}
[AddMonoid M]
(S : AddSubmonoid M)
{x : AddUnits M}
(h : x ∈ S.addUnits)

⟨(AddUnits.coeHom M) (-x), ⋯⟩ + ⟨(AddUnits.coeHom M) x, ⋯⟩ = 0


lemma IsSelfAdjoint.neg_algebraMap_norm_le_self {a : A} (ha : IsSelfAdjoint a := by cfc_tac) :
    - (algebraMap ℝ A ‖a‖) ≤ a

{A : Type u_1}
[NormedRing A]
[StarRing A]
[CstarRing A]
[CompleteSpace A]
[NormedAlgebra ℂ A]
[StarModule ℂ A]
[PartialOrder A]
[StarOrderedRing A]
{a : A}
(ha : IsSelfAdjoint a := by cfc_tac)


theorem real_inner_self_eq_norm_sq (x : F) : ⟪x, x⟫_ℝ = ‖x‖ ^ 2

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
(x : F)