@[to_additive]
theorem prod_range_succ (f : ℕ → β) (n : ℕ) :
    (∏ x ∈ range (n + 1), f x) = (∏ x ∈ range n, f x) * f n

{β : Type u_4}
[CommMonoid β]
(f : ℕ → β)
(n : ℕ)

∏ x ∈ Finset.range (n + 1), f x = (∏ x ∈ Finset.range n, f x) * f n


@[simp]
lemma inl_rel'_inl_iff (x₁ y₁ : X₁) :
    Rel' f g (Sum.inl x₁) (Sum.inl y₁) ↔ x₁ = y₁ ∨
      ∃ (x₀ y₀ : S) (_ : g x₀ = g y₀), x₁ = f x₀ ∧ y₁ = f y₀

{S X₁ X₂ : Type u}
(f : S ⟶ X₁)
(g : S ⟶ X₂)
(x₁ y₁ : X₁)

CategoryTheory.Limits.Types.Pushout.Rel' f g (Sum.inl x₁) (Sum.inl y₁) ↔
  x₁ = y₁ ∨ ∃ x₀ y₀, ∃ (_ : g x₀ = g y₀), x₁ = f x₀ ∧ y₁ = f y₀


@[simp] lemma unop_hom_leftUnitor (X : Cᵒᵖ) : (λ_ X).hom.unop = (λ_ (unop X)).inv

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

(CategoryTheory.MonoidalCategory.leftUnitor X).hom.unop =
  (CategoryTheory.MonoidalCategory.leftUnitor (Opposite.unop X)).inv


theorem mk_range_eq (f : α → β) (h : Injective f) : #(range f) = #α

{α β : Type u}
(f : α → β)
(h : Function.Injective f)

Cardinal.mk ↑(Set.range f) = Cardinal.mk α


/-- **Class formula** for a finite group acting on a finite type. -/
@[to_additive "**Class formula** for a finite group acting on a finite type."]
theorem card_eq_sum_card_group_div_card_stabilizer [Fintype α] [Fintype β] [Fintype Ω]
    [∀ b : β, Fintype <| stabilizer α b] :
    Fintype.card β = ∑ ω : Ω, Fintype.card α / Fintype.card (stabilizer α ω.out')

[Fintype (Quotient (AddAction.orbitRel α β))]

[(b : β) → Fintype ↥(AddAction.stabilizer α b)]

Fintype.card β = ∑ ω : Quotient (AddAction.orbitRel α β), Fintype.card α / Fintype.card ↥(AddAction.stabilizer α ω.out')


/-- The empty word `[]` only reduces to itself. -/
@[to_additive "The empty word `[]` only reduces to itself."]
theorem nil_iff : Red [] L ↔ L = []


@[simp] theorem isRed_reverse {t : RBNode α} : t.reverse.isRed = t.isRed


/-- If a number `a` is less than or equal to the `liminf` of a function `f` at some filter
and is greater than or equal to the `limsup` of `f`, then `f` tends to `a` along this filter. -/
theorem tendsto_of_le_liminf_of_limsup_le {f : Filter β} {u : β → α} {a : α} (hinf : a ≤ liminf u f)
    (hsup : limsup u f ≤ a) (h : f.IsBoundedUnder (· ≤ ·) u := by isBoundedDefault)
    (h' : f.IsBoundedUnder (· ≥ ·) u := by isBoundedDefault) : Tendsto u f (𝓝 a)

(h : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) f u := by isBoundedDefault)

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


/-- A structure groupoid is a set of partial homeomorphisms of a topological space stable under
composition and inverse. They appear in the definition of the smoothness class of a manifold. -/
structure StructureGroupoid (H : Type u) [TopologicalSpace H] where
  /-- Members of the structure groupoid are partial homeomorphisms. -/
  members : Set (PartialHomeomorph H H)
  /-- Structure groupoids are stable under composition. -/
  trans' : ∀ e e' : PartialHomeomorph H H, e ∈ members → e' ∈ members → e ≫ₕ e' ∈ members
  /-- Structure groupoids are stable under inverse. -/
  symm' : ∀ e : PartialHomeomorph H H, e ∈ members → e.symm ∈ members
  /-- The identity morphism lies in the structure groupoid. -/
  id_mem' : PartialHomeomorph.refl H ∈ members
  /-- Let `e` be a partial homeomorphism. If for every `x ∈ e.source`, the restriction of e to some
  open set around `x` lies in the groupoid, then `e` lies in the groupoid. -/
  locality' : ∀ e : PartialHomeomorph H H,
    (∀ x ∈ e.source, ∃ s, IsOpen s ∧ x ∈ s ∧ e.restr s ∈ members) → e ∈ members
  /-- Membership in a structure groupoid respects the equivalence of partial homeomorphisms. -/
  mem_of_eqOnSource' : ∀ e e' : PartialHomeomorph H H, e ∈ members → e' ≈ e → e' ∈ members

{H : Type u}
[TopologicalSpace H]
(self : StructureGroupoid H)
(e : PartialHomeomorph H H)

(∀ x ∈ e.source, ∃ s, IsOpen s ∧ x ∈ s ∧ e.restr s ∈ self.members) → e ∈ self.members


theorem ContinuousOn.preimage_interior_subset_interior_preimage {f : α → β} {s : Set α} {t : Set β}
    (hf : ContinuousOn f s) (hs : IsOpen s) : s ∩ f ⁻¹' interior t ⊆ s ∩ interior (f ⁻¹' t)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{s : Set α}
{t : Set β}
(hf : ContinuousOn f s)
(hs : IsOpen s)


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

AlgebraicTopology.NormalizedMooreComplex.objX X 0 = ⊤


/-- A local maximum of a concave function is a global maximum, restricted to a set `s`. -/
theorem IsMaxOn.of_isLocalMaxOn_of_concaveOn {f : E → β} {a : E} (a_in_s : a ∈ s)
    (h_localmax : IsLocalMaxOn f s a) (h_conc : ConcaveOn ℝ s f) : IsMaxOn f s a

{E : Type u_1}
{β : Type u_2}
[AddCommGroup E]
[TopologicalSpace E]
[Module ℝ E]
[TopologicalAddGroup E]
[ContinuousSMul ℝ E]
[OrderedAddCommGroup β]
[Module ℝ β]
[OrderedSMul ℝ β]
{s : Set E}
{f : E → β}
{a : E}
(a_in_s : a ∈ s)
(h_localmax : IsLocalMaxOn f s a)
(h_conc : ConcaveOn ℝ s f)


/-- If `a` is positive we can form a basis from only nonnegative `Set.Ioo` intervals -/
theorem nhds_basis_Ioo_pos_of_pos [NoMaxOrder α] {a : α} (ha : 0 < a) :
    (𝓝 a).HasBasis (fun ε : α => (0 : α) < ε ∧ ε ≤ a) fun ε => Ioo (a - ε) (a + ε)

{α : Type u_1}
[TopologicalSpace α]
[LinearOrderedAddCommGroup α]
[OrderTopology α]
[NoMaxOrder α]
{a : α}
(ha : 0 < a)

(𝓝 a).HasBasis (fun ε => 0 < ε ∧ ε ≤ a) fun ε => Set.Ioo (a - ε) (a + ε)


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

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

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


theorem dvd_antisymm' : a ∣ b → b ∣ a → b = a

{α : Type u_1}
[CancelCommMonoidWithZero α]
{a b : α}
[Subsingleton αˣ]


theorem IsAlt.eq_of_add_add_eq_zero [IsCancelAdd M] {a b c : M₁} (hAdd : a + b + c = 0) :
    B a b = B b c

{R : Type u_1}
{R₁ : Type u_2}
{M : Type u_5}
{M₁ : Type u_6}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[CommSemiring R₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
{I₁ I₂ : R₁ →+* R}
{B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] M}
(H : B.IsAlt)
[IsCancelAdd M]
{a b c : M₁}
(hAdd : a + b + c = 0)


protected theorem ne_of_lt {a b : Fin n} (h : a < b) : a ≠ b


@[simp]
theorem coe_pointwise_smul (m : M) (S : Subsemiring R) : ↑(m • S) = m • (S : Set R)

{M : Type u_1}
{R : Type u_2}
[Monoid M]
[Semiring R]
[MulSemiringAction M R]
(m : M)
(S : Subsemiring R)


theorem card_eq_sum_card_fiberwise [DecidableEq β] {f : α → β} {s : Finset α} {t : Finset β}
    (H : ∀ x ∈ s, f x ∈ t) : s.card = ∑ a ∈ t, (s.filter fun x => f x = a).card

{α : Type u_3}
{β : Type u_4}
[DecidableEq β]
{f : α → β}
{s : Finset α}
{t : Finset β}
(H : ∀ x ∈ s, f x ∈ t)

s.card = ∑ a ∈ t, (Finset.filter (fun x => f x = a) s).card


@[norm_cast]
theorem cast_mk (a b : ℤ) : (a /. b : α) = a / b

{α : Type u_3}
[DivisionRing α]
[CharZero α]
(a b : ℤ)


theorem subtype_apply (s : AffineSubspace k P) [Nonempty s] (p : s) : s.subtype p = p

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(s : AffineSubspace k P)
[Nonempty ↥s]
(p : ↥s)


@[simp, norm_cast] lemma coe_one : ((1 : AddMonoid.End A) : A → A) = id


@[simp, norm_cast]
theorem coe_intCast [IntCast β] (n : ℤ) : ((n : C(α, β)) : α → β) = n

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[IntCast β]
(n : ℤ)


@[simp]
theorem mapEquiv_trans (e₁ : R ≃+* S) (e₂ : S ≃+* T) :
    mapEquiv (e₁.trans e₂) = (mapEquiv e₁).trans (mapEquiv e₂)

{R : Type u_1}
{S : Type u_2}
{T : Type u_3}
[CommRing R]
[LocalRing R]
[CommRing S]
[LocalRing S]
[CommRing T]
[LocalRing T]
(e₁ : R ≃+* S)
(e₂ : S ≃+* T)

LocalRing.ResidueField.mapEquiv (e₁.trans e₂) =
  (LocalRing.ResidueField.mapEquiv e₁).trans (LocalRing.ResidueField.mapEquiv e₂)


theorem closure_preimage_re (s : Set ℝ) : closure (re ⁻¹' s) = re ⁻¹' closure s

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


@[simp]
theorem isEmpty_ulift {α} : IsEmpty (ULift α) ↔ IsEmpty α

IsEmpty (ULift.{u_5, u_4} α) ↔ IsEmpty α


@[to_additive]
theorem BddBelow.inv (h : BddBelow s) : BddAbove s⁻¹

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

[CovariantClass G G (Function.swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1]


theorem StarConvex.add_smul_mem (hs : StarConvex 𝕜 x s) (hy : x + y ∈ s) {t : 𝕜} (ht₀ : 0 ≤ t)
    (ht₁ : t ≤ 1) : x + t • y ∈ s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{x y : E}
{s : Set E}
(hs : StarConvex 𝕜 x s)
(hy : x + y ∈ s)
{t : 𝕜}
(ht₀ : 0 ≤ t)
(ht₁ : t ≤ 1)


theorem single_sum [Zero M] [AddCommMonoid N] (s : ι →₀ M) (f : ι → M → N) (a : α) :
    single a (s.sum f) = s.sum fun d c => single a (f d c)

{α : Type u_1}
{ι : Type u_2}
{M : Type u_8}
{N : Type u_10}
[Zero M]
[AddCommMonoid N]
(s : ι →₀ M)
(f : ι → M → N)
(a : α)

Finsupp.single a (s.sum f) = s.sum fun d c => Finsupp.single a (f d c)


theorem isMulOneCocycle_of_oneCocycles (f : oneCocycles (Rep.ofMulDistribMulAction G M)) :
    IsMulOneCocycle (M := M) (Additive.toMul ∘ f.1)

(f : ↥(groupCohomology.oneCocycles (Rep.ofMulDistribMulAction G M)))

groupCohomology.IsMulOneCocycle (⇑Additive.toMul ∘ ↑f)


/-- A relation is well-founded iff every principal segment of it is well-founded.

In this lemma we use `Subrel` to indicate its principal segments because it's usually more
convenient to use.
-/
theorem wellFounded_iff_wellFounded_subrel {β : Type*} {s : β → β → Prop} [IsTrans β s] :
    WellFounded s ↔ ∀ b, WellFounded (Subrel s { b' | s b' b })

{β : Type u_4}
{s : β → β → Prop}
[IsTrans β s]

WellFounded s ↔ ∀ (b : β), WellFounded (Subrel s {b' | s b' b})


@[simp]
theorem swap_comp_bipointedToPointedSnd :
    Bipointed.swap ⋙ bipointedToPointedSnd = bipointedToPointedFst


theorem intValuationDef_if_neg {r : R} (hr : r ≠ 0) :
    v.intValuationDef r =
      Multiplicative.ofAdd
        (-(Associates.mk v.asIdeal).count (Associates.mk (Ideal.span {r} : Ideal R)).factors : ℤ)

(v : IsDedekindDomain.HeightOneSpectrum R)

v.intValuationDef r =
  ↑(Multiplicative.ofAdd (-↑((Associates.mk v.asIdeal).count (Associates.mk (Ideal.span {r})).factors)))


theorem whisker_assoc_bimod {W X Y Z : Mon_ C} (M : Bimod W X) {N N' : Bimod X Y} (f : N ⟶ N')
    (P : Bimod Y Z) :
    whiskerRight (whiskerLeft M f) P =
      (associatorBimod M N P).hom ≫
        whiskerLeft M (whiskerRight f P) ≫ (associatorBimod M N' P).inv

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

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

Bimod.whiskerRight (M.whiskerLeft f) P =
  (M.associatorBimod N P).hom ≫ M.whiskerLeft (Bimod.whiskerRight f P) ≫ (M.associatorBimod N' P).inv


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

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


/-- A functor is an equivalence of categories if it is faithful, full and
essentially surjective. -/
class Functor.IsEquivalence (F : C ⥤ D) : Prop where
  faithful : F.Faithful := by infer_instance
  full : F.Full := by infer_instance
  essSurj : F.EssSurj := by infer_instance

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : CategoryTheory.Functor C D}
[self : F.IsEquivalence]


theorem single_commute_single [Add G] {a₁ a₂ : G} {b₁ b₂ : k}
    (ha : AddCommute a₁ a₂) (hb : Commute b₁ b₂) :
    Commute (single a₁ b₁) (single a₂ b₂)

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[Add G]
{a₁ a₂ : G}
{b₁ b₂ : k}
(ha : AddCommute a₁ a₂)
(hb : Commute b₁ b₂)

Commute (AddMonoidAlgebra.single a₁ b₁) (AddMonoidAlgebra.single a₂ b₂)


@[to_additive]
theorem mul_subset_iff : s * t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, x * y ∈ u


@[simp]
theorem sUnion_eq_empty {S : Set (Set α)} : ⋃₀S = ∅ ↔ ∀ s ∈ S, s = ∅

⋃₀ S = ∅ ↔ ∀ s ∈ S, s = ∅


lemma zero_mem (I : FractionalIdeal S P) : 0 ∈ I

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
(I : FractionalIdeal S P)


theorem coe_id {X : C} : (𝟙 X : X → X) = id

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

⇑(CategoryTheory.CategoryStruct.id X) = id


theorem le_of_exists {f g : CauSeq α abs} (h : ∃ i, ∀ j ≥ i, f j ≤ g j) : f ≤ g

{α : Type u_1}
[LinearOrderedField α]
{f g : CauSeq α abs}
(h : ∃ i, ∀ j ≥ i, ↑f j ≤ ↑g j)


@[simps]
instance tensor_right (X Y : C) [MonoidalCoherence (𝟙_ C) Y] :
    MonoidalCoherence X (X ⊗ Y)

[CategoryTheory.MonoidalCoherence (𝟙_ C) Y]


theorem pullback_fst_eq :
    CompHaus.pullback.fst f g = (pullbackIsoPullback f g).hom ≫ Limits.pullback.fst f g

{X Y B : CompHaus}
(f : X ⟶ B)
(g : Y ⟶ B)

CompHaus.pullback.fst f g =
  CategoryTheory.CategoryStruct.comp (CompHaus.pullbackIsoPullback f g).hom (CategoryTheory.Limits.pullback.fst f g)


theorem gt_of_not_le {n m : Nat} (h : ¬ n ≤ m) : n > m


/-- If two integers from `{0, 1, -1}` result in equal elements in a ring `R`
that is nontrivial and of characteristic not `2`, then they are equal. -/
lemma Int.cast_injOn_of_ringChar_ne_two {R : Type*} [NonAssocRing R] [Nontrivial R]
    (hR : ringChar R ≠ 2) : ({0, 1, -1} : Set ℤ).InjOn ((↑) : ℤ → R)

{R : Type u_2}
[NonAssocRing R]
[Nontrivial R]
(hR : ringChar R ≠ 2)


@[simp]
lemma ofHom_sub (φ₁ φ₂ : F ⟶ G) :
    Cochain.ofHom (φ₁ - φ₂) = Cochain.ofHom φ₁ - Cochain.ofHom φ₂

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{F G : CochainComplex C ℤ}
(φ₁ φ₂ : F ⟶ G)

CochainComplex.HomComplex.Cochain.ofHom (φ₁ - φ₂) =
  CochainComplex.HomComplex.Cochain.ofHom φ₁ - CochainComplex.HomComplex.Cochain.ofHom φ₂


/-- Pythagorean theorem, subtracting vectors, vector angle form. -/
theorem norm_sub_sq_eq_norm_sq_add_norm_sq' (x y : V) (h : angle x y = π / 2) :
    ‖x - y‖ * ‖x - y‖ = ‖x‖ * ‖x‖ + ‖y‖ * ‖y‖

(h : InnerProductGeometry.angle x y = π / 2)


theorem eq_top_iff' (A : Subsemiring R) : A = ⊤ ↔ ∀ x : R, x ∈ A

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


/-- If `F` is initial,
the category of cones on `F ⋙ G` is equivalent to the category of cones on `G`,
for any `G : D ⥤ E`.
-/
@[simps]
def conesEquiv : Cone (F ⋙ G) ≌ Cone G

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

(CategoryTheory.Functor.Initial.conesEquiv F G).inverse = CategoryTheory.Limits.Cones.whiskering F


@[continuity]
theorem continuous_totalSpaceMk (b : B) :
    Continuous[_, a.totalSpaceTopology] (.mk b)

{R : Type u_1}
{B : Type u_2}
{F : Type u_3}
{E : B → Type u_4}
[NontriviallyNormedField R]
[(x : B) → AddCommMonoid (E x)]
[(x : B) → Module R (E x)]
[NormedAddCommGroup F]
[NormedSpace R F]
[TopologicalSpace B]
[(x : B) → TopologicalSpace (E x)]
(a : VectorPrebundle R F E)
(b : B)


theorem IsClosed.closure_eq (h : IsClosed s) : closure s = s

{X : Type u}
{s : Set X}
[TopologicalSpace X]
(h : IsClosed s)


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

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

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


theorem le_pow_of_le_ramificationIdx {n : ℕ} (hn : n ≤ ramificationIdx f p P) :
    map f p ≤ P ^ n

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


/-- If three points lie in the affine span of two points, the first three points are collinear. -/
theorem collinear_triple_of_mem_affineSpan_pair {p₁ p₂ p₃ p₄ p₅ : P} (h₁ : p₁ ∈ line[k, p₄, p₅])
    (h₂ : p₂ ∈ line[k, p₄, p₅]) (h₃ : p₃ ∈ line[k, p₄, p₅]) :
    Collinear k ({p₁, p₂, p₃} : Set P)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{p₁ p₂ p₃ p₄ p₅ : P}
(h₁ : p₁ ∈ affineSpan k {p₄, p₅})
(h₂ : p₂ ∈ affineSpan k {p₄, p₅})
(h₃ : p₃ ∈ affineSpan k {p₄, p₅})


@[simp]
theorem coe_ofBijective {f : A₁ →ₐ[R] A₂} {hf : Function.Bijective f} :
    (AlgEquiv.ofBijective f hf : A₁ → A₂) = f

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
{f : A₁ →ₐ[R] A₂}
{hf : Function.Bijective ⇑f}


@[simp] lemma map₂_top_right (f : α → β → γ) (a) : map₂ f a ⊤ = ⊤

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α → β → γ)
(a : WithTop α)


theorem univ_pi_eq_empty (ht : t i = ∅) : pi univ t = ∅

{ι : Type u_1}
{α : ι → Type u_2}
{t : (i : ι) → Set (α i)}
{i : ι}
(ht : t i = ∅)


@[simp]
theorem Ioc_union_Ioc_right : Ioc a b ∪ Ioc a c = Ioc a (max b c)

{α : Type u_1}
[LinearOrder α]
{a b c : α}

Set.Ioc a b ∪ Set.Ioc a c = Set.Ioc a (max b c)


@[to_additive]
theorem Multipliable.update (hf : Multipliable f) (b : β) [DecidableEq β] (a : α) :
    Multipliable (update f b a)

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[TopologicalSpace α]
[TopologicalAddGroup α]
{f : β → α}
(hf : Summable f)
(b : β)
[DecidableEq β]
(a : α)


@[simp] lemma of_zero : (of 0 : P.Cotangent) = 0

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}


@[to_additive]
theorem finprod_eventually_eq_prod {M : Type*} [CommMonoid M] {f : ι → X → M}
    (hf : LocallyFinite fun i => mulSupport (f i)) (x : X) :
    ∃ s : Finset ι, ∀ᶠ y in 𝓝 x, ∏ᶠ i, f i y = ∏ i ∈ s, f i y

(hf : LocallyFinite fun i => Function.support (f i))

∃ s, ∀ᶠ (y : X) in 𝓝 x, ∑ᶠ (i : ι), f i y = ∑ i ∈ s, f i y


/-- The map `(x, y) ↦ (y, x / y)` sends `μ × ν` to `ν × μ`. -/
@[to_additive measurePreserving_prod_sub_swap
      "The map `(x, y) ↦ (y, x - y)` sends `μ × ν` to `ν × μ`."]
theorem measurePreserving_prod_div_swap [IsMulRightInvariant μ] :
    MeasurePreserving (fun z : G × G => (z.2, z.1 / z.2)) (μ.prod ν) (ν.prod μ)

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul₂ G]
(μ ν : MeasureTheory.Measure G)
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]
[MeasurableInv G]
[μ.IsMulRightInvariant]

MeasureTheory.MeasurePreserving (fun z => (z.2, z.1 / z.2)) (μ.prod ν) (ν.prod μ)


/-- A sequence of uniformly integrable functions which converges μ-a.e. converges in Lp. -/
theorem tendsto_Lp_finite_of_tendsto_ae_of_meas [IsFiniteMeasure μ] (hp : 1 ≤ p) (hp' : p ≠ ∞)
    {f : ℕ → α → β} {g : α → β} (hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g)
    (hg' : Memℒp g p μ) (hui : UnifIntegrable f p μ)
    (hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) :
    Tendsto (fun n => eLpNorm (f n - g) p μ) atTop (𝓝 0)

{f : ℕ → α → β}

(hf : ∀ (n : ℕ), MeasureTheory.StronglyMeasurable (f n))

(hg : MeasureTheory.StronglyMeasurable g)

(hui : MeasureTheory.UnifIntegrable f p μ)

(hfg : ∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun n => f n x) Filter.atTop (𝓝 (g x)))

Filter.Tendsto (fun n => MeasureTheory.eLpNorm (f n - g) p μ) Filter.atTop (𝓝 0)


/-- If for any three points `x < y < z`, the slope of the secant line of `f : 𝕜 → 𝕜` on `[x, y]` is
strictly less than the slope of the secant line of `f` on `[y, z]`, then `f` is strictly convex. -/
theorem strictConvexOn_of_slope_strict_mono_adjacent (hs : Convex 𝕜 s)
    (hf :
      ∀ {x y z : 𝕜},
        x ∈ s → z ∈ s → x < y → y < z → (f y - f x) / (y - x) < (f z - f y) / (z - y)) :
    StrictConvexOn 𝕜 s f


theorem dropWhile_cons :
    (x :: xs : List α).dropWhile p = if p x then xs.dropWhile p else x :: xs

{α : Type u_1}
{x : α}
{xs : List α}
{p : α → Bool}

List.dropWhile p (x :: xs) = if p x = true then List.dropWhile p xs else x :: xs


lemma isPullback_iff :
    sq.IsPullback ↔ Nonempty (IsLimit sq.pullbackCone)

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

sq.IsPullback ↔ Nonempty (CategoryTheory.Limits.IsLimit sq.pullbackCone)


@[rclike_simps] -- porting note (#10618): was `simp`
theorem I_mul_re (z : K) : re (I * z) = -im z


theorem im_div_exp_dist_le (z w : ℍ) : z.im / Real.exp (dist z w) ≤ w.im


/-- A submodule has dimension `1` if and only if there is a
single non-zero vector in the submodule such that the submodule is contained in
its span. -/
theorem rank_submodule_eq_one_iff (s : Submodule K V) [Module.Free K s] :
    Module.rank K s = 1 ↔ ∃ v₀ ∈ s, v₀ ≠ 0 ∧ s ≤ K ∙ v₀

{K : Type u}
{V : Type v}
[Ring K]
[StrongRankCondition K]
[AddCommGroup V]
[Module K V]
(s : Submodule K V)
[Module.Free K ↥s]

Module.rank K ↥s = 1 ↔ ∃ v₀ ∈ s, v₀ ≠ 0 ∧ s ≤ Submodule.span K {v₀}


/-- Lists are equivalent to the sigma type of tuples of a given length. -/
@[simps]
def equivSigmaTuple : List α ≃ Σn, Fin n → α

∀ (a : Fin l.length), (List.equivSigmaTuple l).snd a = l.get a


theorem ContinuousAt.of_dslope (h : ContinuousAt (dslope f a) b) : ContinuousAt f b

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → E}
{a b : 𝕜}
(h : ContinuousAt (dslope f a) b)


@[fun_prop]
theorem HasFDerivAt.const_mul (ha : HasFDerivAt a a' x) (b : 𝔸) :
    HasFDerivAt (fun y => b * a y) (b • a') x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{𝔸 : Type u_6}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{a : E → 𝔸}
{a' : E →L[𝕜] 𝔸}
(ha : HasFDerivAt a a' x)
(b : 𝔸)


theorem _root_.AlgebraicGeometry.exists_basicOpen_le_affine_inter
    {V : X.Opens} (hV : IsAffineOpen V) (x : X) (hx : x ∈ U ⊓ V) :
    ∃ (f : Γ(X, U)) (g : Γ(X, V)), X.basicOpen f = X.basicOpen g ∧ x ∈ X.basicOpen f

{X : AlgebraicGeometry.Scheme}
{U : X.Opens}
(hU : AlgebraicGeometry.IsAffineOpen U)
{V : X.Opens}
(hV : AlgebraicGeometry.IsAffineOpen V)
(x : ↑↑X.toPresheafedSpace)
(hx : x ∈ U ⊓ V)

∃ f g, X.basicOpen f = X.basicOpen g ∧ x ∈ X.basicOpen f


@[simp]
theorem equiv_ι (r : R) : CliffordAlgebraDualNumber.equiv (ι (R := R) _ r) = r • ε

CliffordAlgebraDualNumber.equiv ((CliffordAlgebra.ι 0) r) = r • DualNumber.eps


/-- If one controls the seminorm for every `x`, then one controls the seminorm.

Variant for functions `𝓢(ℝ, F)`. -/
theorem seminorm_le_bound' (k n : ℕ) (f : 𝓢(ℝ, F)) {M : ℝ} (hMp : 0 ≤ M)
    (hM : ∀ x, |x| ^ k * ‖iteratedDeriv n f x‖ ≤ M) : SchwartzMap.seminorm 𝕜 k n f ≤ M

(hM : ∀ (x : ℝ), |x| ^ k * ‖iteratedDeriv n (⇑f) x‖ ≤ M)


@[simp]
theorem dist_self_center (z : ℍ) (r : ℝ) :
    dist (z : ℂ) (z.center r) = z.im * (Real.cosh r - 1)

dist ↑z ↑(z.center r) = z.im * (Real.cosh r - 1)


theorem monomial_eq_mk (n : ℕ) (a : R) : monomial R n a = mk fun m => if m = n then a else 0

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

(PowerSeries.monomial R n) a = PowerSeries.mk fun m => if m = n then a else 0


theorem dedup_eq_cons (l : List α) (a : α) (l' : List α) :
    l.dedup = a :: l' ↔ a ∈ l ∧ a ∉ l' ∧ l.dedup.tail = l'

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


@[to_additive (attr := simp)]
theorem one_subset : 1 ⊆ s ↔ (1 : α) ∈ s


theorem toNat_lt (b : Bool) : b.toNat < 2


lemma biUnion_filter_eq_of_maps_to [DecidableEq α] {s : Finset α} {t : Finset β} {f : α → β}
    (h : ∀ x ∈ s, f x ∈ t) : (t.biUnion fun a ↦ s.filter fun c ↦ f c = a) = s

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

(t.biUnion fun a => Finset.filter (fun c => f c = a) s) = s


/-- The bundled derivative of a `C^{n+1}` function is `C^n`. -/
theorem contDiffOn_fderivWithin_apply {m n : ℕ∞} {s : Set E} {f : E → F} (hf : ContDiffOn 𝕜 n f s)
    (hs : UniqueDiffOn 𝕜 s) (hmn : m + 1 ≤ n) :
    ContDiffOn 𝕜 m (fun p : E × E => (fderivWithin 𝕜 f s p.1 : E →L[𝕜] F) p.2) (s ×ˢ univ)

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

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


@[to_additive]
theorem relindex_dvd_index_of_normal [H.Normal] : H.relindex K ∣ H.index

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


/-- **Intermediate value theorem**: if `f` is continuous on an order-connected set `s` and `a`,
`b` are two points of this set, then `f` sends `s` to a superset of `Icc (f x) (f y)`. -/
theorem ContinuousOn.surjOn_Icc {s : Set α} [hs : OrdConnected s] {f : α → δ}
    (hf : ContinuousOn f s) {a b : α} (ha : a ∈ s) (hb : b ∈ s) : SurjOn f s (Icc (f a) (f b))

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{δ : Type u_1}
[LinearOrder δ]
[TopologicalSpace δ]
[OrderClosedTopology δ]
{s : Set α}
[hs : s.OrdConnected]
{f : α → δ}
(hf : ContinuousOn f s)
{a b : α}
(ha : a ∈ s)
(hb : b ∈ s)


/-- `Module.IsTrivialRelation` is equivalent to the predicate `TensorProduct.VanishesTrivially`
defined in `Mathlib/LinearAlgebra/TensorProduct/Vanishing.lean`. -/
theorem isTrivialRelation_iff_vanishesTrivially :
    IsTrivialRelation f x ↔ VanishesTrivially R f x

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
{ι : Type u}
[Fintype ι]
{f : ι → R}
{x : ι → M}

Module.IsTrivialRelation f x ↔ TensorProduct.VanishesTrivially R f x


theorem Associated.dvd_iff_dvd_left [Monoid α] {a b c : α} (h : a ~ᵤ b) : a ∣ c ↔ b ∣ c

{α : Type u_1}
[Monoid α]
{a b c : α}
(h : a ~ᵤ b)


/-- Fixing submonoid of union is intersection -/
theorem fixingSubmonoid_union {s t : Set α} :
    fixingSubmonoid M (s ∪ t) = fixingSubmonoid M s ⊓ fixingSubmonoid M t

(M : Type u_1)
(α : Type u_2)
[Monoid M]
[MulAction M α]
{s t : Set α}


theorem hasConstantSpeedOnWith_zero_iff :
    HasConstantSpeedOnWith f s 0 ↔ ∀ᵉ (x ∈ s) (y ∈ s), edist (f x) (f y) = 0

{E : Type u_2}
[PseudoEMetricSpace E]
{f : ℝ → E}
{s : Set ℝ}

HasConstantSpeedOnWith f s 0 ↔ ∀ x ∈ s, ∀ y ∈ s, edist (f x) (f y) = 0


theorem Prime.ne_zero {n : ℕ} (h : Prime n) : n ≠ 0


/-- At `-n` for `n ∈ ℕ`, the Gamma function is undefined; by convention we assign it the value `0`.
-/
theorem Gamma_neg_nat_eq_zero (n : ℕ) : Gamma (-n) = 0


theorem coeFn_smul (c : 𝕜) (f : Lp E p μ) : ⇑(c • f) =ᵐ[μ] c • ⇑f

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{𝕜 : Type u_5}
[NormedRing 𝕜]
[Module 𝕜 E]
[BoundedSMul 𝕜 E]
(c : 𝕜)
(f : ↥(MeasureTheory.Lp E p μ))


theorem leadingCoeff_sub {Γ} [LinearOrder Γ] {x y : HahnSeries Γ R}
    (hxy : x.orderTop < y.orderTop) : (x - y).leadingCoeff = x.leadingCoeff

{R : Type u_2}
[AddGroup R]
{Γ : Type u_3}
[LinearOrder Γ]
{x y : HahnSeries Γ R}
(hxy : x.orderTop < y.orderTop)


theorem liftPropAt_congr_iff_of_eventuallyEq (h₁ : g' =ᶠ[𝓝 x] g) :
    LiftPropAt P g' x ↔ LiftPropAt P g x

{H : Type u_1}
{M : Type u_2}
{H' : Type u_3}
{M' : Type u_4}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
[TopologicalSpace H']
[TopologicalSpace M']
[ChartedSpace H' M']
{G : StructureGroupoid H}
{G' : StructureGroupoid H'}
{P : (H → H') → Set H → H → Prop}
{g g' : M → M'}
{x : M}
(hG : G.LocalInvariantProp G' P)
(h₁ : g' =ᶠ[𝓝 x] g)

ChartedSpace.LiftPropAt P g' x ↔ ChartedSpace.LiftPropAt P g x


/-- **Gelfand-Mazur theorem**: For a complex Banach division algebra, the natural `algebraMap ℂ A`
is an algebra isomorphism whose inverse is given by selecting the (unique) element of
`spectrum ℂ a`. In addition, `algebraMap_isometry` guarantees this map is an isometry.

Note: because `NormedDivisionRing` requires the field `norm_mul' : ∀ a b, ‖a * b‖ = ‖a‖ * ‖b‖`, we
don't use this type class and instead opt for a `NormedRing` in which the nonzero elements are
precisely the units. This allows for the application of this isomorphism in broader contexts, e.g.,
to the quotient of a complex Banach algebra by a maximal ideal. In the case when `A` is actually a
`NormedDivisionRing`, one may fill in the argument `hA` with the lemma `isUnit_iff_ne_zero`. -/
@[simps]
noncomputable def _root_.NormedRing.algEquivComplexOfComplete [CompleteSpace A] : ℂ ≃ₐ[ℂ] A

{A : Type u_2}
[NormedRing A]
[NormedAlgebra ℂ A]
(hA : ∀ {a : A}, IsUnit a ↔ a ≠ 0)
[CompleteSpace A]
(a : ℂ)

(NormedRing.algEquivComplexOfComplete hA) a = (algebraMap ℂ A) a


@[to_additive]
theorem pow_ne_one_of_lt_orderOf (n0 : n ≠ 0) (h : n < orderOf x) : x ^ n ≠ 1

{G : Type u_1}
[Monoid G]
{x : G}
{n : ℕ}
(n0 : n ≠ 0)
(h : n < orderOf x)


@[fun_prop]
theorem hasFDerivAt_sub_const {x : F} (c : F) : HasFDerivAt (· - c) (id 𝕜 F) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : F}
(c : F)

HasFDerivAt (fun x => x - c) (ContinuousLinearMap.id 𝕜 F) x


/-- An open upper half-plane (with boundary imaginary part given by an `EReal`) is an open set
in the complex plane. -/
lemma isOpen_im_gt_EReal (x : EReal) : IsOpen {z : ℂ | x < z.im}


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


theorem rel_cons_right {as b bs} :
    Rel r as (b ::ₘ bs) ↔ ∃ a as', r a b ∧ Rel r as' bs ∧ as = a ::ₘ as'

{α : Type u_1}
{β : Type v}
{r : α → β → Prop}
{as : Multiset α}
{b : β}
{bs : Multiset β}

Multiset.Rel r as (b ::ₘ bs) ↔ ∃ a as', r a b ∧ Multiset.Rel r as' bs ∧ as = a ::ₘ as'


theorem _root_.Algebra.adjoin_eq_range (s : Set S₁) :
    Algebra.adjoin R s = (MvPolynomial.aeval ((↑) : s → S₁)).range

(R : Type u)
{S₁ : Type v}
[CommSemiring R]
[CommSemiring S₁]
[Algebra R S₁]
(s : Set S₁)

Algebra.adjoin R s = (MvPolynomial.aeval Subtype.val).range


@[simp]
lemma dual_le_dual :
    dual A K I ≤ dual A K J ↔ J ≤ I

(A : Type u_1)
(K : Type u_2)
{L : Type u}
{B : Type u_3}
[CommRing A]
[Field K]
[CommRing B]
[Field L]
[Algebra A K]
[Algebra B L]
[Algebra A B]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsScalarTower A B L]
[IsDomain A]
[IsFractionRing A K]
[IsIntegralClosure B A L]
[IsFractionRing B L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
[IsIntegrallyClosed A]
[IsDedekindDomain B]
{I J : FractionalIdeal B⁰ L}
(hI : I ≠ 0)
(hJ : J ≠ 0)

FractionalIdeal.dual A K I ≤ FractionalIdeal.dual A K J ↔ J ≤ I


@[aesop apply safe (rule_sets := [CategoryTheory])]
theorem inv_eq_of_hom_inv_id {f : X ⟶ Y} [IsIso f] {g : Y ⟶ X} (hom_inv_id : f ≫ g = 𝟙 X) :
    inv f = g

(hom_inv_id : CategoryTheory.CategoryStruct.comp f g = CategoryTheory.CategoryStruct.id X)


/-- Given `Uᵢ ×[Z] Y`, this is the glued fibered product `X ×[Z] Y`. -/
@[simps U V f t t', simps (config := .lemmasOnly) J]
def gluing : Scheme.GlueData.{u}

[∀ (i : 𝒰.J), CategoryTheory.Limits.HasPullback (𝒰.map i ≫ f) g]

(AlgebraicGeometry.Scheme.Pullback.gluing 𝒰 f g).t' i j k = AlgebraicGeometry.Scheme.Pullback.t' 𝒰 f g i j k


@[simp]
theorem PiLp.inner_apply {ι : Type*} [Fintype ι] {f : ι → Type*} [∀ i, NormedAddCommGroup (f i)]
    [∀ i, InnerProductSpace 𝕜 (f i)] (x y : PiLp 2 f) : ⟪x, y⟫ = ∑ i, ⟪x i, y i⟫

{𝕜 : Type u_3}
[RCLike 𝕜]
{ι : Type u_8}
[Fintype ι]
{f : ι → Type u_9}
[(i : ι) → NormedAddCommGroup (f i)]
[(i : ι) → InnerProductSpace 𝕜 (f i)]
(x y : PiLp 2 f)


theorem uniformly_extend_spec [CompleteSpace γ] (a : α) : Tendsto f (comap e (𝓝 a)) (𝓝 (ψ a))

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[UniformSpace α]
[UniformSpace β]
[UniformSpace γ]
{e : β → α}
(h_e : UniformInducing e)
(h_dense : DenseRange e)
{f : β → γ}
(h_f : UniformContinuous f)
[CompleteSpace γ]
(a : α)

Filter.Tendsto f (Filter.comap e (𝓝 a)) (𝓝 (⋯.extend f a))


theorem orElse_eq_some' (o o' : Option α) (x : α) :
    o.orElse (fun _ ↦ o') = some x ↔ o = some x ∨ o = none ∧ o' = some x

{α : Type u_1}
(o o' : Option α)
(x : α)

(o.orElse fun x => o') = some x ↔ o = some x ∨ o = none ∧ o' = some x


/-- Let `f : ℝ → ℝ` be a differentiable function. If `f'` is strictly positive, then
`f` is a strictly monotone function. -/
lemma strictMono_of_hasDerivAt_pos {f f' : ℝ → ℝ} (hf : ∀ x, HasDerivAt f (f' x) x)
    (hf' : ∀ x, 0 < f' x) : StrictMono f

{f f' : ℝ → ℝ}
(hf : ∀ (x : ℝ), HasDerivAt f (f' x) x)
(hf' : ∀ (x : ℝ), 0 < f' x)


@[simp]
theorem mem_range (φ : F) {y : B} :
    y ∈ (NonUnitalAlgHom.range φ : NonUnitalSubalgebra R B) ↔ ∃ x : A, φ x = y

{F : Type v'}
{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[NonUnitalNonAssocSemiring B]
[Module R B]
[FunLike F A B]
[NonUnitalAlgHomClass F R A B]
(φ : F)
{y : B}

y ∈ NonUnitalAlgHom.range φ ↔ ∃ x, φ x = y


lemma inf_orthogonal_self_le_ker_restrict (b₁ : B.IsRefl) :
    W ⊓ B.orthogonal W ≤ (LinearMap.ker <| B.restrict W).map W.subtype

{V : Type u_5}
{K : Type u_6}
[Field K]
[AddCommGroup V]
[Module K V]
{B : LinearMap.BilinForm K V}
{W : Submodule K V}
(b₁ : B.IsRefl)

W ⊓ B.orthogonal W ≤ Submodule.map W.subtype (LinearMap.ker (B.restrict W))


/-- If `α` is a topological space and a preorder, `ClosedIciTopology α` means that `Ici a` is
closed for all `a : α`. -/
class ClosedIciTopology (α : Type*) [TopologicalSpace α] [Preorder α] : Prop where
  /-- For any `a`, the set `[a, +∞)` is closed. -/
  isClosed_Ici (a : α) : IsClosed (Ici a)

{α : Type u_1}
[TopologicalSpace α]
[Preorder α]
[self : ClosedIciTopology α]
(a : α)


@[to_additive] lemma commute_coe_inv : Commute (a : α) ↑a⁻¹

{α : Type u}
[AddMonoid α]
(a : AddUnits α)


theorem IsIntegral.det {n : Type*} [Fintype n] [DecidableEq n] {M : Matrix n n A}
    (h : ∀ i j, IsIntegral R (M i j)) : IsIntegral R M.det

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]
{n : Type u_5}
[Fintype n]
[DecidableEq n]
{M : Matrix n n A}
(h : ∀ (i j : n), IsIntegral R (M i j))


/-- Any mono factorisation of `f` gives a mono factorisation of `g ≫ f`. -/
@[simps]
def isoComp (F : MonoFactorisation f) {X' : C} (g : X' ⟶ X) : MonoFactorisation (g ≫ f)

(F : CategoryTheory.Limits.MonoFactorisation f)


@[simp]
theorem leftAdjointMate_id {X : C} [HasLeftDual X] : (ᘁ(𝟙 X)) = 𝟙 (ᘁX)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{X : C}
[CategoryTheory.HasLeftDual X]


/-- If `e : S₁ ≅ S₂` is an isomorphism of short complexes and `h₁ : HomologyData S₁`,
this is the homology data for `S₂` deduced from the isomorphism. -/
@[simps!]
noncomputable def ofIso (e : S₁ ≅ S₂) (h : HomologyData S₁)

(CategoryTheory.ShortComplex.HomologyData.ofIso e h).right.ι = h.right.ι


@[simp] theorem compl_lt_self [Nontrivial α] : xᶜ < x ↔ x = ⊤

{α : Type u}
{x : α}
[BooleanAlgebra α]
[Nontrivial α]


theorem nndist_midpoint_midpoint_le (p₁ p₂ p₃ p₄ : V) :
    nndist (midpoint ℝ p₁ p₂) (midpoint ℝ p₃ p₄) ≤ (nndist p₁ p₃ + nndist p₂ p₄) / 2

{V : Type u_2}
[SeminormedAddCommGroup V]
[NormedSpace ℝ V]
(p₁ p₂ p₃ p₄ : V)


/-- An invariant block is a fixed block -/
theorem IsInvariantBlock.isFixedBlock {B : Set X} (hfB : IsInvariantBlock G B) :
    IsFixedBlock G B

{G : Type u_1}
[Group G]
{X : Type u_2}
[MulAction G X]
{B : Set X}
(hfB : MulAction.IsInvariantBlock G B)


theorem coeFn_injective : @Injective (P₁ ≃ᵃ[k] P₂) (P₁ → P₂) (⇑)

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]


theorem naturality' (η : ApplicativeTransformation F G) (x : t (F α)) :
    η (sequence x) = sequence (@η _ <$> x)

{t : Type u → Type u}
[Traversable t]
[LawfulTraversable t]
{F G : Type u → Type u}
[Applicative F]
[LawfulApplicative F]
[Applicative G]
[LawfulApplicative G]
{α : Type u}
(η : ApplicativeTransformation F G)
(x : t (F α))

(fun {α} => η.app α) (sequence x) = sequence ((fun {α} => η.app α) <$> x)


/-- `exp (-b * x)` is integrable on `(a, ∞)`. -/
theorem exp_neg_integrableOn_Ioi (a : ℝ) {b : ℝ} (h : 0 < b) :
    IntegrableOn (fun x : ℝ => exp (-b * x)) (Ioi a)

MeasureTheory.IntegrableOn (fun x => rexp (-b * x)) (Set.Ioi a) MeasureTheory.volume


theorem infinitePos_omega : InfinitePos ω


@[simp]
theorem coe_sumMap {α β γ δ} (e₁ : α ↪ β) (e₂ : γ ↪ δ) : sumMap e₁ e₂ = Sum.map e₁ e₂

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
(e₁ : α ↪ β)
(e₂ : γ ↪ δ)


/-- Split coequalizers are absolute: they are preserved by any functor. -/
@[simps]
def IsSplitCoequalizer.map {Z : C} {π : Y ⟶ Z} (q : IsSplitCoequalizer f g π) (F : C ⥤ D) :
    IsSplitCoequalizer (F.map f) (F.map g) (F.map π)

(q : CategoryTheory.IsSplitCoequalizer f g π)

(q.map F).leftSection = F.map q.leftSection


lemma prod {C₁ C₂ : Type*} [Category C₁] [Category C₂]
    {W₁ : MorphismProperty C₁} {W₂ : MorphismProperty C₂}
    {E₁ E₂ : Type*} [Category E₁] [Category E₂] {F₁ : C₁ ⥤ E₁} {F₂ : C₂ ⥤ E₂}
    (h₁ : W₁.IsInvertedBy F₁) (h₂ : W₂.IsInvertedBy F₂) :
    (W₁.prod W₂).IsInvertedBy (F₁.prod F₂)

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}


@[norm_cast]
theorem coe_sum {ι : Type*} {s : Finset ι} (a : ι → R) :
    ↑(∑ i ∈ s, a i) = ∑ i ∈ s, (↑(a i) : A)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommSemiring A]
[Algebra R A]
{ι : Type u_3}
{s : Finset ι}
(a : ι → R)


theorem csInf_image_le {s : Set α} {c : α} (hcs : c ∈ s) (h_bdd : BddBelow s) :
    sInf (f '' s) ≤ f c

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[ConditionallyCompleteLattice β]
{f : α → β}
(h_mono : Monotone f)
{s : Set α}
{c : α}
(hcs : c ∈ s)
(h_bdd : BddBelow s)


theorem ppow_mul_assoc (k m n : ℕ+) (x : M) :
    (x ^ k * x ^ m) * x ^ n = x ^ k * (x ^ m * x ^ n)

{M : Type u_1}
[Mul M]
[Pow M ℕ+]
[PNatPowAssoc M]
(k m n : ℕ+)
(x : M)


theorem Indep.finite [FiniteRk M] (hI : M.Indep I) : I.Finite

{α : Type u_1}
{M : Matroid α}
{I : Set α}
[M.FiniteRk]
(hI : M.Indep I)


theorem pow_right_mono {I J : Ideal R} (e : I ≤ J) (n : ℕ) : I ^ n ≤ J ^ n

{R : Type u}
[CommSemiring R]
{I J : Ideal R}
(e : I ≤ J)
(n : ℕ)


@[ext high]
theorem addHom_ext' {M : Type*} [AddMonoid M] {f g : R[X] →+ M}
    (h : ∀ n, f.comp (monomial n).toAddMonoidHom = g.comp (monomial n).toAddMonoidHom) : f = g

(h : ∀ (n : ℕ), f.comp (Polynomial.monomial n).toAddMonoidHom = g.comp (Polynomial.monomial n).toAddMonoidHom)


@[reassoc]
theorem prod.leftUnitor_hom_naturality [HasBinaryProducts C] (f : X ⟶ Y) :
    prod.map (𝟙 _) f ≫ (prod.leftUnitor Y).hom = (prod.leftUnitor X).hom ≫ f

CategoryTheory.Limits.prod.map (𝟙 (⊤_ C)) f ≫ (CategoryTheory.Limits.prod.leftUnitor Y).hom =
  (CategoryTheory.Limits.prod.leftUnitor X).hom ≫ f


@[simp]
theorem isClosed_image (e : M₁ ≃SL[σ₁₂] M₂) {s : Set M₁} : IsClosed (e '' s) ↔ IsClosed s

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{σ₂₁ : R₂ →+* R₁}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
(e : M₁ ≃SL[σ₁₂] M₂)
{s : Set M₁}


@[simp] theorem equivCongr_refl {α β} :
    (Equiv.refl α).equivCongr (Equiv.refl β) = Equiv.refl (α ≃ β)


@[simp]
theorem derivedSeriesOfIdeal_zero : derivedSeriesOfIdeal R L 0 I = I

(R : Type u)
(L : Type v)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(I : LieIdeal R L)

LieAlgebra.derivedSeriesOfIdeal R L 0 I = I


/-- If the field `L` is an algebraic extension of the integral domain `A`,
the integral closure of `A` in `L` has fraction field `L`. -/
theorem isFractionRing_of_algebraic [Algebra A L] [Algebra.IsAlgebraic A L]
    (inj : ∀ x, algebraMap A L x = 0 → x = 0) : IsFractionRing (integralClosure A L) L

(inj : ∀ (x : A), (algebraMap A L) x = 0 → x = 0)

IsFractionRing (↥(integralClosure A L)) L


theorem mapsTo_emetric_ball (hf : Isometry f) (x : α) (r : ℝ≥0∞) :
    MapsTo f (EMetric.ball x r) (EMetric.ball (f x) r)

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{f : α → β}
(hf : Isometry f)
(x : α)
(r : ℝ≥0∞)

Set.MapsTo f (EMetric.ball x r) (EMetric.ball (f x) r)


@[to_additive (attr := simp)]
theorem tprod_one : ∏' _ : β, (1 : α) = 1

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]


theorem pentagon (W X Y Z : C) :
    tensorHom ℬ (BinaryFan.associatorOfLimitCone ℬ W X Y).hom (𝟙 Z) ≫
        (BinaryFan.associatorOfLimitCone ℬ W (tensorObj ℬ X Y) Z).hom ≫
          tensorHom ℬ (𝟙 W) (BinaryFan.associatorOfLimitCone ℬ X Y Z).hom =
      (BinaryFan.associatorOfLimitCone ℬ (tensorObj ℬ W X) Y Z).hom ≫
        (BinaryFan.associatorOfLimitCone ℬ W X (tensorObj ℬ Y Z)).hom

(ℬ : (X Y : C) → CategoryTheory.Limits.LimitCone (CategoryTheory.Limits.pair X Y))

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalOfChosenFiniteProducts.tensorHom ℬ
      (CategoryTheory.Limits.BinaryFan.associatorOfLimitCone ℬ W X Y).hom (CategoryTheory.CategoryStruct.id Z))
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Limits.BinaryFan.associatorOfLimitCone ℬ W
          (CategoryTheory.MonoidalOfChosenFiniteProducts.tensorObj ℬ X Y) Z).hom
      (CategoryTheory.MonoidalOfChosenFiniteProducts.tensorHom ℬ (CategoryTheory.CategoryStruct.id W)
        (CategoryTheory.Limits.BinaryFan.associatorOfLimitCone ℬ X Y Z).hom)) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Limits.BinaryFan.associatorOfLimitCone ℬ
        (CategoryTheory.MonoidalOfChosenFiniteProducts.tensorObj ℬ W X) Y Z).hom
    (CategoryTheory.Limits.BinaryFan.associatorOfLimitCone ℬ W X
        (CategoryTheory.MonoidalOfChosenFiniteProducts.tensorObj ℬ Y Z)).hom


/-- A minimal polynomial is nonzero. -/
theorem ne_zero [Nontrivial A] (hx : IsIntegral A x) : minpoly A x ≠ 0

{A : Type u_1}
{B : Type u_2}
[CommRing A]
[Ring B]
[Algebra A B]
{x : B}
[Nontrivial A]
(hx : IsIntegral A x)


/-- Change of variables for continuous integrands. If `f` is continuous on `[a, b]` and has
continuous right-derivative `f'` in `(a, b)`, and `g` is continuous on `f '' [a, b]` then we can
substitute `u = f x` to get `∫ x in a..b, (g ∘ f) x * f' x = ∫ u in f a..f b, g u`.
-/
theorem integral_comp_mul_deriv'' {f f' g : ℝ → ℝ} (hf : ContinuousOn f [[a, b]])
    (hff' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivWithinAt f (f' x) (Ioi x) x)
    (hf' : ContinuousOn f' [[a, b]]) (hg : ContinuousOn g (f '' [[a, b]])) :
    (∫ x in a..b, (g ∘ f) x * f' x) = ∫ u in f a..f b, g u

(hff' : ∀ x ∈ Set.Ioo (min a b) (max a b), HasDerivWithinAt f (f' x) (Set.Ioi x) x)

∫ (x : ℝ) in a..b, (g ∘ f) x * f' x = ∫ (u : ℝ) in f a..f b, g u


/-- If every finite diagram in `C` admits a cone, then `C` is cofiltered. It is sufficient to
    verify this for diagrams whose shape lives in any one fixed universe. -/
theorem of_cone_nonempty (h : ∀ {J : Type w} [SmallCategory J] [FinCategory J] (F : J ⥤ C),
    Nonempty (Cone F)) : IsCofiltered C

(h :
  ∀ {J : Type w} [inst : CategoryTheory.SmallCategory J] [inst_1 : CategoryTheory.FinCategory J]
    (F : CategoryTheory.Functor J C), Nonempty (CategoryTheory.Limits.Cone F))


protected lemma Coprime.disjoint_primeFactors (hab : Coprime a b) :
    Disjoint a.primeFactors b.primeFactors


@[simp]
theorem map_mapAccumr (f₁ : β → γ) :
    (map f₁ (mapAccumr f₂ xs s).snd) = (mapAccumr (fun x s =>
        let r := (f₂ x s); (r.fst, f₁ r.snd)
      ) xs s).snd

{α : Type u_3}
{n : ℕ}
{β : Type u_2}
{γ : Type u_1}
{σ₂ : Type}
(xs : Mathlib.Vector α n)
(f₂ : α → σ₂ → σ₂ × β)
{s : σ₂}
(f₁ : β → γ)

Mathlib.Vector.map f₁ (Mathlib.Vector.mapAccumr f₂ xs s).2 =
  (Mathlib.Vector.mapAccumr
      (fun x s =>
        let r := f₂ x s;
        (r.1, f₁ r.2))
      xs s).2


theorem sup_eq_sup_smul_of_le_smul_of_le_jacobson {I J : Ideal R} {N N' : Submodule R M}
    (hN' : N'.FG) (hIJ : I ≤ jacobson J) (hNN : N' ≤ N ⊔ I • N') : N ⊔ N' = N ⊔ J • N'

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{I J : Ideal R}
{N N' : Submodule R M}
(hN' : N'.FG)
(hIJ : I ≤ J.jacobson)
(hNN : N' ≤ N ⊔ I • N')


/-- Given a cocone `c : Cocone K` and a map `f : F.obj c.X ⟶ X`, we can construct a cocone of
    costructured arrows over `X` with `f` as the cone point. -/
@[simps]
def Cocone.toCostructuredArrowCocone {K : J ⥤ C} (c : Cocone K) (F : C ⥤ D) {X : D}
    (f : F.obj c.pt ⟶ X) : Cocone ((F.mapCocone c).toCostructuredArrow ⋙
      CostructuredArrow.map f ⋙ CostructuredArrow.pre _ _ _)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
{K : CategoryTheory.Functor J C}
(c : CategoryTheory.Limits.Cocone K)
(F : CategoryTheory.Functor C D)
{X : D}
(f : F.obj c.pt ⟶ X)
(j : J)

(c.toCostructuredArrowCocone F f).ι.app j = CategoryTheory.CostructuredArrow.homMk (c.ι.app j) ⋯


@[to_additive]
theorem mem_closure_union_iff {G : Type*} [CommGroup G] {s t : Set G} {x : G} :
    x ∈ closure (s ∪ t) ↔ ∃ y ∈ closure s, ∃ z ∈ closure t, y * z = x

{G : Type u_4}
[AddCommGroup G]
{s t : Set G}
{x : G}

x ∈ AddGroup.closure (s ∪ t) ↔ ∃ y ∈ AddGroup.closure s, ∃ z ∈ AddGroup.closure t, y + z = x


@[simp] theorem msb_cons : (cons a x).msb = a

∀ {w : Nat} {x : BitVec w}, (BitVec.cons a x).msb = a


/-- **Phragmen-Lindelöf principle** in the third quadrant. Let `f g : ℂ → E` be functions such that

* `f` and `g` are differentiable in the open third quadrant and are continuous on its closure;
* `‖f z‖` and `‖g z‖` are bounded from above by `A * exp(B * (abs z) ^ c)` on the open third
  quadrant for some `A`, `B`, and `c < 2`;
* `f` is equal to `g` on the boundary of the third quadrant.

Then `f` is equal to `g` on the closed third quadrant. -/
theorem eqOn_quadrant_III (hdf : DiffContOnCl ℂ f (Iio 0 ×ℂ Iio 0))
    (hBf : ∃ c < (2 : ℝ), ∃ B,
      f =O[cobounded ℂ ⊓ 𝓟 (Iio 0 ×ℂ Iio 0)] fun z => expR (B * abs z ^ c))
    (hdg : DiffContOnCl ℂ g (Iio 0 ×ℂ Iio 0))
    (hBg : ∃ c < (2 : ℝ), ∃ B,
      g =O[cobounded ℂ ⊓ 𝓟 (Iio 0 ×ℂ Iio 0)] fun z => expR (B * abs z ^ c))
    (hre : ∀ x : ℝ, x ≤ 0 → f x = g x) (him : ∀ x : ℝ, x ≤ 0 → f (x * I) = g (x * I)) :
    EqOn f g {z | z.re ≤ 0 ∧ z.im ≤ 0}

(hdf : DiffContOnCl ℂ f (Set.Iio 0 ×ℂ Set.Iio 0))

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

(hdg : DiffContOnCl ℂ g (Set.Iio 0 ×ℂ Set.Iio 0))

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

(him : ∀ x ≤ 0, f (↑x * Complex.I) = g (↑x * Complex.I))


@[simp]
theorem prod_fst_snd : prod (fst R A B) (snd R A B) = 1

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[Monoid R]
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]
[Star B]

(NonUnitalStarAlgHom.fst R A B).prod (NonUnitalStarAlgHom.snd R A B) = 1


@[to_additive (attr := norm_cast)] -- Porting note (#10618): removed `simp`, `simp` can prove it
theorem coe_finset_prod {ι M} [CommMonoid M] [SetLike B M] [SubmonoidClass B M] (f : ι → S)
    (s : Finset ι) : ↑(∏ i ∈ s, f i) = (∏ i ∈ s, f i : M)

{B : Type u_3}
{S : B}
{ι : Type u_4}
{M : Type u_5}
[AddCommMonoid M]
[SetLike B M]
[AddSubmonoidClass B M]
(f : ι → ↥S)
(s : Finset ι)


protected theorem IsExtreme.rfl : IsExtreme 𝕜 A A

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
{A : Set E}


@[simp]
theorem comp_continuousOn_iff {f : α → E} {s : Set α} : ContinuousOn (e ∘ f) s ↔ ContinuousOn f s

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(e : E ≃ₛₗᵢ[σ₁₂] E₂)
{α : Type u_11}
[TopologicalSpace α]
{f : α → E}
{s : Set α}

ContinuousOn (⇑e ∘ f) s ↔ ContinuousOn f s


/-- The inverse of a map which preserves multiplication,
preserves multiplication when the target is commutative. -/
@[to_additive
      "The negation of a map which preserves addition, preserves addition when
      the target is commutative."]
theorem inv {α β} [Mul α] [CommGroup β] {f : α → β} (hf : IsMulHom f) : IsMulHom fun a => (f a)⁻¹

{α : Type u_2}
{β : Type u_3}
[Add α]
[AddCommGroup β]
{f : α → β}
(hf : IsAddHom f)


/-- The 1-morphism `h` commutes with the left Kan extension `f⁺ g`. -/
@[simps!]
def lanCompIso : f⁺ (g ≫ h) ≅ f⁺ g ≫ h

[CategoryTheory.Bicategory.Lan.CommuteWith f g h]

(CategoryTheory.Bicategory.Lan.CommuteWith.lanCompIso f g h).inv =
  (CategoryTheory.Bicategory.Lan.CommuteWith.isKan f g h).desc
    (CategoryTheory.Bicategory.lanLeftExtension f (CategoryTheory.CategoryStruct.comp g h))


/-- The (open) thickening `Metric.thickening δ E` with a fixed thickening radius `δ` is
an increasing function of the subset `E`. -/
theorem thickening_subset_of_subset (δ : ℝ) {E₁ E₂ : Set α} (h : E₁ ⊆ E₂) :
    thickening δ E₁ ⊆ thickening δ E₂

{α : Type u}
[PseudoEMetricSpace α]
(δ : ℝ)
{E₁ E₂ : Set α}
(h : E₁ ⊆ E₂)

Metric.thickening δ E₁ ⊆ Metric.thickening δ E₂


lemma ceilDiv_def (f : ∀ i, π i) (a : α) : f ⌈/⌉ a = fun i ↦ f i ⌈/⌉ a

{ι : Type u_1}
{α : Type u_2}
{π : ι → Type u_4}
[OrderedAddCommMonoid α]
[(i : ι) → OrderedAddCommMonoid (π i)]
[(i : ι) → SMulZeroClass α (π i)]
[(i : ι) → CeilDiv α (π i)]
(f : (i : ι) → π i)
(a : α)


theorem LowerSemicontinuousAt.lowerSemicontinuousWithinAt (s : Set α)
    (h : LowerSemicontinuousAt f x) : LowerSemicontinuousWithinAt f s x

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{f : α → β}
{x : α}
(s : Set α)
(h : LowerSemicontinuousAt f x)


@[simp]
theorem image_empty : r.image ∅ = ∅

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


theorem sound {a b : Vector α n} (h : a.val ~ b.val) : (↑a : Sym α n) = ↑b

{α : Type u_1}
{n : ℕ}
{a b : Mathlib.Vector α n}
(h : (↑a).Perm ↑b)


@[simp]
theorem realize_transitive : M ⊨ r.transitive ↔ Transitive fun x y : M => RelMap r ![x, y]

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{r : L.Relations 2}

M ⊨ r.transitive ↔ Transitive fun x y => FirstOrder.Language.Structure.RelMap r ![x, y]


@[simp]
theorem argmin_singleton {f : α → β} {a : α} : argmin f [a] = a

{α : Type u_1}
{β : Type u_2}
[Preorder β]
[DecidableRel fun x x_1 => x < x_1]
{f : α → β}
{a : α}


@[to_additive]
theorem coeFn_one [One β] : ⇑(1 : α →ₘ[μ] β) =ᵐ[μ] 1

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace β]
[Zero β]


theorem congr_nhdsWithin' {s : Set H} {x : H} {f g : H → H'} (h1 : f =ᶠ[𝓝[s] x] g) (h2 : f x = g x)
    (hP : P g s x) : P f s x

{H : Type u_1}
{H' : Type u_3}
[TopologicalSpace H]
[TopologicalSpace H']
{G : StructureGroupoid H}
{G' : StructureGroupoid H'}
{P : (H → H') → Set H → H → Prop}
(hG : G.LocalInvariantProp G' P)
{s : Set H}
{x : H}
{f g : H → H'}
(h1 : f =ᶠ[𝓝[s] x] g)
(h2 : f x = g x)
(hP : P g s x)


theorem ext {g h : M ⊗[R] N →ₗ[A] P} (H : ∀ x y, g (x ⊗ₜ y) = h (x ⊗ₜ y)) : g = h


/-- The multiplicative equivalence between the type of units of `M` and the submonoid of unit
elements of `M`. -/
@[to_additive (attr := simps!) " The additive equivalence between the type of additive units of `M`
  and the additive submonoid whose elements are the additive units of `M`. "]
noncomputable def unitsTypeEquivIsUnitSubmonoid [Monoid M] : Mˣ ≃* IsUnit.submonoid M

{M : Type u_1}
[AddMonoid M]
(x : ↥(IsAddUnit.addSubmonoid M))

↑(AddSubmonoid.addUnitsTypeEquivIsAddUnitAddSubmonoid.symm x) = ↑x


protected theorem ContinuousLinearMap.fderivWithin (hxs : UniqueDiffWithinAt 𝕜 s x) :
    fderivWithin 𝕜 e s x = e

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(e : E →L[𝕜] F)
{x : E}
{s : Set E}
(hxs : UniqueDiffWithinAt 𝕜 s x)


@[simp] lemma lor_eq_or (p q : Num) : p.lor q = p ||| q


theorem trailingDegree_mul : (p * q).trailingDegree = p.trailingDegree + q.trailingDegree

{R : Type u}
[Semiring R]
[NoZeroDivisors R]
{p q : R[X]}


/-- A version of `dist_le_Ico_sum_dist` with each intermediate distance replaced
with an upper estimate. -/
theorem dist_le_Ico_sum_of_dist_le {f : ℕ → α} {m n} (hmn : m ≤ n) {d : ℕ → ℝ}
    (hd : ∀ {k}, m ≤ k → k < n → dist (f k) (f (k + 1)) ≤ d k) :
    dist (f m) (f n) ≤ ∑ i ∈ Finset.Ico m n, d i

(hd : ∀ {k : ℕ}, m ≤ k → k < n → dist (f k) (f (k + 1)) ≤ d k)


theorem compare_gt_iff_gt {a b : α} : (compare a b = .gt) ↔ a > b


@[simp]
theorem sign_coe_pi_div_two : (↑(π / 2) : Angle).sign = 1


@[simp, norm_cast] lemma coe_sdiff (s t : Clopens α) : ↑(s \ t) = (s \ t : Set α)

{α : Type u_2}
[TopologicalSpace α]
(s t : TopologicalSpace.Clopens α)


theorem map_one_of_isOneCocycle {f : G → A} (hf : IsOneCocycle f) :
    f 1 = 0

{G : Type u_1}
{A : Type u_2}
[Monoid G]
[AddCommGroup A]
[MulAction G A]
{f : G → A}
(hf : groupCohomology.IsOneCocycle f)


private theorem lintegral_rpow_sum_coe_nnnorm_sub_le_rpow_tsum
    {f : ℕ → α → E} {p : ℝ} (hp1 : 1 ≤ p) {B : ℕ → ℝ≥0∞} (n : ℕ)
    (hn : eLpNorm' (fun x => ∑ i ∈ Finset.range (n + 1), ‖f (i + 1) x - f i x‖) p μ ≤ ∑' i, B i) :
    (∫⁻ a, (∑ i ∈ Finset.range (n + 1), ‖f (i + 1) a - f i a‖₊ : ℝ≥0∞) ^ p ∂μ) ≤
      (∑' i, B i) ^ p

{B : ℕ → ℝ≥0∞}

(hn : MeasureTheory.eLpNorm' (fun x => ∑ i ∈ Finset.range (n + 1), ‖f (i + 1) x - f i x‖) p μ ≤ ∑' (i : ℕ), B i)

∫⁻ (a : α), (∑ i ∈ Finset.range (n + 1), ↑‖f (i + 1) a - f i a‖₊) ^ p ∂μ ≤ (∑' (i : ℕ), B i) ^ p


@[to_additive]
theorem lt_inv_iff_mul_lt_one : a < b⁻¹ ↔ a * b < 1

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


lemma mor₂_eq_zero_iff_mono₃ : T.mor₂ = 0 ↔ Mono T.mor₃

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


theorem is_id (f : MvPolynomial σ R →+* MvPolynomial σ R) (hC : f.comp C = C)
    (hX : ∀ n : σ, f (X n) = X n) (p : MvPolynomial σ R) : f p = p

(hC : f.comp MvPolynomial.C = MvPolynomial.C)

(hX : ∀ (n : σ), f (MvPolynomial.X n) = MvPolynomial.X n)


theorem pair_eq_pair_iff {x y z w : α} :
    ({x, y} : Set α) = {z, w} ↔ x = z ∧ y = w ∨ x = w ∧ y = z

{x, y} = {z, w} ↔ x = z ∧ y = w ∨ x = w ∧ y = z


theorem exists_eq_add_of_le {n : ℕ} {a b : Fin n} (h : a ≤ b) : ∃ k ≤ b, b = a + k


/-- Pointwise supremum of two monotone functions is a monotone function. -/
protected theorem sup [Preorder α] [SemilatticeSup β] {f g : α → β} {s : Set α}
    (hf : MonotoneOn f s) (hg : MonotoneOn g s) : MonotoneOn (f ⊔ g) s

{α : Type u}
{β : Type v}
[Preorder α]
[SemilatticeSup β]
{f g : α → β}
{s : Set α}
(hf : MonotoneOn f s)
(hg : MonotoneOn g s)


@[to_additive]
theorem aemeasurable_const_smul_iff (c : G) :
    AEMeasurable (fun x => c • f x) μ ↔ AEMeasurable f μ

{β : Type u_3}
{α : Type u_4}
[MeasurableSpace β]
[MeasurableSpace α]
{f : α → β}
{μ : MeasureTheory.Measure α}
{G : Type u_5}
[Group G]
[MeasurableSpace G]
[MulAction G β]
[MeasurableSMul G β]
(c : G)


@[to_additive]
theorem ContinuousInv.of_nhds_one {G : Type*} [Group G] [TopologicalSpace G]
    (hinv : Tendsto (fun x : G => x⁻¹) (𝓝 1) (𝓝 1))
    (hleft : ∀ x₀ : G, 𝓝 x₀ = map (fun x : G => x₀ * x) (𝓝 1))
    (hconj : ∀ x₀ : G, Tendsto (fun x : G => x₀ * x * x₀⁻¹) (𝓝 1) (𝓝 1)) : ContinuousInv G

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

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

(hconj : ∀ (x₀ : G), Filter.Tendsto (fun x => x₀ + x + -x₀) (𝓝 0) (𝓝 0))


theorem const_eq (a : α) : const a = a::const a

Stream'.const a = Stream'.cons a (Stream'.const a)


theorem getElem!_neg [GetElem? cont idx elem dom] [LawfulGetElem cont idx elem dom]
    [Inhabited elem] (c : cont) (i : idx) (h : ¬dom c i) [Decidable (dom c i)] : c[i]! = default

{cont : Type u_1}
{idx : Type u_2}
{elem : Type u_3}
{dom : cont → idx → Prop}
[GetElem? cont idx elem dom]
[LawfulGetElem cont idx elem dom]
[Inhabited elem]
(c : cont)
(i : idx)
(h : ¬dom c i)
[Decidable (dom c i)]


theorem sup'_induction {p : α → Prop} (hp : ∀ a₁, p a₁ → ∀ a₂, p a₂ → p (a₁ ⊔ a₂))
    (hs : ∀ b ∈ s, p (f b)) : p (s.sup' H f)

(hp : ∀ (a₁ : α), p a₁ → ∀ (a₂ : α), p a₂ → p (a₁ ⊔ a₂))


@[simp]
theorem map_principal {s : Set α} {f : α → β} : map f (𝓟 s) = 𝓟 (Set.image f s)

{α : Type u}
{β : Type v}
{s : Set α}
{f : α → β}


private lemma z_spec : S.a + η ^ 2 * S.b = λ * S.z

(S : FermatLastTheoremForThreeGen.Solution hζ)

S.a + ↑⋯.unit ^ 2 * S.b = (hζ.toInteger - 1) * FermatLastTheoremForThreeGen.Solution.z S


theorem isOpen_extend_preimage {s : Set E} (hs : IsOpen s) :
    IsOpen (f.source ∩ f.extend I ⁻¹' s)

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(f : PartialHomeomorph M H)
(I : ModelWithCorners 𝕜 E H)
{s : Set E}
(hs : IsOpen s)


lemma isZero_single_obj_X (j : ι) (A : V) (i : ι) (hi : i ≠ j) :
    IsZero (((single V c j).obj A).X i)

CategoryTheory.Limits.IsZero (((HomologicalComplex.single V c j).obj A).X i)


theorem ContinuousAt.comp_upperSemicontinuousAt {g : γ → δ} {f : α → γ} (hg : ContinuousAt g (f x))
    (hf : UpperSemicontinuousAt f x) (gmon : Monotone g) : UpperSemicontinuousAt (g ∘ f) x

{α : Type u_1}
[TopologicalSpace α]
{x : α}
{γ : Type u_3}
[LinearOrder γ]
[TopologicalSpace γ]
[OrderTopology γ]
{δ : Type u_4}
[LinearOrder δ]
[TopologicalSpace δ]
[OrderTopology δ]
{g : γ → δ}
{f : α → γ}
(hg : ContinuousAt g (f x))
(hf : UpperSemicontinuousAt f x)
(gmon : Monotone g)


/-- For a presheaf `P`, consider the forgetful functor from the category of representable
    presheaves over `P` to the category of presheaves. There is a tautological cocone over this
    functor whose leg for a natural transformation `V ⟶ P` with `V` representable is just that
    natural transformation. -/
@[simps]
def tautologicalCocone : Cocone (CostructuredArrow.proj yoneda P ⋙ yoneda)

(P : CategoryTheory.Functor Cᵒᵖ (Type v₁))

(X : CategoryTheory.CostructuredArrow CategoryTheory.yoneda P)

(CategoryTheory.Presheaf.tautologicalCocone P).ι.app X = X.hom


@[simp]
theorem bliminf_sup_le_or_aux_right : blimsup u f q ≤ blimsup u f fun x => p x ∨ q x

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

Filter.blimsup u f q ≤ Filter.blimsup u f fun x => p x ∨ q x


/-- The composition `l ∘ f` where `l : F → E` and `f : 𝕜 → F`, has a derivative within a set
equal to the Fréchet derivative of `l` applied to the derivative of `f`. -/
theorem HasFDerivWithinAt.comp_hasDerivWithinAt {t : Set F} (hl : HasFDerivWithinAt l l' t (f x))
    (hf : HasDerivWithinAt f f' s x) (hst : MapsTo f s t) :
    HasDerivWithinAt (l ∘ f) (l' f') s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → F}
{f' : F}
(x : 𝕜)
{s : Set 𝕜}
{l : F → E}
{l' : F →L[𝕜] E}
{t : Set F}
(hl : HasFDerivWithinAt l l' t (f x))
(hf : HasDerivWithinAt f f' s x)
(hst : Set.MapsTo f s t)


@[simp]
theorem Ico_diff_left : Ico a b \ {a} = Ioo a b

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


theorem add_div_eq_mul_add_div (a b : α) (hc : c ≠ 0) : a + b / c = (a * c + b) / c

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


@[ext]
theorem ext : ∀ {s t : Finmap β}, s.entries = t.entries → s = t

{α : Type u}
{β : α → Type v}
{s t : Finmap β}


/-- If two additive homomorphisms from `⨁ i, β i` are equal on each `of β i y`,
then they are equal. -/
theorem addHom_ext {γ : Type*} [AddMonoid γ] ⦃f g : (⨁ i, β i) →+ γ⦄
    (H : ∀ (i : ι) (y : β i), f (of _ i y) = g (of _ i y)) : f = g

(H : ∀ (i : ι) (y : β i), f ((DirectSum.of β i) y) = g ((DirectSum.of β i) y))


lemma nonsingular_of_Z_eq_zero {P : Fin 3 → R} (hPz : P z = 0) :
    W'.Nonsingular P ↔ W'.Equation P ∧ (3 * P x ^ 2 ≠ 0 ∨ 2 * P y ≠ 0 ∨ W'.a₁ * P x * P y ≠ 0)

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{P : Fin 3 → R}
(hPz : P z = 0)


theorem mono {ν : Measure α} {φ : ι → Set α} (hφ : AECover μ l φ) (hle : ν ≤ μ) :
    AECover ν l φ

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


@[simp] theorem mul_fdiv_cancel (a : Int) {b : Int} (H : b ≠ 0) : fdiv (a * b) b = a


@[simp, mfld_simps]
theorem tangentMap_prod_snd {p : TangentBundle (I.prod I') (M × M')} :
    tangentMap (I.prod I') I' Prod.snd p = ⟨p.proj.2, p.2.2⟩

tangentMap (I.prod I') I' Prod.snd p = { proj := p.proj.2, snd := p.snd.2 }


@[simp]
theorem sdiff_singleton_eq_self (ha : a ∉ s) : s \ {a} = s

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


theorem mem_univ_val : ∀ x, x ∈ (univ : Finset α).1


theorem two_nsmul_toReal_eq_two_mul_add_two_pi {θ : Angle} :
    ((2 : ℕ) • θ).toReal = 2 * θ.toReal + 2 * π ↔ θ.toReal ≤ -π / 2

(2 • θ).toReal = 2 * θ.toReal + 2 * π ↔ θ.toReal ≤ -π / 2


@[simp]
lemma comap_mul_left_cobounded {a : α} (ha : a ≠ 0) :
    comap (a * ·) (cobounded α) = cobounded α

{α : Type u_1}
[NormedDivisionRing α]
{a : α}
(ha : a ≠ 0)

Filter.comap (fun x => a * x) (Bornology.cobounded α) = Bornology.cobounded α


theorem memℓp_gen' {C : ℝ} {f : ∀ i, E i} (hf : ∀ s : Finset α, ∑ i ∈ s, ‖f i‖ ^ p.toReal ≤ C) :
    Memℓp f p

(hf : ∀ (s : Finset α), ∑ i ∈ s, ‖f i‖ ^ p.toReal ≤ C)


theorem Primrec.nat_sqrt : Primrec Nat.sqrt


theorem inv_le_inv₀ (ha : a ≠ 0) (hb : b ≠ 0) : a⁻¹ ≤ b⁻¹ ↔ b ≤ a

{α : Type u_1}
[LinearOrderedCommGroupWithZero α]
{a b : α}
(ha : a ≠ 0)
(hb : b ≠ 0)

a⁻¹ ≤ b⁻¹ ↔ b ≤ a


theorem toConjAct_mul (x y : G) : toConjAct (x * y) = toConjAct x * toConjAct y

{G : Type u_3}
[DivInvMonoid G]
(x y : G)

ConjAct.toConjAct (x * y) = ConjAct.toConjAct x * ConjAct.toConjAct y


@[to_additive]
theorem map_injective_of_injective : Function.Injective (map f)

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
{f : AddHom M N}
(hf : Function.Injective ⇑f)


@[simp]
theorem refl_apply (x : α) : InitialSeg.refl r x = x

{α : Type u_1}
{r : α → α → Prop}
(x : α)


/-- Sum of elements in a `Subring` of a `Ring` indexed by a `Finset`
is in the `Subring`. -/
protected theorem sum_mem {R : Type*} [Ring R] (s : Subring R) {ι : Type*} {t : Finset ι}
    {f : ι → R} (h : ∀ c ∈ t, f c ∈ s) : (∑ i ∈ t, f i) ∈ s

{R : Type u_1}
[Ring R]
(s : Subring R)
{ι : Type u_2}
{t : Finset ι}
{f : ι → R}
(h : ∀ c ∈ t, f c ∈ s)


/-- The canonical `R`-linear inclusion `A → Unitization R A`. -/
@[simps apply]
def inrHom [Semiring R] [AddCommMonoid A] [Module R A] : A →ₗ[R] Unitization R A

(R : Type u_3)
(A : Type u_4)
[Semiring R]
[AddCommMonoid A]
[Module R A]
(a : A)


@[simp]
theorem comap_id (S : ConvexCone ℝ E) : S.comap LinearMap.id = S

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
(S : ConvexCone ℝ E)


theorem finset_sum_apply [AddCommMonoid N] (S : Finset ι) (f : ι → α →₀ N) (a : α) :
    (∑ i ∈ S, f i) a = ∑ i ∈ S, f i a

{α : Type u_1}
{ι : Type u_2}
{N : Type u_10}
[AddCommMonoid N]
(S : Finset ι)
(f : ι → α →₀ N)
(a : α)


lemma OrthogonalIdempotents.map_injective_iff (hf : Function.Injective f) :
    OrthogonalIdempotents (f ∘ e) ↔ OrthogonalIdempotents e

{R : Type u_1}
{S : Type u_2}
[Ring R]
[Ring S]
(f : R →+* S)
{I : Type u_3}
{e : I → R}
(hf : Function.Injective ⇑f)

OrthogonalIdempotents (⇑f ∘ e) ↔ OrthogonalIdempotents e


theorem mk_image_eq {α β : Type u} {f : α → β} {s : Set α} (hf : Injective f) : #(f '' s) = #s

{α β : Type u}
{f : α → β}
{s : Set α}
(hf : Function.Injective f)


@[simp]
theorem up_inj {x y : α} : up x = up y ↔ x = y


@[refl]
protected theorem Resp.Equiv.refl {n} (a : Resp n) : Resp.Equiv a a


theorem default_eq (a : α) : default = a


@[simp, norm_cast]
theorem coe_inj : (a : α) = b ↔ a = b

{α : Type u_1}
[Lattice α]
[BoundedOrder α]
{a b : Complementeds α}


theorem WriterT.goto_mkLabel {α β ω : Type _} [EmptyCollection ω] (x : Label (α × ω) m β) (i : α) :
    goto (WriterT.mkLabel x) i = monadLift (goto x (i, ∅))

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

ContT.goto (WriterT.mkLabel x) i = monadLift (ContT.goto x (i, ∅))


@[simp]
theorem out_mk (a : α) : (Associates.mk a).out = normalize a

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
(a : α)


theorem _root_.WCovBy.snd (h : x ⩿ y) : x.2 ⩿ y.2

{α : Type u_1}
{β : Type u_2}
[PartialOrder α]
[PartialOrder β]
{x y : α × β}
(h : x ⩿ y)


theorem rat_dense' (q : ℚ_[p]) {ε : ℚ} (hε : 0 < ε) : ∃ r : ℚ, padicNormE (q - r : ℚ_[p]) < ε

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


@[to_additive]
theorem tprod_eq_tprod_of_hasProd_iff_hasProd {f : β → α} {g : γ → α}
    (h : ∀ {a}, HasProd f a ↔ HasProd g a) : ∏' b, f b = ∏' c, g c

(h : ∀ {a : α}, HasSum f a ↔ HasSum g a)


/-- The generators of `FreeGroup α` generate `FreeGroup α`. That is, the subgroup closure of the
set of generators equals `⊤`. -/
@[to_additive (attr := simp)]
theorem closure_range_of (α) :
    Subgroup.closure (Set.range (FreeGroup.of : α → FreeGroup α)) = ⊤

AddSubgroup.closure (Set.range FreeAddGroup.of) = ⊤


theorem preStoneCechExtend_extends : preStoneCechExtend hg ∘ preStoneCechUnit = g

{α : Type u}
[TopologicalSpace α]
{β : Type v}
[TopologicalSpace β]
[T2Space β]
[CompactSpace β]
{g : α → β}
(hg : Continuous g)


@[to_additive]
theorem image_inter_image_iff (U V : Set α) :
    letI := orbitRel G α
    Quotient.mk' '' U ∩ Quotient.mk' '' V = ∅ ↔ ∀ x ∈ U, ∀ g : G, g • x ∉ V

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
(U V : Set α)

Quotient.mk' '' U ∩ Quotient.mk' '' V = ∅ ↔ ∀ x ∈ U, ∀ (g : G), g +ᵥ x ∉ V


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

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


@[to_additive]
theorem Equiv.tprod_eq (e : γ ≃ β) (f : β → α) : ∏' c, f (e c) = ∏' b, f b

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommMonoid α]
[TopologicalSpace α]
(e : γ ≃ β)
(f : β → α)


theorem or_imp : (a ∨ b → c) ↔ (a → c) ∧ (b → c)


theorem HasBasis.to_hasBasis (hl : l.HasBasis p s) (h : ∀ i, p i → ∃ i', p' i' ∧ s' i' ⊆ s i)
    (h' : ∀ i', p' i' → ∃ i, p i ∧ s i ⊆ s' i') : l.HasBasis p' s'

(h : ∀ (i : ι), p i → ∃ i', p' i' ∧ s' i' ⊆ s i)

(h' : ∀ (i' : ι'), p' i' → ∃ i, p i ∧ s i ⊆ s' i')


@[simp]
theorem rpow_eq_pow (x y : ℝ) : rpow x y = x ^ y


/-- The `αˣ` type is equivalent to a subtype of `α × α`. -/
@[simps]
def unitsEquivProdSubtype [Monoid α] : αˣ ≃ {p : α × α // p.1 * p.2 = 1 ∧ p.2 * p.1 = 1}

↑((unitsEquivProdSubtype α) u) = (↑u, ↑u⁻¹)


theorem normSq_add (a b : ℍ[R]) : normSq (a + b) = normSq a + normSq b + 2 * (a * star b).re

{R : Type u_3}
[CommRing R]
(a b : ℍ[R])

Quaternion.normSq (a + b) = Quaternion.normSq a + Quaternion.normSq b + 2 * (a * star b).re


/-- If the suprema of columns are pairwise disjoint and suprema of rows as well, then everything is
pairwise disjoint. Not to be confused with `Set.PairwiseDisjoint.prod`. -/
theorem PairwiseDisjoint.prod_left {f : ι × ι' → α}
    (hs : s.PairwiseDisjoint fun i => ⨆ i' ∈ t, f (i, i'))
    (ht : t.PairwiseDisjoint fun i' => ⨆ i ∈ s, f (i, i')) :
    (s ×ˢ t : Set (ι × ι')).PairwiseDisjoint f

{f : ι × ι' → α}


@[to_additive Filter.hasBasis_cobounded_norm]
lemma Filter.hasBasis_cobounded_norm' : HasBasis (cobounded E) (fun _ ↦ True) ({x | · ≤ ‖x‖})

(Bornology.cobounded E).HasBasis (fun x => True) fun x => {x_1 | x ≤ ‖x_1‖}


@[simp] theorem ncard_eq_zero (hs : s.Finite := by toFinite_tac) :
    s.ncard = 0 ↔ s = ∅

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


theorem map_mvPolynomial_eq_eval₂ {S : Type*} [CommRing S] [Finite σ] (ϕ : MvPolynomial σ R →+* S)
    (p : MvPolynomial σ R) :
    ϕ p = MvPolynomial.eval₂ (ϕ.comp MvPolynomial.C) (fun s => ϕ (MvPolynomial.X s)) p

{R : Type u}
{σ : Type v}
[CommRing R]
{S : Type u_2}
[CommRing S]
[Finite σ]
(ϕ : MvPolynomial σ R →+* S)
(p : MvPolynomial σ R)


@[simp, norm_cast]
lemma _root_.MonoidHom.compAddChar_apply (f : M →* N) (φ : AddChar A M) : f.compAddChar φ = f ∘ φ

{A : Type u_1}
{M : Type u_3}
{N : Type u_4}
[AddMonoid A]
[Monoid M]
[Monoid N]
(f : M →* N)
(φ : AddChar A M)


theorem bsup_lt_ord {o : Ordinal} {f : ∀ a < o, Ordinal} {c : Ordinal} (ho : o.card < c.cof) :
    (∀ i hi, f i hi < c) → bsup.{u, u} o f < c

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

(∀ (i : Ordinal.{u}) (hi : i < o), f i hi < c) → o.bsup f < c


private lemma lambda_not_dvd_z : ¬ λ ∣ S.z

(S : FermatLastTheoremForThreeGen.Solution hζ)

¬hζ.toInteger - 1 ∣ FermatLastTheoremForThreeGen.Solution.z S


/-- The tuple `(x, f x)` is contained in the graph of `f`. -/
theorem mem_graph (f : E →ₗ.[R] F) (x : domain f) : ((x : E), f x) ∈ f.graph

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
(f : E →ₗ.[R] F)
(x : ↥f.domain)


@[simp, reassoc]
lemma mapBifunctorRightUnitorCofan_inj (j : J) :
    (mapBifunctorRightUnitorCofan F Y e p hp X j).inj ⟨⟨j, 0⟩, hp j⟩ =
      (F.obj (X j)).map (singleObjApplyIso (0 : I) Y).hom ≫ e.hom.app (X j)

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

(e : F.flip.obj Y ≅ CategoryTheory.Functor.id D)

[(X : D) → CategoryTheory.Limits.PreservesColimit (CategoryTheory.Functor.empty C) (F.obj X)]

CategoryTheory.Limits.Cofan.inj (CategoryTheory.GradedObject.mapBifunctorRightUnitorCofan F Y e p hp X j) ⟨(j, 0), ⋯⟩ =
  CategoryTheory.CategoryStruct.comp ((F.obj (X j)).map (CategoryTheory.GradedObject.singleObjApplyIso 0 Y).hom)
    (e.hom.app (X j))


/-- The codomain of a homeomorphism is a locally compact space if and only if
the domain is a locally compact space. -/
theorem locallyCompactSpace_iff (h : X ≃ₜ Y) :
    LocallyCompactSpace X ↔ LocallyCompactSpace Y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(h : X ≃ₜ Y)


theorem digitsAux_def (b : ℕ) (h : 2 ≤ b) (n : ℕ) (w : 0 < n) :
    digitsAux b h n = (n % b) :: digitsAux b h (n / b)

b.digitsAux h n = n % b :: b.digitsAux h (n / b)


theorem exists_forall_mem_of_hasBasis_mem_blimsup' {l : Filter β} {b : ι → Set β}
    (hl : l.HasBasis (fun _ => True) b) {u : β → Set α} {p : β → Prop} {x : α}
    (hx : x ∈ blimsup u l p) : ∃ f : ι → β, ∀ i, x ∈ u (f i) ∧ p (f i) ∧ f i ∈ b i

{α : Type u_1}
{β : Type u_2}
{ι : Type u_4}
{l : Filter β}
{b : ι → Set β}
(hl : l.HasBasis (fun x => True) b)
{u : β → Set α}
{p : β → Prop}
{x : α}
(hx : x ∈ Filter.blimsup u l p)

∃ f, ∀ (i : ι), x ∈ u (f i) ∧ p (f i) ∧ f i ∈ b i


@[simp] theorem Flag.mem_rangeFin {x h0 hlast hcovBy} :
    x ∈ rangeFin f h0 hlast hcovBy ↔ ∃ k, f k = x

{hcovBy : ∀ (k : Fin n), f k.castSucc ⩿ f k.succ}

x ∈ Flag.rangeFin f h0 hlast hcovBy ↔ ∃ k, f k = x


lemma deleteEdges_mono (h : G ≤ H) : G.deleteEdges s ≤ H.deleteEdges s

{V : Type u}
{G H : SimpleGraph V}
{s : Set (Sym2 V)}
(h : G ≤ H)


@[ext 1050]
lemma hom_ext {T X Y : C} (f g : T ⟶ X ⊗ Y)
    (h_fst : f ≫ fst _ _ = g ≫ fst _ _)
    (h_snd : f ≫ snd _ _ = g ≫ snd _ _) :
    f = g

(f g : T ⟶ CategoryTheory.MonoidalCategory.tensorObj X Y)

(h_fst :
  CategoryTheory.CategoryStruct.comp f (CategoryTheory.ChosenFiniteProducts.fst X Y) =
    CategoryTheory.CategoryStruct.comp g (CategoryTheory.ChosenFiniteProducts.fst X Y))

(h_snd :
  CategoryTheory.CategoryStruct.comp f (CategoryTheory.ChosenFiniteProducts.snd X Y) =
    CategoryTheory.CategoryStruct.comp g (CategoryTheory.ChosenFiniteProducts.snd X Y))


theorem digit_sum_le (p n : ℕ) : List.sum (digits p n) ≤ n


theorem map {A : Type v} [CommRing A] (φ : R →+* A) : (f.map φ).IsWeaklyEisensteinAt (𝓟.map φ)

{R : Type u}
[CommSemiring R]
{𝓟 : Ideal R}
{f : R[X]}
(hf : f.IsWeaklyEisensteinAt 𝓟)
{A : Type v}
[CommRing A]
(φ : R →+* A)

(Polynomial.map φ f).IsWeaklyEisensteinAt (Ideal.map φ 𝓟)


theorem IsAssociatedPrime.annihilator_le (h : IsAssociatedPrime I M) :
    (⊤ : Submodule R M).annihilator ≤ I

{R : Type u_1}
[CommRing R]
{I : Ideal R}
{M : Type u_2}
[AddCommGroup M]
[Module R M]
(h : IsAssociatedPrime I M)


theorem IsAssociatedPrime.eq_radical (hI : I.IsPrimary) (h : IsAssociatedPrime J (R ⧸ I)) :
    J = I.radical

{R : Type u_1}
[CommRing R]
{I J : Ideal R}
(hI : I.IsPrimary)
(h : IsAssociatedPrime J (R ⧸ I))


theorem smul_eval [MulSemiringAction G S] (g : G) (f : S[X]) (x : S) :
    (g • f).eval x = g • f.eval (g⁻¹ • x)

(S : Type u_3)
[CommSemiring S]
(G : Type u_4)
[Group G]
[MulSemiringAction G S]
(g : G)
(f : S[X])
(x : S)

Polynomial.eval x (g • f) = g • Polynomial.eval (g⁻¹ • x) f


/-- The base map `f : B' → B` lifts to a canonical map on the total spaces. -/
@[simps (config := { attrs := [`mfld_simps] })]
def Pullback.lift (f : B' → B) : TotalSpace F (f *ᵖ E) → TotalSpace F E

{B : Type u_1}
{F : Type u_2}
{E : B → Type u_3}
{B' : Type u_4}
(f : B' → B)

∀ (a : Bundle.TotalSpace F (f *ᵖ E)), (Bundle.Pullback.lift f a).snd = a.snd


@[simp]
theorem mk_one {h} : (⟨1, h⟩ : ℕ+) = (1 : ℕ+)


theorem LinearMap.toMatrixAlgEquiv_transpose_apply' (f : M₁ →ₗ[R] M₁) (j : n) :
    (LinearMap.toMatrixAlgEquiv v₁ f)ᵀ j = v₁.repr (f (v₁ j))

{R : Type u_1}
[CommSemiring R]
{n : Type u_4}
[Fintype n]
[DecidableEq n]
{M₁ : Type u_5}
[AddCommMonoid M₁]
[Module R M₁]
(v₁ : Basis n R M₁)
(f : M₁ →ₗ[R] M₁)
(j : n)

((LinearMap.toMatrixAlgEquiv v₁) f)ᵀ j = ⇑(v₁.repr (f (v₁ j)))


lemma AntivaryOn.div_left₀ (hf₁ : ∀ i ∈ s, 0 ≤ f₁ i) (hf₂ : ∀ i ∈ s, 0 < f₂ i)
    (h₁ : AntivaryOn f₁ g s) (h₂ : MonovaryOn f₂ g s) : AntivaryOn (f₁ / f₂) g s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedSemifield α]
[LinearOrderedSemifield β]
{s : Set ι}
{f₁ f₂ : ι → α}
{g : ι → β}
(hf₁ : ∀ i ∈ s, 0 ≤ f₁ i)
(hf₂ : ∀ i ∈ s, 0 < f₂ i)
(h₁ : AntivaryOn f₁ g s)
(h₂ : MonovaryOn f₂ g s)


theorem nextn_stop : ∀ {s}, Valid s → ∀ n, s.nextn n ⟨s.bsize⟩ = ⟨s.bsize⟩

s.Valid → ∀ (n : Nat), s.nextn n { byteIdx := s.bsize } = { byteIdx := s.bsize }


theorem toDual_le [LE α] {a : α} {b : αᵒᵈ} : toDual a ≤ b ↔ ofDual b ≤ a

OrderDual.toDual a ≤ b ↔ OrderDual.ofDual b ≤ a


/-- Bijection between algebra equivalences and algebra homomorphisms -/
@[simps]
noncomputable def algEquivEquivAlgHom [Algebra.IsAlgebraic K L] :
    (L ≃ₐ[K] L) ≃* (L →ₐ[K] L)

(K : Type u_1)
(L : Type u_2)
[CommRing K]
[Field L]
[Algebra K L]
[NoZeroSMulDivisors K L]
[Algebra.IsAlgebraic K L]
(ϕ : L ≃ₐ[K] L)

(Algebra.IsAlgebraic.algEquivEquivAlgHom K L) ϕ = ↑ϕ


protected theorem neg_le_neg {a b : Int} (h : a ≤ b) : -b ≤ -a


protected theorem perm_pow (h : IsFixedPt e x) (n : ℕ) : IsFixedPt (⇑(e ^ n)) x

{α : Type u}
{x : α}
{e : Equiv.Perm α}
(h : Function.IsFixedPt (⇑e) x)
(n : ℕ)


/-- Given two left-invariant measures which are finite on
compacts, they coincide in the following sense: they give the same value to the integral of
continuous compactly supported functions, up to a multiplicative constant. -/
@[to_additive exists_integral_isAddLeftInvariant_eq_smul_of_hasCompactSupport]
lemma exists_integral_isMulLeftInvariant_eq_smul_of_hasCompactSupport (μ' μ : Measure G)
    [IsHaarMeasure μ] [IsFiniteMeasureOnCompacts μ'] [IsMulLeftInvariant μ'] :
    ∃ (c : ℝ≥0), ∀ (f : G → ℝ), Continuous f → HasCompactSupport f →
      ∫ x, f x ∂μ' = ∫ x, f x ∂(c • μ)

∃ c, ∀ (f : G → ℝ), Continuous f → HasCompactSupport f → ∫ (x : G), f x ∂μ' = ∫ (x : G), f x ∂c • μ


theorem app_bijective_of_stalkFunctor_map_bijective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X)
    (h : ∀ x : U, Function.Bijective ((stalkFunctor C x.val).map f.1)) :
    Function.Bijective (f.1.app (op U))

(h : ∀ (x : ↥U), Function.Bijective ⇑((TopCat.Presheaf.stalkFunctor C ↑x).map f.val))

Function.Bijective ⇑(f.val.app (Opposite.op U))


theorem expSeries_apply_eq' (x : 𝔸) :
    (fun n => expSeries 𝕂 𝔸 n fun _ => x) = fun n => (n !⁻¹ : 𝕂) • x ^ n

{𝕂 : Type u_1}
{𝔸 : Type u_2}
[Field 𝕂]
[Ring 𝔸]
[Algebra 𝕂 𝔸]
[TopologicalSpace 𝔸]
[TopologicalRing 𝔸]
(x : 𝔸)

(fun n => (NormedSpace.expSeries 𝕂 𝔸 n) fun x_1 => x) = fun n => (↑n.factorial)⁻¹ • x ^ n


lemma hom_ext {W : A} {f g : W ⟶ R.obj (op X)}
    (h : ∀ (i : S.Arrow), f ≫ R.map i.f.op = g ≫ R.map i.f.op) : f = g

{J : CategoryTheory.GrothendieckTopology C}

(K : CategoryTheory.GrothendieckTopology D)

(hF : CategoryTheory.Presheaf.IsSheaf J F)

(hR : (CategoryTheory.Functor.RightExtension.mk R α).IsPointwiseRightKanExtension)


theorem PairwiseDisjoint.mono (hs : s.PairwiseDisjoint f) (h : g ≤ f) : s.PairwiseDisjoint g

{α : Type u_1}
{ι : Type u_4}
[PartialOrder α]
[OrderBot α]
{s : Set ι}
{f g : ι → α}
(hs : s.PairwiseDisjoint f)
(h : g ≤ f)


private lemma hurwitzZeta_neg_two_mul_nat (hk : k ≠ 0) (hx : x ∈ Icc (0 : ℝ) 1) :
    hurwitzZeta x (-(2 * k)) = -1 / (2 * k + 1) *
      ((Polynomial.bernoulli (2 * k + 1)).map (algebraMap ℚ ℂ)).eval (x : ℂ)

{k : ℕ}
{x : ℝ}
(hk : k ≠ 0)
(hx : x ∈ Set.Icc 0 1)

HurwitzZeta.hurwitzZeta (↑x) (-(2 * ↑k)) =
  -1 / (2 * ↑k + 1) * Polynomial.eval (↑x) (Polynomial.map (algebraMap ℚ ℂ) (Polynomial.bernoulli (2 * k + 1)))


theorem toLieHom_apply (x : A) : f.toLieHom x = f x

{A : Type v}
[Ring A]
{R : Type u}
[CommRing R]
[Algebra R A]
{B : Type w}
[Ring B]
[Algebra R B]
(f : A →ₐ[R] B)
(x : A)


protected lemma add {A : Matrix m m R} {B : Matrix m m R}
    (hA : A.PosSemidef) (hB : B.PosSemidef) : (A + B).PosSemidef

{m : Type u_1}
{R : Type u_3}
[Fintype m]
[CommRing R]
[PartialOrder R]
[StarRing R]
[StarOrderedRing R]
{A B : Matrix m m R}
(hA : A.PosSemidef)
(hB : B.PosSemidef)


theorem actionDiagonalSucc_inv_apply {G : Type u} [Group G] {n : ℕ} (g : G) (f : Fin n → G) :
    (actionDiagonalSucc G n).inv.hom (g, f) = (g • Fin.partialProd f : Fin (n + 1) → G)

(groupCohomology.resolution.actionDiagonalSucc G n).inv.hom (g, f) = g • Fin.partialProd f


/-- The equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)` given by yoneda lemma. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_inv counitIso_hom counitIso_inv]
def costructuredArrowYonedaEquivalence (F : Cᵒᵖ ⥤ Type v) :
    F.Elementsᵒᵖ ≌ CostructuredArrow yoneda F

(F : CategoryTheory.Functor Cᵒᵖ (Type v))

∀ {X Y : CategoryTheory.CostructuredArrow CategoryTheory.yoneda F} (f : X ⟶ Y),
  (CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence F).inverse.map f =
    ((CategoryTheory.CategoryOfElements.fromCostructuredArrow F).map f.op).op


/-- If `K` is linearly ordered, the norm of a primitive root is `1` if `n` is odd. -/
theorem norm_eq_one_of_linearly_ordered {K : Type*} [LinearOrderedField K] [Algebra K L]
    (hodd : Odd (n : ℕ)) : norm K ζ = 1

{n : ℕ+}
{L : Type v}
[CommRing L]
{ζ : L}
(hζ : IsPrimitiveRoot ζ ↑n)
{K : Type u_1}
[LinearOrderedField K]
[Algebra K L]
(hodd : Odd ↑n)


theorem rpow_le_rpow_of_exponent_ge {x : ℝ≥0∞} {y z : ℝ} (hx1 : x ≤ 1) (hyz : z ≤ y) :
    x ^ y ≤ x ^ z


lemma Nonempty.exists_eq_singleton_or_nontrivial : s.Nonempty → (∃ a, s = {a}) ∨ s.Nontrivial


theorem Memℒp.inner_const {f : α → E} (hf : Memℒp f p μ) (c : E) : Memℒp (fun a => ⟪f a, c⟫) p μ

{α : Type u_1}
{m : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
{E : Type u_2}
{𝕜 : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{f : α → E}
(hf : MeasureTheory.Memℒp f p μ)
(c : E)

MeasureTheory.Memℒp (fun a => ⟪f a, c⟫_𝕜) p μ


@[to_additive (attr := simp) MeasureTheory.addFundamentalFrontier_union_addFundamentalInterior]
theorem fundamentalFrontier_union_fundamentalInterior :
    fundamentalFrontier G s ∪ fundamentalInterior G s = s

(G : Type u_1)
{α : Type u_3}
[Group G]
[MulAction G α]
(s : Set α)

MeasureTheory.fundamentalFrontier G s ∪ MeasureTheory.fundamentalInterior G s = s


@[simp]
theorem map_ite_one_zero {F : Type*} [FunLike F α β] [RingHomClass F α β] (f : F)
    (p : Prop) [Decidable p] :
    f (ite p 1 0) = ite p 1 0

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} {F : Type u_5} [inst : FunLike F α β]
  [inst_1 : RingHomClass F α β] (f : F) (p : Prop) [inst_2 : Decidable p], f (if p then 1 else 0) = if p then 1 else 0


theorem map_apply (P : PresheafOfModules R) {X Y : Cᵒᵖ} (f : X ⟶ Y) (x) :
    P.map f x = (P.presheaf.map f) x

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{R : Cᵒᵖ ⥤ RingCat}
(P : PresheafOfModules R)
{X Y : Cᵒᵖ}
(f : X ⟶ Y)
(x : ↑(P.obj X))


@[simp]
theorem span_eq_take_drop (l : List α) : span p l = (takeWhile p l, dropWhile p l)

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

List.span p l = (List.takeWhile p l, List.dropWhile p l)


lemma ge_of_tendsto_of_frequently {x : Filter β} (lim : Tendsto f x (𝓝 a))
    (h : ∃ᶠ c in x, b ≤ f c) : b ≤ a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder α]
[ClosedIciTopology α]
{f : β → α}
{a b : α}
{x : Filter β}
(lim : Filter.Tendsto f x (𝓝 a))
(h : ∃ᶠ (c : β) in x, b ≤ f c)


@[simp]
theorem prod_bot : (prod ⊥ ⊥ : Submodule R (M × M')) = ⊥

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{M' : Type u_9}
[AddCommMonoid M']
[Module R M']


theorem Group.card_center_add_sum_card_noncenter_eq_card (G) [Group G]
    [∀ x : ConjClasses G, Fintype x.carrier] [Fintype G] [Fintype <| Subgroup.center G]
    [Fintype <| noncenter G] : Fintype.card (Subgroup.center G) +
  ∑ x ∈ (noncenter G).toFinset, x.carrier.toFinset.card = Fintype.card G

[(x : ConjClasses G) → Fintype ↑x.carrier]

Fintype.card ↥(Subgroup.center G) + ∑ x ∈ (ConjClasses.noncenter G).toFinset, x.carrier.toFinset.card = Fintype.card G


theorem dualCoannihilator_dualAnnihilator_eq {W : Subspace K (Dual K V)} [FiniteDimensional K W] :
    W.dualCoannihilator.dualAnnihilator = W

{K : Type u_1}
{V : Type u_2}
[Field K]
[AddCommGroup V]
[Module K V]
{W : Subspace K (Module.Dual K V)}
[FiniteDimensional K ↥W]

(Submodule.dualCoannihilator W).dualAnnihilator = W


theorem image_inf_product (s t : Finset α) : (s ×ˢ t).image (uncurry (· ⊓ ·)) = s ⊼ t

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

Finset.image (Function.uncurry fun x x_1 => x ⊓ x_1) (s ×ˢ t) = s ⊼ t


theorem Ioo_mem_nhdsWithin_Iic (H : b ∈ Ioo a c) : Ioo a c ∈ 𝓝[≤] b

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIicTopology α]
{a b c : α}
(H : b ∈ Set.Ioo a c)


lemma rewrites_of_exists_parts (r : ContextFreeRule T N) (p q : List (Symbol T N)) :
    r.Rewrites (p ++ [Symbol.nonterminal r.input] ++ q) (p ++ r.output ++ q)

{T : Type uT}
{N : Type uN}
(r : ContextFreeRule T N)
(p q : List (Symbol T N))


theorem ContDiffWithinAt.pow {f : E → 𝔸} (hf : ContDiffWithinAt 𝕜 n f s x) (m : ℕ) :
    ContDiffWithinAt 𝕜 n (fun y => f y ^ m) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{s : Set E}
{x : E}
{n : ℕ∞}
{𝔸 : Type u_3}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{f : E → 𝔸}
(hf : ContDiffWithinAt 𝕜 n f s x)
(m : ℕ)


theorem isUpperSet_iUnion₂ {f : ∀ i, κ i → Set α} (hf : ∀ i j, IsUpperSet (f i j)) :
    IsUpperSet (⋃ (i) (j), f i j)

(hf : ∀ (i : ι) (j : κ i), IsUpperSet (f i j))


theorem recAuxOn_succ {motive : Nat → Sort _} (zero : motive 0)
    (succ : ∀ n, motive n → motive (n+1)) (n) :
    Nat.recAuxOn (n+1) zero succ = succ n (Nat.recAuxOn n zero succ)

(succ : (n : Nat) → motive n → motive (n + 1))

Nat.recAuxOn (n + 1) zero succ = succ n (Nat.recAuxOn n zero succ)


lemma quarters_mem_preCantorSet (n : ℕ) : 1/4 ∈ preCantorSet n ∧ 3/4 ∈ preCantorSet n

1 / 4 ∈ preCantorSet n ∧ 3 / 4 ∈ preCantorSet n


@[to_additive (attr := simp)]
theorem partialProd_zero (f : Fin n → α) : partialProd f 0 = 1

{α : Type u_1}
[AddMonoid α]
{n : ℕ}
(f : Fin n → α)


theorem supportsStmt_read {S : Finset Λ'₁} :
    ∀ {f : Γ → Stmt'₁}, (∀ a, SupportsStmt S (f a)) → SupportsStmt S (read dec f)

{f : Γ → Turing.TM1.Stmt Bool Turing.TM1to1.Λ' σ}

(∀ (a : Γ), Turing.TM1.SupportsStmt S (f a)) → Turing.TM1.SupportsStmt S (Turing.TM1to1.read dec f)


theorem PGame.equiv_iff_game_eq {x y : PGame} : x ≈ y ↔ (⟦x⟧ : Game) = ⟦y⟧

x ≈ y ↔ ⟦x⟧ = ⟦y⟧


theorem opRingEquiv_single [Monoid G] (r : k) (x : G) :
    MonoidAlgebra.opRingEquiv (op (single x r)) = single (op x) (op r)

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[Monoid G]
(r : k)
(x : G)

MonoidAlgebra.opRingEquiv (MulOpposite.op (MonoidAlgebra.single x r)) =
  MonoidAlgebra.single (MulOpposite.op x) (MulOpposite.op r)


theorem HasCountableSeparatingOn.mono {α} {p₁ p₂ : Set α → Prop} {t₁ t₂ : Set α}
    [h : HasCountableSeparatingOn α p₁ t₁] (hp : ∀ s, p₁ s → p₂ s) (ht : t₂ ⊆ t₁) :
    HasCountableSeparatingOn α p₂ t₂

{α : Type u_1}
{p₁ p₂ : Set α → Prop}
{t₁ t₂ : Set α}
[h : HasCountableSeparatingOn α p₁ t₁]
(hp : ∀ (s : Set α), p₁ s → p₂ s)
(ht : t₂ ⊆ t₁)


/-- **Bézout's lemma** -/
theorem gcd_eq_gcd_ab : ∀ x y : ℤ, (gcd x y : ℤ) = x * gcdA x y + y * gcdB x y

↑(x.gcd y) = x * x.gcdA y + y * x.gcdB y


theorem rpow_lt_one {x z : ℝ} (hx1 : 0 ≤ x) (hx2 : x < 1) (hz : 0 < z) : x ^ z < 1


@[simp] theorem domCongr_single (e : G ≃* H) (g : G) (a : A) :
    domCongr k A e (single g a) = single (e g) a

(k : Type u₁)
{G : Type u₂}
{H : Type u_1}
[CommSemiring k]
[Monoid G]
[Monoid H]
(A : Type u₃)
[Semiring A]
[Algebra k A]
(e : G ≃* H)
(g : G)
(a : A)

(MonoidAlgebra.domCongr k A e) (MonoidAlgebra.single g a) = MonoidAlgebra.single (e g) a


theorem mk'_mem_edges_singleton {u v : V} (h : G.Adj u v) :
    s(u, v) ∈ (singleton h : G.Walk u v).edges

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

s(u, v) ∈ (↑(SimpleGraph.Path.singleton h)).edges


/-- The natural isomorphism between a pushout cocone and the corresponding pushout cocone
reconstructed using `PushoutCocone.mk`. -/
@[simps!]
def eta (t : PushoutCocone f g) : t ≅ mk t.inl t.inr t.condition

(t : CategoryTheory.Limits.PushoutCocone f g)


/-- Now we consider a square:
```
  A ---f---> X
  |          |
  i          p
  |          |
  v          v
  B ---g---> Y
```

The datum of a lift in a commutative square, i.e. an up-right-diagonal
morphism which makes both triangles commute. -/
-- porting note (#5171): removed @[nolint has_nonempty_instance]
@[ext]
structure LiftStruct (sq : CommSq f i p g) where
  /-- The lift. -/
  l : B ⟶ X
  /-- The upper left triangle commutes. -/
  fac_left : i ≫ l = f
  /-- The lower right triangle commutes. -/
  fac_right : l ≫ p = g

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{A B X Y : C}
{f : A ⟶ X}
{i : A ⟶ B}
{p : X ⟶ Y}
{g : B ⟶ Y}
{sq : CategoryTheory.CommSq f i p g}
(self : sq.LiftStruct)

CategoryTheory.CategoryStruct.comp self.l p = g


@[simp]
theorem mem_Ioi_iff : b ∈ Ioi a ↔ a < b


/-- An antitone function is continuous at a point if and only if its left and right limits
coincide. -/
theorem continuousAt_iff_leftLim_eq_rightLim : ContinuousAt f x ↔ leftLim f x = rightLim f x

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[ConditionallyCompleteLinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
{f : α → β}
(hf : Antitone f)
{x : α}
[TopologicalSpace α]
[OrderTopology α]

ContinuousAt f x ↔ Function.leftLim f x = Function.rightLim f x


@[simp]
theorem zero_def : (zero : RegularExpression α) = 0


lemma toEuclideanLin_eq_toLin_orthonormal [Fintype m] :
    toEuclideanLin = toLin (basisFun n 𝕜).toBasis (basisFun m 𝕜).toBasis

{𝕜 : Type u_3}
[RCLike 𝕜]
{m : Type u_8}
{n : Type u_9}
[Fintype n]
[DecidableEq n]
[Fintype m]

Matrix.toEuclideanLin = Matrix.toLin (EuclideanSpace.basisFun n 𝕜).toBasis (EuclideanSpace.basisFun m 𝕜).toBasis


theorem UniformInducing.prod {α' : Type*} {β' : Type*} [UniformSpace α'] [UniformSpace β']
    {e₁ : α → α'} {e₂ : β → β'} (h₁ : UniformInducing e₁) (h₂ : UniformInducing e₂) :
    UniformInducing fun p : α × β => (e₁ p.1, e₂ p.2)

{α : Type u}
{β : Type v}
[UniformSpace α]
[UniformSpace β]
{α' : Type u_1}
{β' : Type u_2}
[UniformSpace α']
[UniformSpace β']
{e₁ : α → α'}
{e₂ : β → β'}
(h₁ : UniformInducing e₁)
(h₂ : UniformInducing e₂)

UniformInducing fun p => (e₁ p.1, e₂ p.2)


lemma ringEquivCongr_refl_apply {a : ℕ} (x : ZMod a) : ringEquivCongr rfl x = x


theorem toReal_injective {d : ℤ} (h0d : 0 ≤ d) (hd : ∀ n : ℤ, d ≠ n * n) :
    Function.Injective (toReal h0d)


theorem LinearIndependent.repr_ker : LinearMap.ker hv.repr = ⊥

{ι : Type u'}
{R : Type u_2}
{M : Type u_4}
{v : ι → M}
[Ring R]
[AddCommGroup M]
[Module R M]
(hv : LinearIndependent R v)


@[to_additive]
theorem IsCyclic.unique_zpow_zmod (ha : ∀ x : α, x ∈ zpowers a) (x : α) :
    ∃! n : ZMod (Fintype.card α), x = a ^ n.val

(ha : ∀ (x : α), x ∈ AddSubgroup.zmultiples a)


theorem nhdsWithin_Iic_basis [TopologicalSpace α] [LinearOrder α] [OrderTopology α] [NoMinOrder α]
    (a : α) : (𝓝[≤] a).HasBasis (fun l => l < a) fun l => Ioc l a

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[NoMinOrder α]
(a : α)

(𝓝[≤] a).HasBasis (fun l => l < a) fun l => Set.Ioc l a


theorem changeFormAux_changeFormAux (B : BilinForm R M) (v : M) (x : CliffordAlgebra Q) :
    changeFormAux Q B v (changeFormAux Q B v x) = (Q v - B v v) • x

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
(B : LinearMap.BilinForm R M)
(v : M)
(x : CliffordAlgebra Q)

((CliffordAlgebra.changeFormAux Q B) v) (((CliffordAlgebra.changeFormAux Q B) v) x) = (Q v - (B v) v) • x


/-- An explicit version of **Bézout's lemma** for Euclidean domains. -/
theorem gcd_eq_gcd_ab (a b : R) : (gcd a b : R) = a * gcdA a b + b * gcdB a b

{R : Type u}
[EuclideanDomain R]
[DecidableEq R]
(a b : R)

EuclideanDomain.gcd a b = a * EuclideanDomain.gcdA a b + b * EuclideanDomain.gcdB a b


theorem SatisfiesM_foldlM [Monad m] [LawfulMonad m]
    {as : Array α} (motive : Nat → β → Prop) {init : β} (h0 : motive 0 init) {f : β → α → m β}
    (hf : ∀ i : Fin as.size, ∀ b, motive i.1 b → SatisfiesM (motive (i.1 + 1)) (f b as[i])) :
    SatisfiesM (motive as.size) (as.foldlM f init)

{f : β → α → m β}

(hf : ∀ (i : Fin as.size) (b : β), motive (↑i) b → SatisfiesM (motive (↑i + 1)) (f b as[i]))

SatisfiesM (motive as.size) (Array.foldlM f init as 0)


theorem liminf_preimage_iterate_ae_eq {f : α → α} (hf : QuasiMeasurePreserving f μ μ)
    (hs : f ⁻¹' s =ᵐ[μ] s) : liminf (α := Set α) (fun n => (preimage f)^[n] s) atTop =ᵐ[μ] s

(hf : MeasureTheory.Measure.QuasiMeasurePreserving f μ μ)

Filter.liminf (fun n => (Set.preimage f)^[n] s) Filter.atTop =ᵐ[μ] s


/-- Two polynomials `p` and `q` such that `p(q(X))=X` and `q(p(X))=X`
  induces an automorphism of the polynomial algebra. -/
@[simps!]
def algEquivOfCompEqX (p q : R[X]) (hpq : p.comp q = X) (hqp : q.comp p = X) : R[X] ≃ₐ[R] R[X]

{R : Type u}
[CommSemiring R]
(p q : R[X])
(hpq : p.comp q = Polynomial.X)
(hqp : q.comp p = Polynomial.X)
(a : R[X])

(p.algEquivOfCompEqX q hpq hqp) a = (Polynomial.aeval p) a


/-- When multiplication is commutative, `star` preserves division. -/
@[simp]
theorem star_div [CommGroup R] [StarMul R] (x y : R) : star (x / y) = star x / star y

{R : Type u}
[CommGroup R]
[StarMul R]
(x y : R)


@[simp]
theorem colon_bot : colon ⊥ N = N.annihilator

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


@[reassoc (attr := simp)]
theorem ev_naturality {X Y : C} (f : X ⟶ Y) :
    A ◁ (ihom A).map f ≫ (ev A).app Y = (ev A).app X ≫ f

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerLeft A ((CategoryTheory.ihom A).map f))
    ((CategoryTheory.ihom.ev A).app Y) =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.ihom.ev A).app X) f


/-- A continuous monotone function sends indexed infimum to indexed infimum in conditionally
complete linear order, under a boundedness assumption. -/
theorem Monotone.map_ciInf_of_continuousAt {f : α → β} {g : γ → α} (Cf : ContinuousAt f (⨅ i, g i))
    (Mf : Monotone f) (H : BddBelow (range g)) : f (⨅ i, g i) = ⨅ i, f (g i)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[ConditionallyCompleteLinearOrder β]
[TopologicalSpace β]
[OrderClosedTopology β]
[Nonempty γ]
{f : α → β}
{g : γ → α}
(Cf : ContinuousAt f (⨅ i, g i))
(Mf : Monotone f)
(H : BddBelow (Set.range g))


@[simp]
theorem coe_mapEquiv (h : M ≃* N) (x : Mˣ) : (mapEquiv h x : N) = h x

{M : Type u_6}
{N : Type u_7}
[Monoid M]
[Monoid N]
(h : M ≃* N)
(x : Mˣ)


/-- This cannot be marked `@[ext]` as it ends up being used instead of `LinearMap.prod_ext` when
working with `R × A`. -/
theorem linearMap_ext {N} [Semiring S] [AddCommMonoid R] [AddCommMonoid A] [AddCommMonoid N]
    [Module S R] [Module S A] [Module S N] ⦃f g : Unitization R A →ₗ[S] N⦄
    (hl : ∀ r, f (inl r) = g (inl r)) (hr : ∀ a : A, f a = g a) : f = g

(hl : ∀ (r : R), f (Unitization.inl r) = g (Unitization.inl r))


/-- We can approximate `a / b : L` with `q / r`, where `r` has finitely many options for `L`. -/
theorem exists_mem_finset_approx' [Algebra.IsAlgebraic R L] (a : S) {b : S} (hb : b ≠ 0) :
    ∃ q : S,
      ∃ r ∈ finsetApprox bS adm, abv (Algebra.norm R (r • a - q * b)) < abv (Algebra.norm R b)

{R : Type u_1}
{S : Type u_2}
(L : Type u_4)
[EuclideanDomain R]
[CommRing S]
[IsDomain S]
[Field L]
[algRL : Algebra R L]
[Algebra R S]
[Algebra S L]
[ist : IsScalarTower R S L]
[iic : IsIntegralClosure S R L]
{abv : AbsoluteValue R ℤ}
{ι : Type u_5}
[DecidableEq ι]
[Fintype ι]
(bS : Basis ι R S)
(adm : abv.IsAdmissible)
[Infinite R]
[DecidableEq R]
[Algebra.IsAlgebraic R L]
(a : S)
{b : S}
(hb : b ≠ 0)

∃ q, ∃ r ∈ ClassGroup.finsetApprox bS adm, abv ((Algebra.norm R) (r • a - q * b)) < abv ((Algebra.norm R) b)


theorem isOpen_iff_of_not_mem (h : ∞ ∉ s) : IsOpen s ↔ IsOpen ((↑) ⁻¹' s : Set X)

{X : Type u_1}
[TopologicalSpace X]
{s : Set (OnePoint X)}
(h : OnePoint.infty ∉ s)


/-- Corresponds to `dist_zero_right`. -/
@[simp]
theorem hammingDist_zero_right (x : ∀ i, β i) : hammingDist x 0 = hammingNorm x

{ι : Type u_2}
{β : ι → Type u_3}
[Fintype ι]
[(i : ι) → DecidableEq (β i)]
[(i : ι) → Zero (β i)]
(x : (i : ι) → β i)


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

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

nndist (s.indicator f x) (t.indicator f x) = ‖(symmDiff s t).indicator f x‖₊


@[to_additive]
theorem lt_one_of_mul_lt_right [ContravariantClass α α (· * ·) (· < ·)] {a b : α} (h : a * b < a) :
    b < 1

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


/-- If the angle between two vectors is π, the angles between those
vectors and a third vector add to π. -/
theorem angle_add_angle_eq_pi_of_angle_eq_pi {x y : V} (z : V) (h : angle x y = π) :
    angle x z + angle y z = π

(h : InnerProductGeometry.angle x y = π)

InnerProductGeometry.angle x z + InnerProductGeometry.angle y z = π


/-- The inclusion of the left factor into the sum of two languages. -/
@[simps]
protected def sumInl : L →ᴸ L.sum L'

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
(_n : ℕ)
(val : L.Functions _n)

FirstOrder.Language.LHom.sumInl.onFunction val = Sum.inl val


@[to_additive norm_pos_iff']
theorem norm_pos_iff''' [T0Space E] {a : E} : 0 < ‖a‖ ↔ a ≠ 1

{E : Type u_6}
[SeminormedGroup E]
[T0Space E]
{a : E}


/-- Constructor for bicomplexes taking as inputs a graded object, horizontal differentials
and vertical differentials satisfying suitable relations. -/
@[simps]
def ofGradedObject :
    HomologicalComplex₂ C c₁ c₂

(X : CategoryTheory.GradedObject (I₁ × I₂) C)

(d₁ : (i₁ i₁' : I₁) → (i₂ : I₂) → X (i₁, i₂) ⟶ X (i₁', i₂))

(d₂ : (i₁ : I₁) → (i₂ i₂' : I₂) → X (i₁, i₂) ⟶ X (i₁, i₂'))

(shape₁ : ∀ (i₁ i₁' : I₁), ¬c₁.Rel i₁ i₁' → ∀ (i₂ : I₂), d₁ i₁ i₁' i₂ = 0)

(shape₂ : ∀ (i₁ : I₁) (i₂ i₂' : I₂), ¬c₂.Rel i₂ i₂' → d₂ i₁ i₂ i₂' = 0)

(d₁_comp_d₁ : ∀ (i₁ i₁' i₁'' : I₁) (i₂ : I₂), d₁ i₁ i₁' i₂ ≫ d₁ i₁' i₁'' i₂ = 0)

(d₂_comp_d₂ : ∀ (i₁ : I₁) (i₂ i₂' i₂'' : I₂), d₂ i₁ i₂ i₂' ≫ d₂ i₁ i₂' i₂'' = 0)

(comm : ∀ (i₁ i₁' : I₁) (i₂ i₂' : I₂), d₁ i₁ i₁' i₂ ≫ d₂ i₁' i₂ i₂' = d₂ i₁ i₂ i₂' ≫ d₁ i₁ i₁' i₂')

((HomologicalComplex₂.ofGradedObject c₁ c₂ X d₁ d₂ shape₁ shape₂ d₁_comp_d₁ d₂_comp_d₂ comm).d i₁ i₁').f i₂ =
  d₁ i₁ i₁' i₂


/-- A version of `Equiv.optionCongr` for `WithOne`. -/
@[to_additive (attr := simps apply) "A version of `Equiv.optionCongr` for `WithZero`."]
def _root_.MulEquiv.withOneCongr (e : α ≃* β) : WithOne α ≃* WithOne β

{α : Type u}
{β : Type v}
[Mul α]
[Mul β]
(e : α ≃* β)
(a : WithOne α)

e.withOneCongr a = (WithOne.map e.toMulHom) a


/-- The natural isomorphism comparing between
pulling back along two successive functions, and
pulling back along their composition
-/
@[simps!]
def comapComp (f : K → J) (g : J → I) : comap C g ⋙ comap (C ∘ g) f ≅ comap C (g ∘ f)

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

(CategoryTheory.Pi.comapComp C f g).inv.app X b = CategoryTheory.CategoryStruct.id (X (g (f b)))


/-- The identity lax monoidal functor. -/
@[simps]
def id : OplaxMonoidalFunctor.{v₁, v₁} C C

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

(CategoryTheory.OplaxMonoidalFunctor.id C).toFunctor = 𝟭 C


@[to_additive]
lemma IsMulFreimanHom.mono (hmn : m ≤ n) (hf : IsMulFreimanHom n A B f) :
    IsMulFreimanHom m A B f

{α : Type u_2}
{β : Type u_3}
[CommMonoid α]
[CancelCommMonoid β]
{A : Set α}
{B : Set β}
{f : α → β}
{m n : ℕ}
(hmn : m ≤ n)
(hf : IsMulFreimanHom n A B f)


/-- An intermediate field of `E / F` is contained in the relative perfect closure of `F` in `E`
if and only if it is purely inseparable over `F`. -/
theorem le_perfectClosure_iff (L : IntermediateField F E) :
    L ≤ perfectClosure F E ↔ IsPurelyInseparable F L

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(L : IntermediateField F E)

L ≤ perfectClosure F E ↔ IsPurelyInseparable F ↥L


@[simp]
theorem linfty_opNorm_col (v : m → α) : ‖col ι v‖ = ‖v‖

{m : Type u_3}
{α : Type u_5}
{ι : Type u_7}
[Fintype m]
[Unique ι]
[SeminormedAddCommGroup α]
(v : m → α)


theorem nonUniforms_bot (hε : 0 < ε) : (⊥ : Finpartition A).nonUniforms G ε = ∅

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
[DecidableEq α]
{A : Finset α}
(G : SimpleGraph α)
[DecidableRel G.Adj]
{ε : 𝕜}
(hε : 0 < ε)


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

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


/-- The volume form on an oriented real inner product space can be evaluated as the determinant with
respect to any orthonormal basis of the space compatible with the orientation. -/
theorem volumeForm_robust (b : OrthonormalBasis (Fin n) ℝ E) (hb : b.toBasis.orientation = o) :
    o.volumeForm = b.toBasis.det

[_i : Fact (FiniteDimensional.finrank ℝ E = n)]


{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(I J : LieIdeal R L)


/-- A version of `Finset.max'_image` with LHS and RHS reversed.
Also, this version assumes that `s` is nonempty, not its image. -/
lemma _root_.Monotone.map_finset_max' [LinearOrder β] {f : α → β} (hf : Monotone f) {s : Finset α}
    (h : s.Nonempty) : f (s.max' h) = (s.image f).max' (h.image f)

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
[LinearOrder β]
{f : α → β}
(hf : Monotone f)
{s : Finset α}
(h : s.Nonempty)

f (s.max' h) = (Finset.image f s).max' ⋯


/-- A morphism factors through the image presheaf. -/
@[simps!]
def toImagePresheaf (f : F' ⟶ F) : F' ⟶ (imagePresheaf f).toPresheaf

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F F' : Cᵒᵖ ⥤ Type w}
(f : F' ⟶ F)
(U : Cᵒᵖ)
(x : F'.obj U)

↑((CategoryTheory.GrothendieckTopology.toImagePresheaf f).app U x) = f.app U x


/-- The equivalence `F.elementsᵒᵖ ≌ (yoneda, F)` is compatible with the forgetful functors. -/
@[simps!]
def costructuredArrowYonedaEquivalenceInverseπ (F : Cᵒᵖ ⥤ Type v) :
    (costructuredArrowYonedaEquivalence F).inverse ⋙ (π F).leftOp ≅ CostructuredArrow.proj _ _

(F : CategoryTheory.Functor Cᵒᵖ (Type v))

(X : CategoryTheory.CostructuredArrow CategoryTheory.yoneda F)

(CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalenceInverseπ F).hom.app X =
  CategoryTheory.CategoryStruct.id X.left