Context stringlengths 57 6.04k | file_name stringlengths 21 79 | start int64 14 1.49k | end int64 18 1.5k | theorem stringlengths 25 1.55k | proof stringlengths 5 7.36k | rank int64 0 2.4k |
|---|---|---|---|---|---|---|
import Mathlib.Algebra.MvPolynomial.Variables
#align_import data.mv_polynomial.comm_ring from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4"
noncomputable section
open Set Function Finsupp AddMonoidAlgebra
universe u v
variable {R : Type u} {S : Type v}
namespace MvPolynomial
variable {σ : Type*} {a a' a₁ a₂ : R} {e : ℕ} {n m : σ} {s : σ →₀ ℕ}
section CommRing
variable [CommRing R]
variable {p q : MvPolynomial σ R}
instance instCommRingMvPolynomial : CommRing (MvPolynomial σ R) :=
AddMonoidAlgebra.commRing
variable (σ a a')
-- @[simp] -- Porting note (#10618): simp can prove this
theorem C_sub : (C (a - a') : MvPolynomial σ R) = C a - C a' :=
RingHom.map_sub _ _ _
set_option linter.uppercaseLean3 false in
#align mv_polynomial.C_sub MvPolynomial.C_sub
-- @[simp] -- Porting note (#10618): simp can prove this
theorem C_neg : (C (-a) : MvPolynomial σ R) = -C a :=
RingHom.map_neg _ _
set_option linter.uppercaseLean3 false in
#align mv_polynomial.C_neg MvPolynomial.C_neg
@[simp]
theorem coeff_neg (m : σ →₀ ℕ) (p : MvPolynomial σ R) : coeff m (-p) = -coeff m p :=
Finsupp.neg_apply _ _
#align mv_polynomial.coeff_neg MvPolynomial.coeff_neg
@[simp]
theorem coeff_sub (m : σ →₀ ℕ) (p q : MvPolynomial σ R) : coeff m (p - q) = coeff m p - coeff m q :=
Finsupp.sub_apply _ _ _
#align mv_polynomial.coeff_sub MvPolynomial.coeff_sub
@[simp]
theorem support_neg : (-p).support = p.support :=
Finsupp.support_neg p
#align mv_polynomial.support_neg MvPolynomial.support_neg
theorem support_sub [DecidableEq σ] (p q : MvPolynomial σ R) :
(p - q).support ⊆ p.support ∪ q.support :=
Finsupp.support_sub
#align mv_polynomial.support_sub MvPolynomial.support_sub
variable {σ} (p)
section TotalDegree
@[simp]
| Mathlib/Algebra/MvPolynomial/CommRing.lean | 203 | 204 | theorem totalDegree_neg (a : MvPolynomial σ R) : (-a).totalDegree = a.totalDegree := by |
simp only [totalDegree, support_neg]
| 387 |
import Mathlib.Algebra.MvPolynomial.Variables
#align_import data.mv_polynomial.comm_ring from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4"
noncomputable section
open Set Function Finsupp AddMonoidAlgebra
universe u v
variable {R : Type u} {S : Type v}
namespace MvPolynomial
variable {σ : Type*} {a a' a₁ a₂ : R} {e : ℕ} {n m : σ} {s : σ →₀ ℕ}
section CommRing
variable [CommRing R]
variable {p q : MvPolynomial σ R}
instance instCommRingMvPolynomial : CommRing (MvPolynomial σ R) :=
AddMonoidAlgebra.commRing
variable (σ a a')
-- @[simp] -- Porting note (#10618): simp can prove this
theorem C_sub : (C (a - a') : MvPolynomial σ R) = C a - C a' :=
RingHom.map_sub _ _ _
set_option linter.uppercaseLean3 false in
#align mv_polynomial.C_sub MvPolynomial.C_sub
-- @[simp] -- Porting note (#10618): simp can prove this
theorem C_neg : (C (-a) : MvPolynomial σ R) = -C a :=
RingHom.map_neg _ _
set_option linter.uppercaseLean3 false in
#align mv_polynomial.C_neg MvPolynomial.C_neg
@[simp]
theorem coeff_neg (m : σ →₀ ℕ) (p : MvPolynomial σ R) : coeff m (-p) = -coeff m p :=
Finsupp.neg_apply _ _
#align mv_polynomial.coeff_neg MvPolynomial.coeff_neg
@[simp]
theorem coeff_sub (m : σ →₀ ℕ) (p q : MvPolynomial σ R) : coeff m (p - q) = coeff m p - coeff m q :=
Finsupp.sub_apply _ _ _
#align mv_polynomial.coeff_sub MvPolynomial.coeff_sub
@[simp]
theorem support_neg : (-p).support = p.support :=
Finsupp.support_neg p
#align mv_polynomial.support_neg MvPolynomial.support_neg
theorem support_sub [DecidableEq σ] (p q : MvPolynomial σ R) :
(p - q).support ⊆ p.support ∪ q.support :=
Finsupp.support_sub
#align mv_polynomial.support_sub MvPolynomial.support_sub
variable {σ} (p)
section TotalDegree
@[simp]
theorem totalDegree_neg (a : MvPolynomial σ R) : (-a).totalDegree = a.totalDegree := by
simp only [totalDegree, support_neg]
#align mv_polynomial.total_degree_neg MvPolynomial.totalDegree_neg
| Mathlib/Algebra/MvPolynomial/CommRing.lean | 207 | 212 | theorem totalDegree_sub (a b : MvPolynomial σ R) :
(a - b).totalDegree ≤ max a.totalDegree b.totalDegree :=
calc
(a - b).totalDegree = (a + -b).totalDegree := by | rw [sub_eq_add_neg]
_ ≤ max a.totalDegree (-b).totalDegree := totalDegree_add a (-b)
_ = max a.totalDegree b.totalDegree := by rw [totalDegree_neg]
| 387 |
import Mathlib.Algebra.Algebra.Subalgebra.Basic
import Mathlib.Algebra.MvPolynomial.Rename
import Mathlib.Algebra.MvPolynomial.CommRing
#align_import ring_theory.mv_polynomial.symmetric from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4"
open Equiv (Perm)
noncomputable section
namespace Multiset
variable {R : Type*} [CommSemiring R]
def esymm (s : Multiset R) (n : ℕ) : R :=
((s.powersetCard n).map Multiset.prod).sum
#align multiset.esymm Multiset.esymm
| Mathlib/RingTheory/MvPolynomial/Symmetric.lean | 63 | 66 | theorem _root_.Finset.esymm_map_val {σ} (f : σ → R) (s : Finset σ) (n : ℕ) :
(s.val.map f).esymm n = (s.powersetCard n).sum fun t => t.prod f := by |
simp only [esymm, powersetCard_map, ← Finset.map_val_val_powersetCard, map_map]
rfl
| 388 |
import Mathlib.Algebra.MvPolynomial.Rename
#align_import data.mv_polynomial.comap from "leanprover-community/mathlib"@"aba31c938d3243cc671be7091b28a1e0814647ee"
namespace MvPolynomial
variable {σ : Type*} {τ : Type*} {υ : Type*} {R : Type*} [CommSemiring R]
noncomputable def comap (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R) : (τ → R) → σ → R :=
fun x i => aeval x (f (X i))
#align mv_polynomial.comap MvPolynomial.comap
@[simp]
theorem comap_apply (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R) (x : τ → R) (i : σ) :
comap f x i = aeval x (f (X i)) :=
rfl
#align mv_polynomial.comap_apply MvPolynomial.comap_apply
@[simp]
| Mathlib/Algebra/MvPolynomial/Comap.lean | 48 | 50 | theorem comap_id_apply (x : σ → R) : comap (AlgHom.id R (MvPolynomial σ R)) x = x := by |
funext i
simp only [comap, AlgHom.id_apply, id, aeval_X]
| 389 |
import Mathlib.Algebra.MvPolynomial.Rename
#align_import data.mv_polynomial.comap from "leanprover-community/mathlib"@"aba31c938d3243cc671be7091b28a1e0814647ee"
namespace MvPolynomial
variable {σ : Type*} {τ : Type*} {υ : Type*} {R : Type*} [CommSemiring R]
noncomputable def comap (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R) : (τ → R) → σ → R :=
fun x i => aeval x (f (X i))
#align mv_polynomial.comap MvPolynomial.comap
@[simp]
theorem comap_apply (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R) (x : τ → R) (i : σ) :
comap f x i = aeval x (f (X i)) :=
rfl
#align mv_polynomial.comap_apply MvPolynomial.comap_apply
@[simp]
theorem comap_id_apply (x : σ → R) : comap (AlgHom.id R (MvPolynomial σ R)) x = x := by
funext i
simp only [comap, AlgHom.id_apply, id, aeval_X]
#align mv_polynomial.comap_id_apply MvPolynomial.comap_id_apply
variable (σ R)
| Mathlib/Algebra/MvPolynomial/Comap.lean | 55 | 57 | theorem comap_id : comap (AlgHom.id R (MvPolynomial σ R)) = id := by |
funext x
exact comap_id_apply x
| 389 |
import Mathlib.Algebra.MvPolynomial.Rename
#align_import data.mv_polynomial.comap from "leanprover-community/mathlib"@"aba31c938d3243cc671be7091b28a1e0814647ee"
namespace MvPolynomial
variable {σ : Type*} {τ : Type*} {υ : Type*} {R : Type*} [CommSemiring R]
noncomputable def comap (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R) : (τ → R) → σ → R :=
fun x i => aeval x (f (X i))
#align mv_polynomial.comap MvPolynomial.comap
@[simp]
theorem comap_apply (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R) (x : τ → R) (i : σ) :
comap f x i = aeval x (f (X i)) :=
rfl
#align mv_polynomial.comap_apply MvPolynomial.comap_apply
@[simp]
theorem comap_id_apply (x : σ → R) : comap (AlgHom.id R (MvPolynomial σ R)) x = x := by
funext i
simp only [comap, AlgHom.id_apply, id, aeval_X]
#align mv_polynomial.comap_id_apply MvPolynomial.comap_id_apply
variable (σ R)
theorem comap_id : comap (AlgHom.id R (MvPolynomial σ R)) = id := by
funext x
exact comap_id_apply x
#align mv_polynomial.comap_id MvPolynomial.comap_id
variable {σ R}
| Mathlib/Algebra/MvPolynomial/Comap.lean | 62 | 74 | theorem comap_comp_apply (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R)
(g : MvPolynomial τ R →ₐ[R] MvPolynomial υ R) (x : υ → R) :
comap (g.comp f) x = comap f (comap g x) := by |
funext i
trans aeval x (aeval (fun i => g (X i)) (f (X i)))
· apply eval₂Hom_congr rfl rfl
rw [AlgHom.comp_apply]
suffices g = aeval fun i => g (X i) by rw [← this]
exact aeval_unique g
· simp only [comap, aeval_eq_eval₂Hom, map_eval₂Hom, AlgHom.comp_apply]
refine eval₂Hom_congr ?_ rfl rfl
ext r
apply aeval_C
| 389 |
import Mathlib.Algebra.MvPolynomial.Rename
#align_import data.mv_polynomial.comap from "leanprover-community/mathlib"@"aba31c938d3243cc671be7091b28a1e0814647ee"
namespace MvPolynomial
variable {σ : Type*} {τ : Type*} {υ : Type*} {R : Type*} [CommSemiring R]
noncomputable def comap (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R) : (τ → R) → σ → R :=
fun x i => aeval x (f (X i))
#align mv_polynomial.comap MvPolynomial.comap
@[simp]
theorem comap_apply (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R) (x : τ → R) (i : σ) :
comap f x i = aeval x (f (X i)) :=
rfl
#align mv_polynomial.comap_apply MvPolynomial.comap_apply
@[simp]
theorem comap_id_apply (x : σ → R) : comap (AlgHom.id R (MvPolynomial σ R)) x = x := by
funext i
simp only [comap, AlgHom.id_apply, id, aeval_X]
#align mv_polynomial.comap_id_apply MvPolynomial.comap_id_apply
variable (σ R)
theorem comap_id : comap (AlgHom.id R (MvPolynomial σ R)) = id := by
funext x
exact comap_id_apply x
#align mv_polynomial.comap_id MvPolynomial.comap_id
variable {σ R}
theorem comap_comp_apply (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R)
(g : MvPolynomial τ R →ₐ[R] MvPolynomial υ R) (x : υ → R) :
comap (g.comp f) x = comap f (comap g x) := by
funext i
trans aeval x (aeval (fun i => g (X i)) (f (X i)))
· apply eval₂Hom_congr rfl rfl
rw [AlgHom.comp_apply]
suffices g = aeval fun i => g (X i) by rw [← this]
exact aeval_unique g
· simp only [comap, aeval_eq_eval₂Hom, map_eval₂Hom, AlgHom.comp_apply]
refine eval₂Hom_congr ?_ rfl rfl
ext r
apply aeval_C
#align mv_polynomial.comap_comp_apply MvPolynomial.comap_comp_apply
| Mathlib/Algebra/MvPolynomial/Comap.lean | 77 | 80 | theorem comap_comp (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R)
(g : MvPolynomial τ R →ₐ[R] MvPolynomial υ R) : comap (g.comp f) = comap f ∘ comap g := by |
funext x
exact comap_comp_apply _ _ _
| 389 |
import Mathlib.Algebra.MvPolynomial.Rename
#align_import data.mv_polynomial.comap from "leanprover-community/mathlib"@"aba31c938d3243cc671be7091b28a1e0814647ee"
namespace MvPolynomial
variable {σ : Type*} {τ : Type*} {υ : Type*} {R : Type*} [CommSemiring R]
noncomputable def comap (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R) : (τ → R) → σ → R :=
fun x i => aeval x (f (X i))
#align mv_polynomial.comap MvPolynomial.comap
@[simp]
theorem comap_apply (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R) (x : τ → R) (i : σ) :
comap f x i = aeval x (f (X i)) :=
rfl
#align mv_polynomial.comap_apply MvPolynomial.comap_apply
@[simp]
theorem comap_id_apply (x : σ → R) : comap (AlgHom.id R (MvPolynomial σ R)) x = x := by
funext i
simp only [comap, AlgHom.id_apply, id, aeval_X]
#align mv_polynomial.comap_id_apply MvPolynomial.comap_id_apply
variable (σ R)
theorem comap_id : comap (AlgHom.id R (MvPolynomial σ R)) = id := by
funext x
exact comap_id_apply x
#align mv_polynomial.comap_id MvPolynomial.comap_id
variable {σ R}
theorem comap_comp_apply (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R)
(g : MvPolynomial τ R →ₐ[R] MvPolynomial υ R) (x : υ → R) :
comap (g.comp f) x = comap f (comap g x) := by
funext i
trans aeval x (aeval (fun i => g (X i)) (f (X i)))
· apply eval₂Hom_congr rfl rfl
rw [AlgHom.comp_apply]
suffices g = aeval fun i => g (X i) by rw [← this]
exact aeval_unique g
· simp only [comap, aeval_eq_eval₂Hom, map_eval₂Hom, AlgHom.comp_apply]
refine eval₂Hom_congr ?_ rfl rfl
ext r
apply aeval_C
#align mv_polynomial.comap_comp_apply MvPolynomial.comap_comp_apply
theorem comap_comp (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R)
(g : MvPolynomial τ R →ₐ[R] MvPolynomial υ R) : comap (g.comp f) = comap f ∘ comap g := by
funext x
exact comap_comp_apply _ _ _
#align mv_polynomial.comap_comp MvPolynomial.comap_comp
| Mathlib/Algebra/MvPolynomial/Comap.lean | 83 | 87 | theorem comap_eq_id_of_eq_id (f : MvPolynomial σ R →ₐ[R] MvPolynomial σ R) (hf : ∀ φ, f φ = φ)
(x : σ → R) : comap f x = x := by |
convert comap_id_apply x
ext1 φ
simp [hf, AlgHom.id_apply]
| 389 |
import Mathlib.Algebra.MvPolynomial.Rename
#align_import data.mv_polynomial.comap from "leanprover-community/mathlib"@"aba31c938d3243cc671be7091b28a1e0814647ee"
namespace MvPolynomial
variable {σ : Type*} {τ : Type*} {υ : Type*} {R : Type*} [CommSemiring R]
noncomputable def comap (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R) : (τ → R) → σ → R :=
fun x i => aeval x (f (X i))
#align mv_polynomial.comap MvPolynomial.comap
@[simp]
theorem comap_apply (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R) (x : τ → R) (i : σ) :
comap f x i = aeval x (f (X i)) :=
rfl
#align mv_polynomial.comap_apply MvPolynomial.comap_apply
@[simp]
theorem comap_id_apply (x : σ → R) : comap (AlgHom.id R (MvPolynomial σ R)) x = x := by
funext i
simp only [comap, AlgHom.id_apply, id, aeval_X]
#align mv_polynomial.comap_id_apply MvPolynomial.comap_id_apply
variable (σ R)
theorem comap_id : comap (AlgHom.id R (MvPolynomial σ R)) = id := by
funext x
exact comap_id_apply x
#align mv_polynomial.comap_id MvPolynomial.comap_id
variable {σ R}
theorem comap_comp_apply (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R)
(g : MvPolynomial τ R →ₐ[R] MvPolynomial υ R) (x : υ → R) :
comap (g.comp f) x = comap f (comap g x) := by
funext i
trans aeval x (aeval (fun i => g (X i)) (f (X i)))
· apply eval₂Hom_congr rfl rfl
rw [AlgHom.comp_apply]
suffices g = aeval fun i => g (X i) by rw [← this]
exact aeval_unique g
· simp only [comap, aeval_eq_eval₂Hom, map_eval₂Hom, AlgHom.comp_apply]
refine eval₂Hom_congr ?_ rfl rfl
ext r
apply aeval_C
#align mv_polynomial.comap_comp_apply MvPolynomial.comap_comp_apply
theorem comap_comp (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R)
(g : MvPolynomial τ R →ₐ[R] MvPolynomial υ R) : comap (g.comp f) = comap f ∘ comap g := by
funext x
exact comap_comp_apply _ _ _
#align mv_polynomial.comap_comp MvPolynomial.comap_comp
theorem comap_eq_id_of_eq_id (f : MvPolynomial σ R →ₐ[R] MvPolynomial σ R) (hf : ∀ φ, f φ = φ)
(x : σ → R) : comap f x = x := by
convert comap_id_apply x
ext1 φ
simp [hf, AlgHom.id_apply]
#align mv_polynomial.comap_eq_id_of_eq_id MvPolynomial.comap_eq_id_of_eq_id
| Mathlib/Algebra/MvPolynomial/Comap.lean | 90 | 92 | theorem comap_rename (f : σ → τ) (x : τ → R) : comap (rename f) x = x ∘ f := by |
funext
simp [rename_X, comap_apply, aeval_X]
| 389 |
import Mathlib.CategoryTheory.NatIso
import Mathlib.CategoryTheory.FullSubcategory
#align_import category_theory.essential_image from "leanprover-community/mathlib"@"550b58538991c8977703fdeb7c9d51a5aa27df11"
universe v₁ v₂ v₃ u₁ u₂ u₃
noncomputable section
namespace CategoryTheory
variable {C : Type u₁} {D : Type u₂} {E : Type u₃}
[Category.{v₁} C] [Category.{v₂} D] [Category.{v₃} E] {F : C ⥤ D}
namespace Functor
def essImage (F : C ⥤ D) : Set D := fun Y => ∃ X : C, Nonempty (F.obj X ≅ Y)
#align category_theory.functor.ess_image CategoryTheory.Functor.essImage
def essImage.witness {Y : D} (h : Y ∈ F.essImage) : C :=
h.choose
#align category_theory.functor.ess_image.witness CategoryTheory.Functor.essImage.witness
-- Porting note: in the next, the dot notation `h.witness` no longer works
def essImage.getIso {Y : D} (h : Y ∈ F.essImage) : F.obj (essImage.witness h) ≅ Y :=
Classical.choice h.choose_spec
#align category_theory.functor.ess_image.get_iso CategoryTheory.Functor.essImage.getIso
theorem essImage.ofIso {Y Y' : D} (h : Y ≅ Y') (hY : Y ∈ essImage F) : Y' ∈ essImage F :=
hY.imp fun _ => Nonempty.map (· ≪≫ h)
#align category_theory.functor.ess_image.of_iso CategoryTheory.Functor.essImage.ofIso
theorem essImage.ofNatIso {F' : C ⥤ D} (h : F ≅ F') {Y : D} (hY : Y ∈ essImage F) :
Y ∈ essImage F' :=
hY.imp fun X => Nonempty.map fun t => h.symm.app X ≪≫ t
#align category_theory.functor.ess_image.of_nat_iso CategoryTheory.Functor.essImage.ofNatIso
theorem essImage_eq_of_natIso {F' : C ⥤ D} (h : F ≅ F') : essImage F = essImage F' :=
funext fun _ => propext ⟨essImage.ofNatIso h, essImage.ofNatIso h.symm⟩
#align category_theory.functor.ess_image_eq_of_nat_iso CategoryTheory.Functor.essImage_eq_of_natIso
theorem obj_mem_essImage (F : D ⥤ C) (Y : D) : F.obj Y ∈ essImage F :=
⟨Y, ⟨Iso.refl _⟩⟩
#align category_theory.functor.obj_mem_ess_image CategoryTheory.Functor.obj_mem_essImage
-- Porting note: no hasNonEmptyInstance linter yet
def EssImageSubcategory (F : C ⥤ D) :=
FullSubcategory F.essImage
#align category_theory.functor.ess_image_subcategory CategoryTheory.Functor.EssImageSubcategory
-- Porting note: `deriving Category` is not able to derive this instance
instance : Category (EssImageSubcategory F) :=
(inferInstance : Category.{v₂} (FullSubcategory _))
@[simps!]
def essImageInclusion (F : C ⥤ D) : F.EssImageSubcategory ⥤ D :=
fullSubcategoryInclusion _
#align category_theory.functor.ess_image_inclusion CategoryTheory.Functor.essImageInclusion
#align category_theory.functor.ess_image_inclusion_obj CategoryTheory.Functor.essImageInclusion_obj
#align category_theory.functor.ess_image_inclusion_map CategoryTheory.Functor.essImageInclusion_map
-- Porting note: `deriving Full` is not able to derive this instance
instance : Full (essImageInclusion F) :=
(inferInstance : Full (fullSubcategoryInclusion _))
-- Porting note: `deriving Faithful` is not able to derive this instance
instance : Faithful (essImageInclusion F) :=
(inferInstance : Faithful (fullSubcategoryInclusion _))
@[simps!]
def toEssImage (F : C ⥤ D) : C ⥤ F.EssImageSubcategory :=
FullSubcategory.lift _ F (obj_mem_essImage _)
#align category_theory.functor.to_ess_image CategoryTheory.Functor.toEssImage
#align category_theory.functor.to_ess_image_map CategoryTheory.Functor.toEssImage_map
#align category_theory.functor.to_ess_image_obj_obj CategoryTheory.Functor.toEssImage_obj_obj
@[simps!]
def toEssImageCompEssentialImageInclusion (F : C ⥤ D) : F.toEssImage ⋙ F.essImageInclusion ≅ F :=
FullSubcategory.lift_comp_inclusion _ _ _
#align category_theory.functor.to_ess_image_comp_essential_image_inclusion CategoryTheory.Functor.toEssImageCompEssentialImageInclusion
#align category_theory.functor.to_ess_image_comp_essential_image_inclusion_hom_app CategoryTheory.Functor.toEssImageCompEssentialImageInclusion_hom_app
#align category_theory.functor.to_ess_image_comp_essential_image_inclusion_inv_app CategoryTheory.Functor.toEssImageCompEssentialImageInclusion_inv_app
class EssSurj (F : C ⥤ D) : Prop where
mem_essImage (Y : D) : Y ∈ F.essImage
#align category_theory.ess_surj CategoryTheory.Functor.EssSurj
instance EssSurj.toEssImage : EssSurj F.toEssImage where
mem_essImage := fun ⟨_, hY⟩ =>
⟨_, ⟨⟨_, _, hY.getIso.hom_inv_id, hY.getIso.inv_hom_id⟩⟩⟩
variable (F)
variable [F.EssSurj]
def objPreimage (Y : D) : C :=
essImage.witness (@EssSurj.mem_essImage _ _ _ _ F _ Y)
#align category_theory.functor.obj_preimage CategoryTheory.Functor.objPreimage
def objObjPreimageIso (Y : D) : F.obj (F.objPreimage Y) ≅ Y :=
Functor.essImage.getIso _
#align category_theory.functor.obj_obj_preimage_iso CategoryTheory.Functor.objObjPreimageIso
instance Faithful.toEssImage (F : C ⥤ D) [Faithful F] : Faithful F.toEssImage :=
Faithful.of_comp_iso F.toEssImageCompEssentialImageInclusion
#align category_theory.faithful.to_ess_image CategoryTheory.Functor.Faithful.toEssImage
instance Full.toEssImage (F : C ⥤ D) [Full F] : Full F.toEssImage :=
Full.of_comp_faithful_iso F.toEssImageCompEssentialImageInclusion
#align category_theory.full.to_ess_image CategoryTheory.Functor.Full.toEssImage
instance instEssSurjId : EssSurj (𝟭 C) where
mem_essImage Y := ⟨Y, ⟨Iso.refl _⟩⟩
| Mathlib/CategoryTheory/EssentialImage.lean | 169 | 172 | theorem essSurj_of_surj (h : Function.Surjective F.obj) : EssSurj F where
mem_essImage Y := by |
obtain ⟨X, rfl⟩ := h Y
apply obj_mem_essImage
| 390 |
import Mathlib.Order.Filter.Basic
import Mathlib.Data.Set.Countable
#align_import order.filter.countable_Inter from "leanprover-community/mathlib"@"b9e46fe101fc897fb2e7edaf0bf1f09ea49eb81a"
open Set Filter
open Filter
variable {ι : Sort*} {α β : Type*}
class CountableInterFilter (l : Filter α) : Prop where
countable_sInter_mem : ∀ S : Set (Set α), S.Countable → (∀ s ∈ S, s ∈ l) → ⋂₀ S ∈ l
#align countable_Inter_filter CountableInterFilter
variable {l : Filter α} [CountableInterFilter l]
theorem countable_sInter_mem {S : Set (Set α)} (hSc : S.Countable) : ⋂₀ S ∈ l ↔ ∀ s ∈ S, s ∈ l :=
⟨fun hS _s hs => mem_of_superset hS (sInter_subset_of_mem hs),
CountableInterFilter.countable_sInter_mem _ hSc⟩
#align countable_sInter_mem countable_sInter_mem
theorem countable_iInter_mem [Countable ι] {s : ι → Set α} : (⋂ i, s i) ∈ l ↔ ∀ i, s i ∈ l :=
sInter_range s ▸ (countable_sInter_mem (countable_range _)).trans forall_mem_range
#align countable_Inter_mem countable_iInter_mem
| Mathlib/Order/Filter/CountableInter.lean | 58 | 62 | theorem countable_bInter_mem {ι : Type*} {S : Set ι} (hS : S.Countable) {s : ∀ i ∈ S, Set α} :
(⋂ i, ⋂ hi : i ∈ S, s i ‹_›) ∈ l ↔ ∀ i, ∀ hi : i ∈ S, s i ‹_› ∈ l := by |
rw [biInter_eq_iInter]
haveI := hS.toEncodable
exact countable_iInter_mem.trans Subtype.forall
| 391 |
import Mathlib.Order.Filter.Basic
import Mathlib.Data.Set.Countable
#align_import order.filter.countable_Inter from "leanprover-community/mathlib"@"b9e46fe101fc897fb2e7edaf0bf1f09ea49eb81a"
open Set Filter
open Filter
variable {ι : Sort*} {α β : Type*}
class CountableInterFilter (l : Filter α) : Prop where
countable_sInter_mem : ∀ S : Set (Set α), S.Countable → (∀ s ∈ S, s ∈ l) → ⋂₀ S ∈ l
#align countable_Inter_filter CountableInterFilter
variable {l : Filter α} [CountableInterFilter l]
theorem countable_sInter_mem {S : Set (Set α)} (hSc : S.Countable) : ⋂₀ S ∈ l ↔ ∀ s ∈ S, s ∈ l :=
⟨fun hS _s hs => mem_of_superset hS (sInter_subset_of_mem hs),
CountableInterFilter.countable_sInter_mem _ hSc⟩
#align countable_sInter_mem countable_sInter_mem
theorem countable_iInter_mem [Countable ι] {s : ι → Set α} : (⋂ i, s i) ∈ l ↔ ∀ i, s i ∈ l :=
sInter_range s ▸ (countable_sInter_mem (countable_range _)).trans forall_mem_range
#align countable_Inter_mem countable_iInter_mem
theorem countable_bInter_mem {ι : Type*} {S : Set ι} (hS : S.Countable) {s : ∀ i ∈ S, Set α} :
(⋂ i, ⋂ hi : i ∈ S, s i ‹_›) ∈ l ↔ ∀ i, ∀ hi : i ∈ S, s i ‹_› ∈ l := by
rw [biInter_eq_iInter]
haveI := hS.toEncodable
exact countable_iInter_mem.trans Subtype.forall
#align countable_bInter_mem countable_bInter_mem
| Mathlib/Order/Filter/CountableInter.lean | 65 | 68 | theorem eventually_countable_forall [Countable ι] {p : α → ι → Prop} :
(∀ᶠ x in l, ∀ i, p x i) ↔ ∀ i, ∀ᶠ x in l, p x i := by |
simpa only [Filter.Eventually, setOf_forall] using
@countable_iInter_mem _ _ l _ _ fun i => { x | p x i }
| 391 |
import Mathlib.Order.Filter.Basic
import Mathlib.Data.Set.Countable
#align_import order.filter.countable_Inter from "leanprover-community/mathlib"@"b9e46fe101fc897fb2e7edaf0bf1f09ea49eb81a"
open Set Filter
open Filter
variable {ι : Sort*} {α β : Type*}
class CountableInterFilter (l : Filter α) : Prop where
countable_sInter_mem : ∀ S : Set (Set α), S.Countable → (∀ s ∈ S, s ∈ l) → ⋂₀ S ∈ l
#align countable_Inter_filter CountableInterFilter
variable {l : Filter α} [CountableInterFilter l]
theorem countable_sInter_mem {S : Set (Set α)} (hSc : S.Countable) : ⋂₀ S ∈ l ↔ ∀ s ∈ S, s ∈ l :=
⟨fun hS _s hs => mem_of_superset hS (sInter_subset_of_mem hs),
CountableInterFilter.countable_sInter_mem _ hSc⟩
#align countable_sInter_mem countable_sInter_mem
theorem countable_iInter_mem [Countable ι] {s : ι → Set α} : (⋂ i, s i) ∈ l ↔ ∀ i, s i ∈ l :=
sInter_range s ▸ (countable_sInter_mem (countable_range _)).trans forall_mem_range
#align countable_Inter_mem countable_iInter_mem
theorem countable_bInter_mem {ι : Type*} {S : Set ι} (hS : S.Countable) {s : ∀ i ∈ S, Set α} :
(⋂ i, ⋂ hi : i ∈ S, s i ‹_›) ∈ l ↔ ∀ i, ∀ hi : i ∈ S, s i ‹_› ∈ l := by
rw [biInter_eq_iInter]
haveI := hS.toEncodable
exact countable_iInter_mem.trans Subtype.forall
#align countable_bInter_mem countable_bInter_mem
theorem eventually_countable_forall [Countable ι] {p : α → ι → Prop} :
(∀ᶠ x in l, ∀ i, p x i) ↔ ∀ i, ∀ᶠ x in l, p x i := by
simpa only [Filter.Eventually, setOf_forall] using
@countable_iInter_mem _ _ l _ _ fun i => { x | p x i }
#align eventually_countable_forall eventually_countable_forall
| Mathlib/Order/Filter/CountableInter.lean | 71 | 75 | theorem eventually_countable_ball {ι : Type*} {S : Set ι} (hS : S.Countable)
{p : α → ∀ i ∈ S, Prop} :
(∀ᶠ x in l, ∀ i hi, p x i hi) ↔ ∀ i hi, ∀ᶠ x in l, p x i hi := by |
simpa only [Filter.Eventually, setOf_forall] using
@countable_bInter_mem _ l _ _ _ hS fun i hi => { x | p x i hi }
| 391 |
import Mathlib.Order.Filter.Basic
import Mathlib.Data.Set.Countable
#align_import order.filter.countable_Inter from "leanprover-community/mathlib"@"b9e46fe101fc897fb2e7edaf0bf1f09ea49eb81a"
open Set Filter
open Filter
variable {ι : Sort*} {α β : Type*}
class CountableInterFilter (l : Filter α) : Prop where
countable_sInter_mem : ∀ S : Set (Set α), S.Countable → (∀ s ∈ S, s ∈ l) → ⋂₀ S ∈ l
#align countable_Inter_filter CountableInterFilter
variable {l : Filter α} [CountableInterFilter l]
theorem countable_sInter_mem {S : Set (Set α)} (hSc : S.Countable) : ⋂₀ S ∈ l ↔ ∀ s ∈ S, s ∈ l :=
⟨fun hS _s hs => mem_of_superset hS (sInter_subset_of_mem hs),
CountableInterFilter.countable_sInter_mem _ hSc⟩
#align countable_sInter_mem countable_sInter_mem
theorem countable_iInter_mem [Countable ι] {s : ι → Set α} : (⋂ i, s i) ∈ l ↔ ∀ i, s i ∈ l :=
sInter_range s ▸ (countable_sInter_mem (countable_range _)).trans forall_mem_range
#align countable_Inter_mem countable_iInter_mem
theorem countable_bInter_mem {ι : Type*} {S : Set ι} (hS : S.Countable) {s : ∀ i ∈ S, Set α} :
(⋂ i, ⋂ hi : i ∈ S, s i ‹_›) ∈ l ↔ ∀ i, ∀ hi : i ∈ S, s i ‹_› ∈ l := by
rw [biInter_eq_iInter]
haveI := hS.toEncodable
exact countable_iInter_mem.trans Subtype.forall
#align countable_bInter_mem countable_bInter_mem
theorem eventually_countable_forall [Countable ι] {p : α → ι → Prop} :
(∀ᶠ x in l, ∀ i, p x i) ↔ ∀ i, ∀ᶠ x in l, p x i := by
simpa only [Filter.Eventually, setOf_forall] using
@countable_iInter_mem _ _ l _ _ fun i => { x | p x i }
#align eventually_countable_forall eventually_countable_forall
theorem eventually_countable_ball {ι : Type*} {S : Set ι} (hS : S.Countable)
{p : α → ∀ i ∈ S, Prop} :
(∀ᶠ x in l, ∀ i hi, p x i hi) ↔ ∀ i hi, ∀ᶠ x in l, p x i hi := by
simpa only [Filter.Eventually, setOf_forall] using
@countable_bInter_mem _ l _ _ _ hS fun i hi => { x | p x i hi }
#align eventually_countable_ball eventually_countable_ball
theorem EventuallyLE.countable_iUnion [Countable ι] {s t : ι → Set α} (h : ∀ i, s i ≤ᶠ[l] t i) :
⋃ i, s i ≤ᶠ[l] ⋃ i, t i :=
(eventually_countable_forall.2 h).mono fun _ hst hs => mem_iUnion.2 <| (mem_iUnion.1 hs).imp hst
#align eventually_le.countable_Union EventuallyLE.countable_iUnion
theorem EventuallyEq.countable_iUnion [Countable ι] {s t : ι → Set α} (h : ∀ i, s i =ᶠ[l] t i) :
⋃ i, s i =ᶠ[l] ⋃ i, t i :=
(EventuallyLE.countable_iUnion fun i => (h i).le).antisymm
(EventuallyLE.countable_iUnion fun i => (h i).symm.le)
#align eventually_eq.countable_Union EventuallyEq.countable_iUnion
| Mathlib/Order/Filter/CountableInter.lean | 89 | 94 | theorem EventuallyLE.countable_bUnion {ι : Type*} {S : Set ι} (hS : S.Countable)
{s t : ∀ i ∈ S, Set α} (h : ∀ i hi, s i hi ≤ᶠ[l] t i hi) :
⋃ i ∈ S, s i ‹_› ≤ᶠ[l] ⋃ i ∈ S, t i ‹_› := by |
simp only [biUnion_eq_iUnion]
haveI := hS.toEncodable
exact EventuallyLE.countable_iUnion fun i => h i i.2
| 391 |
import Mathlib.Order.Filter.Basic
import Mathlib.Data.Set.Countable
#align_import order.filter.countable_Inter from "leanprover-community/mathlib"@"b9e46fe101fc897fb2e7edaf0bf1f09ea49eb81a"
open Set Filter
open Filter
variable {ι : Sort*} {α β : Type*}
class CountableInterFilter (l : Filter α) : Prop where
countable_sInter_mem : ∀ S : Set (Set α), S.Countable → (∀ s ∈ S, s ∈ l) → ⋂₀ S ∈ l
#align countable_Inter_filter CountableInterFilter
variable {l : Filter α} [CountableInterFilter l]
theorem countable_sInter_mem {S : Set (Set α)} (hSc : S.Countable) : ⋂₀ S ∈ l ↔ ∀ s ∈ S, s ∈ l :=
⟨fun hS _s hs => mem_of_superset hS (sInter_subset_of_mem hs),
CountableInterFilter.countable_sInter_mem _ hSc⟩
#align countable_sInter_mem countable_sInter_mem
theorem countable_iInter_mem [Countable ι] {s : ι → Set α} : (⋂ i, s i) ∈ l ↔ ∀ i, s i ∈ l :=
sInter_range s ▸ (countable_sInter_mem (countable_range _)).trans forall_mem_range
#align countable_Inter_mem countable_iInter_mem
theorem countable_bInter_mem {ι : Type*} {S : Set ι} (hS : S.Countable) {s : ∀ i ∈ S, Set α} :
(⋂ i, ⋂ hi : i ∈ S, s i ‹_›) ∈ l ↔ ∀ i, ∀ hi : i ∈ S, s i ‹_› ∈ l := by
rw [biInter_eq_iInter]
haveI := hS.toEncodable
exact countable_iInter_mem.trans Subtype.forall
#align countable_bInter_mem countable_bInter_mem
theorem eventually_countable_forall [Countable ι] {p : α → ι → Prop} :
(∀ᶠ x in l, ∀ i, p x i) ↔ ∀ i, ∀ᶠ x in l, p x i := by
simpa only [Filter.Eventually, setOf_forall] using
@countable_iInter_mem _ _ l _ _ fun i => { x | p x i }
#align eventually_countable_forall eventually_countable_forall
theorem eventually_countable_ball {ι : Type*} {S : Set ι} (hS : S.Countable)
{p : α → ∀ i ∈ S, Prop} :
(∀ᶠ x in l, ∀ i hi, p x i hi) ↔ ∀ i hi, ∀ᶠ x in l, p x i hi := by
simpa only [Filter.Eventually, setOf_forall] using
@countable_bInter_mem _ l _ _ _ hS fun i hi => { x | p x i hi }
#align eventually_countable_ball eventually_countable_ball
theorem EventuallyLE.countable_iUnion [Countable ι] {s t : ι → Set α} (h : ∀ i, s i ≤ᶠ[l] t i) :
⋃ i, s i ≤ᶠ[l] ⋃ i, t i :=
(eventually_countable_forall.2 h).mono fun _ hst hs => mem_iUnion.2 <| (mem_iUnion.1 hs).imp hst
#align eventually_le.countable_Union EventuallyLE.countable_iUnion
theorem EventuallyEq.countable_iUnion [Countable ι] {s t : ι → Set α} (h : ∀ i, s i =ᶠ[l] t i) :
⋃ i, s i =ᶠ[l] ⋃ i, t i :=
(EventuallyLE.countable_iUnion fun i => (h i).le).antisymm
(EventuallyLE.countable_iUnion fun i => (h i).symm.le)
#align eventually_eq.countable_Union EventuallyEq.countable_iUnion
theorem EventuallyLE.countable_bUnion {ι : Type*} {S : Set ι} (hS : S.Countable)
{s t : ∀ i ∈ S, Set α} (h : ∀ i hi, s i hi ≤ᶠ[l] t i hi) :
⋃ i ∈ S, s i ‹_› ≤ᶠ[l] ⋃ i ∈ S, t i ‹_› := by
simp only [biUnion_eq_iUnion]
haveI := hS.toEncodable
exact EventuallyLE.countable_iUnion fun i => h i i.2
#align eventually_le.countable_bUnion EventuallyLE.countable_bUnion
theorem EventuallyEq.countable_bUnion {ι : Type*} {S : Set ι} (hS : S.Countable)
{s t : ∀ i ∈ S, Set α} (h : ∀ i hi, s i hi =ᶠ[l] t i hi) :
⋃ i ∈ S, s i ‹_› =ᶠ[l] ⋃ i ∈ S, t i ‹_› :=
(EventuallyLE.countable_bUnion hS fun i hi => (h i hi).le).antisymm
(EventuallyLE.countable_bUnion hS fun i hi => (h i hi).symm.le)
#align eventually_eq.countable_bUnion EventuallyEq.countable_bUnion
theorem EventuallyLE.countable_iInter [Countable ι] {s t : ι → Set α} (h : ∀ i, s i ≤ᶠ[l] t i) :
⋂ i, s i ≤ᶠ[l] ⋂ i, t i :=
(eventually_countable_forall.2 h).mono fun _ hst hs =>
mem_iInter.2 fun i => hst _ (mem_iInter.1 hs i)
#align eventually_le.countable_Inter EventuallyLE.countable_iInter
theorem EventuallyEq.countable_iInter [Countable ι] {s t : ι → Set α} (h : ∀ i, s i =ᶠ[l] t i) :
⋂ i, s i =ᶠ[l] ⋂ i, t i :=
(EventuallyLE.countable_iInter fun i => (h i).le).antisymm
(EventuallyLE.countable_iInter fun i => (h i).symm.le)
#align eventually_eq.countable_Inter EventuallyEq.countable_iInter
| Mathlib/Order/Filter/CountableInter.lean | 116 | 121 | theorem EventuallyLE.countable_bInter {ι : Type*} {S : Set ι} (hS : S.Countable)
{s t : ∀ i ∈ S, Set α} (h : ∀ i hi, s i hi ≤ᶠ[l] t i hi) :
⋂ i ∈ S, s i ‹_› ≤ᶠ[l] ⋂ i ∈ S, t i ‹_› := by |
simp only [biInter_eq_iInter]
haveI := hS.toEncodable
exact EventuallyLE.countable_iInter fun i => h i i.2
| 391 |
import Mathlib.Algebra.Order.Ring.Int
import Mathlib.Algebra.Ring.Rat
#align_import data.rat.order from "leanprover-community/mathlib"@"a59dad53320b73ef180174aae867addd707ef00e"
assert_not_exists Field
assert_not_exists Finset
assert_not_exists Set.Icc
assert_not_exists GaloisConnection
namespace Rat
variable {a b c p q : ℚ}
@[simp] lemma divInt_nonneg_iff_of_pos_right {a b : ℤ} (hb : 0 < b) : 0 ≤ a /. b ↔ 0 ≤ a := by
cases' hab : a /. b with n d hd hnd
rw [mk'_eq_divInt, divInt_eq_iff hb.ne' (mod_cast hd)] at hab
rw [← num_nonneg, ← mul_nonneg_iff_of_pos_right hb, ← hab,
mul_nonneg_iff_of_pos_right (mod_cast Nat.pos_of_ne_zero hd)]
#align rat.mk_nonneg Rat.divInt_nonneg_iff_of_pos_right
@[simp] lemma divInt_nonneg {a b : ℤ} (ha : 0 ≤ a) (hb : 0 ≤ b) : 0 ≤ a /. b := by
obtain rfl | hb := hb.eq_or_lt
· simp
rfl
rwa [divInt_nonneg_iff_of_pos_right hb]
@[simp] lemma mkRat_nonneg {a : ℤ} (ha : 0 ≤ a) (b : ℕ) : 0 ≤ mkRat a b := by
simpa using divInt_nonneg ha (Int.natCast_nonneg _)
| Mathlib/Algebra/Order/Ring/Rat.lean | 50 | 59 | theorem ofScientific_nonneg (m : ℕ) (s : Bool) (e : ℕ) :
0 ≤ Rat.ofScientific m s e := by |
rw [Rat.ofScientific]
cases s
· rw [if_neg (by decide)]
refine num_nonneg.mp ?_
rw [num_natCast]
exact Int.natCast_nonneg _
· rw [if_pos rfl, normalize_eq_mkRat]
exact Rat.mkRat_nonneg (Int.natCast_nonneg _) _
| 392 |
import Mathlib.Algebra.Order.Ring.Abs
import Mathlib.Algebra.Order.Ring.Rat
import Mathlib.Data.Rat.Lemmas
import Mathlib.Data.Int.Sqrt
#align_import data.rat.sqrt from "leanprover-community/mathlib"@"46a64b5b4268c594af770c44d9e502afc6a515cb"
namespace Rat
-- @[pp_nodot] porting note: unknown attribute
def sqrt (q : ℚ) : ℚ := mkRat (Int.sqrt q.num) (Nat.sqrt q.den)
#align rat.sqrt Rat.sqrt
| Mathlib/Data/Rat/Sqrt.lean | 30 | 31 | theorem sqrt_eq (q : ℚ) : Rat.sqrt (q * q) = |q| := by |
rw [sqrt, mul_self_num, mul_self_den, Int.sqrt_eq, Nat.sqrt_eq, abs_def, divInt_ofNat]
| 393 |
import Mathlib.Analysis.Normed.Field.Basic
#align_import topology.metric_space.cau_seq_filter from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
universe u v
open Set Filter
open scoped Classical
open Topology
variable {β : Type v}
theorem CauSeq.tendsto_limit [NormedRing β] [hn : IsAbsoluteValue (norm : β → ℝ)]
(f : CauSeq β norm) [CauSeq.IsComplete β norm] : Tendsto f atTop (𝓝 f.lim) :=
tendsto_nhds.mpr
(by
intro s os lfs
suffices ∃ a : ℕ, ∀ b : ℕ, b ≥ a → f b ∈ s by simpa using this
rcases Metric.isOpen_iff.1 os _ lfs with ⟨ε, ⟨hε, hεs⟩⟩
cases' Setoid.symm (CauSeq.equiv_lim f) _ hε with N hN
exists N
intro b hb
apply hεs
dsimp [Metric.ball]
rw [dist_comm, dist_eq_norm]
solve_by_elim)
#align cau_seq.tendsto_limit CauSeq.tendsto_limit
variable [NormedField β]
open Metric
| Mathlib/Topology/MetricSpace/CauSeqFilter.lean | 55 | 64 | theorem CauchySeq.isCauSeq {f : ℕ → β} (hf : CauchySeq f) : IsCauSeq norm f := by |
cases' cauchy_iff.1 hf with hf1 hf2
intro ε hε
rcases hf2 { x | dist x.1 x.2 < ε } (dist_mem_uniformity hε) with ⟨t, ⟨ht, htsub⟩⟩
simp only [mem_map, mem_atTop_sets, ge_iff_le, mem_preimage] at ht; cases' ht with N hN
exists N
intro j hj
rw [← dist_eq_norm]
apply @htsub (f j, f N)
apply Set.mk_mem_prod <;> solve_by_elim [le_refl]
| 394 |
import Mathlib.Analysis.Normed.Field.Basic
#align_import topology.metric_space.cau_seq_filter from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
universe u v
open Set Filter
open scoped Classical
open Topology
variable {β : Type v}
theorem CauSeq.tendsto_limit [NormedRing β] [hn : IsAbsoluteValue (norm : β → ℝ)]
(f : CauSeq β norm) [CauSeq.IsComplete β norm] : Tendsto f atTop (𝓝 f.lim) :=
tendsto_nhds.mpr
(by
intro s os lfs
suffices ∃ a : ℕ, ∀ b : ℕ, b ≥ a → f b ∈ s by simpa using this
rcases Metric.isOpen_iff.1 os _ lfs with ⟨ε, ⟨hε, hεs⟩⟩
cases' Setoid.symm (CauSeq.equiv_lim f) _ hε with N hN
exists N
intro b hb
apply hεs
dsimp [Metric.ball]
rw [dist_comm, dist_eq_norm]
solve_by_elim)
#align cau_seq.tendsto_limit CauSeq.tendsto_limit
variable [NormedField β]
open Metric
theorem CauchySeq.isCauSeq {f : ℕ → β} (hf : CauchySeq f) : IsCauSeq norm f := by
cases' cauchy_iff.1 hf with hf1 hf2
intro ε hε
rcases hf2 { x | dist x.1 x.2 < ε } (dist_mem_uniformity hε) with ⟨t, ⟨ht, htsub⟩⟩
simp only [mem_map, mem_atTop_sets, ge_iff_le, mem_preimage] at ht; cases' ht with N hN
exists N
intro j hj
rw [← dist_eq_norm]
apply @htsub (f j, f N)
apply Set.mk_mem_prod <;> solve_by_elim [le_refl]
#align cauchy_seq.is_cau_seq CauchySeq.isCauSeq
| Mathlib/Topology/MetricSpace/CauSeqFilter.lean | 67 | 82 | theorem CauSeq.cauchySeq (f : CauSeq β norm) : CauchySeq f := by |
refine cauchy_iff.2 ⟨by infer_instance, fun s hs => ?_⟩
rcases mem_uniformity_dist.1 hs with ⟨ε, ⟨hε, hεs⟩⟩
cases' CauSeq.cauchy₂ f hε with N hN
exists { n | n ≥ N }.image f
simp only [exists_prop, mem_atTop_sets, mem_map, mem_image, ge_iff_le, mem_setOf_eq]
constructor
· exists N
intro b hb
exists b
· rintro ⟨a, b⟩ ⟨⟨a', ⟨ha'1, ha'2⟩⟩, ⟨b', ⟨hb'1, hb'2⟩⟩⟩
dsimp at ha'1 ha'2 hb'1 hb'2
rw [← ha'2, ← hb'2]
apply hεs
rw [dist_eq_norm]
apply hN <;> assumption
| 394 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
| Mathlib/Order/SymmDiff.lean | 96 | 96 | theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by | decide
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section GeneralizedCoheytingAlgebra
variable [GeneralizedCoheytingAlgebra α] (a b c d : α)
@[simp]
theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b :=
rfl
#align to_dual_symm_diff toDual_symmDiff
@[simp]
theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b :=
rfl
#align of_dual_bihimp ofDual_bihimp
| Mathlib/Order/SymmDiff.lean | 113 | 113 | theorem symmDiff_comm : a ∆ b = b ∆ a := by | simp only [symmDiff, sup_comm]
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section GeneralizedCoheytingAlgebra
variable [GeneralizedCoheytingAlgebra α] (a b c d : α)
@[simp]
theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b :=
rfl
#align to_dual_symm_diff toDual_symmDiff
@[simp]
theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b :=
rfl
#align of_dual_bihimp ofDual_bihimp
theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm]
#align symm_diff_comm symmDiff_comm
instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) :=
⟨symmDiff_comm⟩
#align symm_diff_is_comm symmDiff_isCommutative
@[simp]
| Mathlib/Order/SymmDiff.lean | 121 | 121 | theorem symmDiff_self : a ∆ a = ⊥ := by | rw [symmDiff, sup_idem, sdiff_self]
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section GeneralizedCoheytingAlgebra
variable [GeneralizedCoheytingAlgebra α] (a b c d : α)
@[simp]
theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b :=
rfl
#align to_dual_symm_diff toDual_symmDiff
@[simp]
theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b :=
rfl
#align of_dual_bihimp ofDual_bihimp
theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm]
#align symm_diff_comm symmDiff_comm
instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) :=
⟨symmDiff_comm⟩
#align symm_diff_is_comm symmDiff_isCommutative
@[simp]
theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self]
#align symm_diff_self symmDiff_self
@[simp]
| Mathlib/Order/SymmDiff.lean | 125 | 125 | theorem symmDiff_bot : a ∆ ⊥ = a := by | rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq]
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section GeneralizedCoheytingAlgebra
variable [GeneralizedCoheytingAlgebra α] (a b c d : α)
@[simp]
theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b :=
rfl
#align to_dual_symm_diff toDual_symmDiff
@[simp]
theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b :=
rfl
#align of_dual_bihimp ofDual_bihimp
theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm]
#align symm_diff_comm symmDiff_comm
instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) :=
⟨symmDiff_comm⟩
#align symm_diff_is_comm symmDiff_isCommutative
@[simp]
theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self]
#align symm_diff_self symmDiff_self
@[simp]
theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq]
#align symm_diff_bot symmDiff_bot
@[simp]
| Mathlib/Order/SymmDiff.lean | 129 | 129 | theorem bot_symmDiff : ⊥ ∆ a = a := by | rw [symmDiff_comm, symmDiff_bot]
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section GeneralizedCoheytingAlgebra
variable [GeneralizedCoheytingAlgebra α] (a b c d : α)
@[simp]
theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b :=
rfl
#align to_dual_symm_diff toDual_symmDiff
@[simp]
theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b :=
rfl
#align of_dual_bihimp ofDual_bihimp
theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm]
#align symm_diff_comm symmDiff_comm
instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) :=
⟨symmDiff_comm⟩
#align symm_diff_is_comm symmDiff_isCommutative
@[simp]
theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self]
#align symm_diff_self symmDiff_self
@[simp]
theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq]
#align symm_diff_bot symmDiff_bot
@[simp]
theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot]
#align bot_symm_diff bot_symmDiff
@[simp]
| Mathlib/Order/SymmDiff.lean | 133 | 134 | theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by |
simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff]
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section GeneralizedCoheytingAlgebra
variable [GeneralizedCoheytingAlgebra α] (a b c d : α)
@[simp]
theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b :=
rfl
#align to_dual_symm_diff toDual_symmDiff
@[simp]
theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b :=
rfl
#align of_dual_bihimp ofDual_bihimp
theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm]
#align symm_diff_comm symmDiff_comm
instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) :=
⟨symmDiff_comm⟩
#align symm_diff_is_comm symmDiff_isCommutative
@[simp]
theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self]
#align symm_diff_self symmDiff_self
@[simp]
theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq]
#align symm_diff_bot symmDiff_bot
@[simp]
theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot]
#align bot_symm_diff bot_symmDiff
@[simp]
theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by
simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff]
#align symm_diff_eq_bot symmDiff_eq_bot
| Mathlib/Order/SymmDiff.lean | 137 | 138 | theorem symmDiff_of_le {a b : α} (h : a ≤ b) : a ∆ b = b \ a := by |
rw [symmDiff, sdiff_eq_bot_iff.2 h, bot_sup_eq]
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section GeneralizedCoheytingAlgebra
variable [GeneralizedCoheytingAlgebra α] (a b c d : α)
@[simp]
theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b :=
rfl
#align to_dual_symm_diff toDual_symmDiff
@[simp]
theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b :=
rfl
#align of_dual_bihimp ofDual_bihimp
theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm]
#align symm_diff_comm symmDiff_comm
instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) :=
⟨symmDiff_comm⟩
#align symm_diff_is_comm symmDiff_isCommutative
@[simp]
theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self]
#align symm_diff_self symmDiff_self
@[simp]
theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq]
#align symm_diff_bot symmDiff_bot
@[simp]
theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot]
#align bot_symm_diff bot_symmDiff
@[simp]
theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by
simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff]
#align symm_diff_eq_bot symmDiff_eq_bot
theorem symmDiff_of_le {a b : α} (h : a ≤ b) : a ∆ b = b \ a := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, bot_sup_eq]
#align symm_diff_of_le symmDiff_of_le
| Mathlib/Order/SymmDiff.lean | 141 | 142 | theorem symmDiff_of_ge {a b : α} (h : b ≤ a) : a ∆ b = a \ b := by |
rw [symmDiff, sdiff_eq_bot_iff.2 h, sup_bot_eq]
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section GeneralizedCoheytingAlgebra
variable [GeneralizedCoheytingAlgebra α] (a b c d : α)
@[simp]
theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b :=
rfl
#align to_dual_symm_diff toDual_symmDiff
@[simp]
theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b :=
rfl
#align of_dual_bihimp ofDual_bihimp
theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm]
#align symm_diff_comm symmDiff_comm
instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) :=
⟨symmDiff_comm⟩
#align symm_diff_is_comm symmDiff_isCommutative
@[simp]
theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self]
#align symm_diff_self symmDiff_self
@[simp]
theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq]
#align symm_diff_bot symmDiff_bot
@[simp]
theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot]
#align bot_symm_diff bot_symmDiff
@[simp]
theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by
simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff]
#align symm_diff_eq_bot symmDiff_eq_bot
theorem symmDiff_of_le {a b : α} (h : a ≤ b) : a ∆ b = b \ a := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, bot_sup_eq]
#align symm_diff_of_le symmDiff_of_le
theorem symmDiff_of_ge {a b : α} (h : b ≤ a) : a ∆ b = a \ b := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, sup_bot_eq]
#align symm_diff_of_ge symmDiff_of_ge
theorem symmDiff_le {a b c : α} (ha : a ≤ b ⊔ c) (hb : b ≤ a ⊔ c) : a ∆ b ≤ c :=
sup_le (sdiff_le_iff.2 ha) <| sdiff_le_iff.2 hb
#align symm_diff_le symmDiff_le
| Mathlib/Order/SymmDiff.lean | 149 | 150 | theorem symmDiff_le_iff {a b c : α} : a ∆ b ≤ c ↔ a ≤ b ⊔ c ∧ b ≤ a ⊔ c := by |
simp_rw [symmDiff, sup_le_iff, sdiff_le_iff]
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section GeneralizedCoheytingAlgebra
variable [GeneralizedCoheytingAlgebra α] (a b c d : α)
@[simp]
theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b :=
rfl
#align to_dual_symm_diff toDual_symmDiff
@[simp]
theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b :=
rfl
#align of_dual_bihimp ofDual_bihimp
theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm]
#align symm_diff_comm symmDiff_comm
instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) :=
⟨symmDiff_comm⟩
#align symm_diff_is_comm symmDiff_isCommutative
@[simp]
theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self]
#align symm_diff_self symmDiff_self
@[simp]
theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq]
#align symm_diff_bot symmDiff_bot
@[simp]
theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot]
#align bot_symm_diff bot_symmDiff
@[simp]
theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by
simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff]
#align symm_diff_eq_bot symmDiff_eq_bot
theorem symmDiff_of_le {a b : α} (h : a ≤ b) : a ∆ b = b \ a := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, bot_sup_eq]
#align symm_diff_of_le symmDiff_of_le
theorem symmDiff_of_ge {a b : α} (h : b ≤ a) : a ∆ b = a \ b := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, sup_bot_eq]
#align symm_diff_of_ge symmDiff_of_ge
theorem symmDiff_le {a b c : α} (ha : a ≤ b ⊔ c) (hb : b ≤ a ⊔ c) : a ∆ b ≤ c :=
sup_le (sdiff_le_iff.2 ha) <| sdiff_le_iff.2 hb
#align symm_diff_le symmDiff_le
theorem symmDiff_le_iff {a b c : α} : a ∆ b ≤ c ↔ a ≤ b ⊔ c ∧ b ≤ a ⊔ c := by
simp_rw [symmDiff, sup_le_iff, sdiff_le_iff]
#align symm_diff_le_iff symmDiff_le_iff
@[simp]
theorem symmDiff_le_sup {a b : α} : a ∆ b ≤ a ⊔ b :=
sup_le_sup sdiff_le sdiff_le
#align symm_diff_le_sup symmDiff_le_sup
| Mathlib/Order/SymmDiff.lean | 158 | 158 | theorem symmDiff_eq_sup_sdiff_inf : a ∆ b = (a ⊔ b) \ (a ⊓ b) := by | simp [sup_sdiff, symmDiff]
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section GeneralizedCoheytingAlgebra
variable [GeneralizedCoheytingAlgebra α] (a b c d : α)
@[simp]
theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b :=
rfl
#align to_dual_symm_diff toDual_symmDiff
@[simp]
theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b :=
rfl
#align of_dual_bihimp ofDual_bihimp
theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm]
#align symm_diff_comm symmDiff_comm
instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) :=
⟨symmDiff_comm⟩
#align symm_diff_is_comm symmDiff_isCommutative
@[simp]
theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self]
#align symm_diff_self symmDiff_self
@[simp]
theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq]
#align symm_diff_bot symmDiff_bot
@[simp]
theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot]
#align bot_symm_diff bot_symmDiff
@[simp]
theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by
simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff]
#align symm_diff_eq_bot symmDiff_eq_bot
theorem symmDiff_of_le {a b : α} (h : a ≤ b) : a ∆ b = b \ a := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, bot_sup_eq]
#align symm_diff_of_le symmDiff_of_le
theorem symmDiff_of_ge {a b : α} (h : b ≤ a) : a ∆ b = a \ b := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, sup_bot_eq]
#align symm_diff_of_ge symmDiff_of_ge
theorem symmDiff_le {a b c : α} (ha : a ≤ b ⊔ c) (hb : b ≤ a ⊔ c) : a ∆ b ≤ c :=
sup_le (sdiff_le_iff.2 ha) <| sdiff_le_iff.2 hb
#align symm_diff_le symmDiff_le
theorem symmDiff_le_iff {a b c : α} : a ∆ b ≤ c ↔ a ≤ b ⊔ c ∧ b ≤ a ⊔ c := by
simp_rw [symmDiff, sup_le_iff, sdiff_le_iff]
#align symm_diff_le_iff symmDiff_le_iff
@[simp]
theorem symmDiff_le_sup {a b : α} : a ∆ b ≤ a ⊔ b :=
sup_le_sup sdiff_le sdiff_le
#align symm_diff_le_sup symmDiff_le_sup
theorem symmDiff_eq_sup_sdiff_inf : a ∆ b = (a ⊔ b) \ (a ⊓ b) := by simp [sup_sdiff, symmDiff]
#align symm_diff_eq_sup_sdiff_inf symmDiff_eq_sup_sdiff_inf
| Mathlib/Order/SymmDiff.lean | 161 | 162 | theorem Disjoint.symmDiff_eq_sup {a b : α} (h : Disjoint a b) : a ∆ b = a ⊔ b := by |
rw [symmDiff, h.sdiff_eq_left, h.sdiff_eq_right]
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section GeneralizedCoheytingAlgebra
variable [GeneralizedCoheytingAlgebra α] (a b c d : α)
@[simp]
theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b :=
rfl
#align to_dual_symm_diff toDual_symmDiff
@[simp]
theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b :=
rfl
#align of_dual_bihimp ofDual_bihimp
theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm]
#align symm_diff_comm symmDiff_comm
instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) :=
⟨symmDiff_comm⟩
#align symm_diff_is_comm symmDiff_isCommutative
@[simp]
theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self]
#align symm_diff_self symmDiff_self
@[simp]
theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq]
#align symm_diff_bot symmDiff_bot
@[simp]
theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot]
#align bot_symm_diff bot_symmDiff
@[simp]
theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by
simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff]
#align symm_diff_eq_bot symmDiff_eq_bot
theorem symmDiff_of_le {a b : α} (h : a ≤ b) : a ∆ b = b \ a := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, bot_sup_eq]
#align symm_diff_of_le symmDiff_of_le
theorem symmDiff_of_ge {a b : α} (h : b ≤ a) : a ∆ b = a \ b := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, sup_bot_eq]
#align symm_diff_of_ge symmDiff_of_ge
theorem symmDiff_le {a b c : α} (ha : a ≤ b ⊔ c) (hb : b ≤ a ⊔ c) : a ∆ b ≤ c :=
sup_le (sdiff_le_iff.2 ha) <| sdiff_le_iff.2 hb
#align symm_diff_le symmDiff_le
theorem symmDiff_le_iff {a b c : α} : a ∆ b ≤ c ↔ a ≤ b ⊔ c ∧ b ≤ a ⊔ c := by
simp_rw [symmDiff, sup_le_iff, sdiff_le_iff]
#align symm_diff_le_iff symmDiff_le_iff
@[simp]
theorem symmDiff_le_sup {a b : α} : a ∆ b ≤ a ⊔ b :=
sup_le_sup sdiff_le sdiff_le
#align symm_diff_le_sup symmDiff_le_sup
theorem symmDiff_eq_sup_sdiff_inf : a ∆ b = (a ⊔ b) \ (a ⊓ b) := by simp [sup_sdiff, symmDiff]
#align symm_diff_eq_sup_sdiff_inf symmDiff_eq_sup_sdiff_inf
theorem Disjoint.symmDiff_eq_sup {a b : α} (h : Disjoint a b) : a ∆ b = a ⊔ b := by
rw [symmDiff, h.sdiff_eq_left, h.sdiff_eq_right]
#align disjoint.symm_diff_eq_sup Disjoint.symmDiff_eq_sup
| Mathlib/Order/SymmDiff.lean | 165 | 166 | theorem symmDiff_sdiff : a ∆ b \ c = a \ (b ⊔ c) ⊔ b \ (a ⊔ c) := by |
rw [symmDiff, sup_sdiff_distrib, sdiff_sdiff_left, sdiff_sdiff_left]
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section GeneralizedCoheytingAlgebra
variable [GeneralizedCoheytingAlgebra α] (a b c d : α)
@[simp]
theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b :=
rfl
#align to_dual_symm_diff toDual_symmDiff
@[simp]
theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b :=
rfl
#align of_dual_bihimp ofDual_bihimp
theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm]
#align symm_diff_comm symmDiff_comm
instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) :=
⟨symmDiff_comm⟩
#align symm_diff_is_comm symmDiff_isCommutative
@[simp]
theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self]
#align symm_diff_self symmDiff_self
@[simp]
theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq]
#align symm_diff_bot symmDiff_bot
@[simp]
theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot]
#align bot_symm_diff bot_symmDiff
@[simp]
theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by
simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff]
#align symm_diff_eq_bot symmDiff_eq_bot
theorem symmDiff_of_le {a b : α} (h : a ≤ b) : a ∆ b = b \ a := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, bot_sup_eq]
#align symm_diff_of_le symmDiff_of_le
theorem symmDiff_of_ge {a b : α} (h : b ≤ a) : a ∆ b = a \ b := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, sup_bot_eq]
#align symm_diff_of_ge symmDiff_of_ge
theorem symmDiff_le {a b c : α} (ha : a ≤ b ⊔ c) (hb : b ≤ a ⊔ c) : a ∆ b ≤ c :=
sup_le (sdiff_le_iff.2 ha) <| sdiff_le_iff.2 hb
#align symm_diff_le symmDiff_le
theorem symmDiff_le_iff {a b c : α} : a ∆ b ≤ c ↔ a ≤ b ⊔ c ∧ b ≤ a ⊔ c := by
simp_rw [symmDiff, sup_le_iff, sdiff_le_iff]
#align symm_diff_le_iff symmDiff_le_iff
@[simp]
theorem symmDiff_le_sup {a b : α} : a ∆ b ≤ a ⊔ b :=
sup_le_sup sdiff_le sdiff_le
#align symm_diff_le_sup symmDiff_le_sup
theorem symmDiff_eq_sup_sdiff_inf : a ∆ b = (a ⊔ b) \ (a ⊓ b) := by simp [sup_sdiff, symmDiff]
#align symm_diff_eq_sup_sdiff_inf symmDiff_eq_sup_sdiff_inf
theorem Disjoint.symmDiff_eq_sup {a b : α} (h : Disjoint a b) : a ∆ b = a ⊔ b := by
rw [symmDiff, h.sdiff_eq_left, h.sdiff_eq_right]
#align disjoint.symm_diff_eq_sup Disjoint.symmDiff_eq_sup
theorem symmDiff_sdiff : a ∆ b \ c = a \ (b ⊔ c) ⊔ b \ (a ⊔ c) := by
rw [symmDiff, sup_sdiff_distrib, sdiff_sdiff_left, sdiff_sdiff_left]
#align symm_diff_sdiff symmDiff_sdiff
@[simp]
| Mathlib/Order/SymmDiff.lean | 170 | 172 | theorem symmDiff_sdiff_inf : a ∆ b \ (a ⊓ b) = a ∆ b := by |
rw [symmDiff_sdiff]
simp [symmDiff]
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section GeneralizedCoheytingAlgebra
variable [GeneralizedCoheytingAlgebra α] (a b c d : α)
@[simp]
theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b :=
rfl
#align to_dual_symm_diff toDual_symmDiff
@[simp]
theorem ofDual_bihimp (a b : αᵒᵈ) : ofDual (a ⇔ b) = ofDual a ∆ ofDual b :=
rfl
#align of_dual_bihimp ofDual_bihimp
theorem symmDiff_comm : a ∆ b = b ∆ a := by simp only [symmDiff, sup_comm]
#align symm_diff_comm symmDiff_comm
instance symmDiff_isCommutative : Std.Commutative (α := α) (· ∆ ·) :=
⟨symmDiff_comm⟩
#align symm_diff_is_comm symmDiff_isCommutative
@[simp]
theorem symmDiff_self : a ∆ a = ⊥ := by rw [symmDiff, sup_idem, sdiff_self]
#align symm_diff_self symmDiff_self
@[simp]
theorem symmDiff_bot : a ∆ ⊥ = a := by rw [symmDiff, sdiff_bot, bot_sdiff, sup_bot_eq]
#align symm_diff_bot symmDiff_bot
@[simp]
theorem bot_symmDiff : ⊥ ∆ a = a := by rw [symmDiff_comm, symmDiff_bot]
#align bot_symm_diff bot_symmDiff
@[simp]
theorem symmDiff_eq_bot {a b : α} : a ∆ b = ⊥ ↔ a = b := by
simp_rw [symmDiff, sup_eq_bot_iff, sdiff_eq_bot_iff, le_antisymm_iff]
#align symm_diff_eq_bot symmDiff_eq_bot
theorem symmDiff_of_le {a b : α} (h : a ≤ b) : a ∆ b = b \ a := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, bot_sup_eq]
#align symm_diff_of_le symmDiff_of_le
theorem symmDiff_of_ge {a b : α} (h : b ≤ a) : a ∆ b = a \ b := by
rw [symmDiff, sdiff_eq_bot_iff.2 h, sup_bot_eq]
#align symm_diff_of_ge symmDiff_of_ge
theorem symmDiff_le {a b c : α} (ha : a ≤ b ⊔ c) (hb : b ≤ a ⊔ c) : a ∆ b ≤ c :=
sup_le (sdiff_le_iff.2 ha) <| sdiff_le_iff.2 hb
#align symm_diff_le symmDiff_le
theorem symmDiff_le_iff {a b c : α} : a ∆ b ≤ c ↔ a ≤ b ⊔ c ∧ b ≤ a ⊔ c := by
simp_rw [symmDiff, sup_le_iff, sdiff_le_iff]
#align symm_diff_le_iff symmDiff_le_iff
@[simp]
theorem symmDiff_le_sup {a b : α} : a ∆ b ≤ a ⊔ b :=
sup_le_sup sdiff_le sdiff_le
#align symm_diff_le_sup symmDiff_le_sup
theorem symmDiff_eq_sup_sdiff_inf : a ∆ b = (a ⊔ b) \ (a ⊓ b) := by simp [sup_sdiff, symmDiff]
#align symm_diff_eq_sup_sdiff_inf symmDiff_eq_sup_sdiff_inf
theorem Disjoint.symmDiff_eq_sup {a b : α} (h : Disjoint a b) : a ∆ b = a ⊔ b := by
rw [symmDiff, h.sdiff_eq_left, h.sdiff_eq_right]
#align disjoint.symm_diff_eq_sup Disjoint.symmDiff_eq_sup
theorem symmDiff_sdiff : a ∆ b \ c = a \ (b ⊔ c) ⊔ b \ (a ⊔ c) := by
rw [symmDiff, sup_sdiff_distrib, sdiff_sdiff_left, sdiff_sdiff_left]
#align symm_diff_sdiff symmDiff_sdiff
@[simp]
theorem symmDiff_sdiff_inf : a ∆ b \ (a ⊓ b) = a ∆ b := by
rw [symmDiff_sdiff]
simp [symmDiff]
#align symm_diff_sdiff_inf symmDiff_sdiff_inf
@[simp]
| Mathlib/Order/SymmDiff.lean | 176 | 180 | theorem symmDiff_sdiff_eq_sup : a ∆ (b \ a) = a ⊔ b := by |
rw [symmDiff, sdiff_idem]
exact
le_antisymm (sup_le_sup sdiff_le sdiff_le)
(sup_le le_sdiff_sup <| le_sdiff_sup.trans <| sup_le le_sup_right le_sdiff_sup)
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section GeneralizedHeytingAlgebra
variable [GeneralizedHeytingAlgebra α] (a b c d : α)
@[simp]
theorem toDual_bihimp : toDual (a ⇔ b) = toDual a ∆ toDual b :=
rfl
#align to_dual_bihimp toDual_bihimp
@[simp]
theorem ofDual_symmDiff (a b : αᵒᵈ) : ofDual (a ∆ b) = ofDual a ⇔ ofDual b :=
rfl
#align of_dual_symm_diff ofDual_symmDiff
theorem bihimp_comm : a ⇔ b = b ⇔ a := by simp only [(· ⇔ ·), inf_comm]
#align bihimp_comm bihimp_comm
instance bihimp_isCommutative : Std.Commutative (α := α) (· ⇔ ·) :=
⟨bihimp_comm⟩
#align bihimp_is_comm bihimp_isCommutative
@[simp]
| Mathlib/Order/SymmDiff.lean | 248 | 248 | theorem bihimp_self : a ⇔ a = ⊤ := by | rw [bihimp, inf_idem, himp_self]
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section GeneralizedHeytingAlgebra
variable [GeneralizedHeytingAlgebra α] (a b c d : α)
@[simp]
theorem toDual_bihimp : toDual (a ⇔ b) = toDual a ∆ toDual b :=
rfl
#align to_dual_bihimp toDual_bihimp
@[simp]
theorem ofDual_symmDiff (a b : αᵒᵈ) : ofDual (a ∆ b) = ofDual a ⇔ ofDual b :=
rfl
#align of_dual_symm_diff ofDual_symmDiff
theorem bihimp_comm : a ⇔ b = b ⇔ a := by simp only [(· ⇔ ·), inf_comm]
#align bihimp_comm bihimp_comm
instance bihimp_isCommutative : Std.Commutative (α := α) (· ⇔ ·) :=
⟨bihimp_comm⟩
#align bihimp_is_comm bihimp_isCommutative
@[simp]
theorem bihimp_self : a ⇔ a = ⊤ := by rw [bihimp, inf_idem, himp_self]
#align bihimp_self bihimp_self
@[simp]
| Mathlib/Order/SymmDiff.lean | 252 | 252 | theorem bihimp_top : a ⇔ ⊤ = a := by | rw [bihimp, himp_top, top_himp, inf_top_eq]
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section GeneralizedHeytingAlgebra
variable [GeneralizedHeytingAlgebra α] (a b c d : α)
@[simp]
theorem toDual_bihimp : toDual (a ⇔ b) = toDual a ∆ toDual b :=
rfl
#align to_dual_bihimp toDual_bihimp
@[simp]
theorem ofDual_symmDiff (a b : αᵒᵈ) : ofDual (a ∆ b) = ofDual a ⇔ ofDual b :=
rfl
#align of_dual_symm_diff ofDual_symmDiff
theorem bihimp_comm : a ⇔ b = b ⇔ a := by simp only [(· ⇔ ·), inf_comm]
#align bihimp_comm bihimp_comm
instance bihimp_isCommutative : Std.Commutative (α := α) (· ⇔ ·) :=
⟨bihimp_comm⟩
#align bihimp_is_comm bihimp_isCommutative
@[simp]
theorem bihimp_self : a ⇔ a = ⊤ := by rw [bihimp, inf_idem, himp_self]
#align bihimp_self bihimp_self
@[simp]
theorem bihimp_top : a ⇔ ⊤ = a := by rw [bihimp, himp_top, top_himp, inf_top_eq]
#align bihimp_top bihimp_top
@[simp]
| Mathlib/Order/SymmDiff.lean | 256 | 256 | theorem top_bihimp : ⊤ ⇔ a = a := by | rw [bihimp_comm, bihimp_top]
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section CoheytingAlgebra
variable [CoheytingAlgebra α] (a : α)
@[simp]
| Mathlib/Order/SymmDiff.lean | 343 | 343 | theorem symmDiff_top' : a ∆ ⊤ = ¬a := by | simp [symmDiff]
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section CoheytingAlgebra
variable [CoheytingAlgebra α] (a : α)
@[simp]
theorem symmDiff_top' : a ∆ ⊤ = ¬a := by simp [symmDiff]
#align symm_diff_top' symmDiff_top'
@[simp]
| Mathlib/Order/SymmDiff.lean | 347 | 347 | theorem top_symmDiff' : ⊤ ∆ a = ¬a := by | simp [symmDiff]
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section CoheytingAlgebra
variable [CoheytingAlgebra α] (a : α)
@[simp]
theorem symmDiff_top' : a ∆ ⊤ = ¬a := by simp [symmDiff]
#align symm_diff_top' symmDiff_top'
@[simp]
theorem top_symmDiff' : ⊤ ∆ a = ¬a := by simp [symmDiff]
#align top_symm_diff' top_symmDiff'
@[simp]
| Mathlib/Order/SymmDiff.lean | 351 | 353 | theorem hnot_symmDiff_self : (¬a) ∆ a = ⊤ := by |
rw [eq_top_iff, symmDiff, hnot_sdiff, sup_sdiff_self]
exact Codisjoint.top_le codisjoint_hnot_left
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section HeytingAlgebra
variable [HeytingAlgebra α] (a : α)
@[simp]
| Mathlib/Order/SymmDiff.lean | 371 | 371 | theorem bihimp_bot : a ⇔ ⊥ = aᶜ := by | simp [bihimp]
| 395 |
import Mathlib.Order.BooleanAlgebra
import Mathlib.Logic.Equiv.Basic
#align_import order.symm_diff from "leanprover-community/mathlib"@"6eb334bd8f3433d5b08ba156b8ec3e6af47e1904"
open Function OrderDual
variable {ι α β : Type*} {π : ι → Type*}
def symmDiff [Sup α] [SDiff α] (a b : α) : α :=
a \ b ⊔ b \ a
#align symm_diff symmDiff
def bihimp [Inf α] [HImp α] (a b : α) : α :=
(b ⇨ a) ⊓ (a ⇨ b)
#align bihimp bihimp
scoped[symmDiff] infixl:100 " ∆ " => symmDiff
scoped[symmDiff] infixl:100 " ⇔ " => bihimp
open scoped symmDiff
theorem symmDiff_def [Sup α] [SDiff α] (a b : α) : a ∆ b = a \ b ⊔ b \ a :=
rfl
#align symm_diff_def symmDiff_def
theorem bihimp_def [Inf α] [HImp α] (a b : α) : a ⇔ b = (b ⇨ a) ⊓ (a ⇨ b) :=
rfl
#align bihimp_def bihimp_def
theorem symmDiff_eq_Xor' (p q : Prop) : p ∆ q = Xor' p q :=
rfl
#align symm_diff_eq_xor symmDiff_eq_Xor'
@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q) :=
(iff_iff_implies_and_implies _ _).symm.trans Iff.comm
#align bihimp_iff_iff bihimp_iff_iff
@[simp]
theorem Bool.symmDiff_eq_xor : ∀ p q : Bool, p ∆ q = xor p q := by decide
#align bool.symm_diff_eq_bxor Bool.symmDiff_eq_xor
section HeytingAlgebra
variable [HeytingAlgebra α] (a : α)
@[simp]
theorem bihimp_bot : a ⇔ ⊥ = aᶜ := by simp [bihimp]
#align bihimp_bot bihimp_bot
@[simp]
| Mathlib/Order/SymmDiff.lean | 375 | 375 | theorem bot_bihimp : ⊥ ⇔ a = aᶜ := by | simp [bihimp]
| 395 |
import Mathlib.Data.Set.Pointwise.SMul
import Mathlib.GroupTheory.GroupAction.Pi
#align_import algebra.module.pointwise_pi from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
open Pointwise
open Set
variable {K ι : Type*} {R : ι → Type*}
@[to_additive]
| Mathlib/Algebra/Module/PointwisePi.lean | 29 | 32 | theorem smul_pi_subset [∀ i, SMul K (R i)] (r : K) (s : Set ι) (t : ∀ i, Set (R i)) :
r • pi s t ⊆ pi s (r • t) := by |
rintro x ⟨y, h, rfl⟩ i hi
exact smul_mem_smul_set (h i hi)
| 396 |
import Mathlib.Algebra.ContinuedFractions.ContinuantsRecurrence
import Mathlib.Algebra.ContinuedFractions.TerminatedStable
import Mathlib.Tactic.FieldSimp
import Mathlib.Tactic.Ring
#align_import algebra.continued_fractions.convergents_equiv from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad"
variable {K : Type*} {n : ℕ}
namespace GeneralizedContinuedFraction
variable {g : GeneralizedContinuedFraction K} {s : Stream'.Seq <| Pair K}
section Squash
section WithDivisionRing
variable [DivisionRing K]
def squashSeq (s : Stream'.Seq <| Pair K) (n : ℕ) : Stream'.Seq (Pair K) :=
match Prod.mk (s.get? n) (s.get? (n + 1)) with
| ⟨some gp_n, some gp_succ_n⟩ =>
Stream'.Seq.nats.zipWith
-- return the squashed value at position `n`; otherwise, do nothing.
(fun n' gp => if n' = n then ⟨gp_n.a, gp_n.b + gp_succ_n.a / gp_succ_n.b⟩ else gp) s
| _ => s
#align generalized_continued_fraction.squash_seq GeneralizedContinuedFraction.squashSeq
| Mathlib/Algebra/ContinuedFractions/ConvergentsEquiv.lean | 106 | 109 | theorem squashSeq_eq_self_of_terminated (terminated_at_succ_n : s.TerminatedAt (n + 1)) :
squashSeq s n = s := by |
change s.get? (n + 1) = none at terminated_at_succ_n
cases s_nth_eq : s.get? n <;> simp only [*, squashSeq]
| 397 |
import Mathlib.Algebra.ContinuedFractions.ContinuantsRecurrence
import Mathlib.Algebra.ContinuedFractions.TerminatedStable
import Mathlib.Tactic.FieldSimp
import Mathlib.Tactic.Ring
#align_import algebra.continued_fractions.convergents_equiv from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad"
variable {K : Type*} {n : ℕ}
namespace GeneralizedContinuedFraction
variable {g : GeneralizedContinuedFraction K} {s : Stream'.Seq <| Pair K}
section Squash
section WithDivisionRing
variable [DivisionRing K]
def squashSeq (s : Stream'.Seq <| Pair K) (n : ℕ) : Stream'.Seq (Pair K) :=
match Prod.mk (s.get? n) (s.get? (n + 1)) with
| ⟨some gp_n, some gp_succ_n⟩ =>
Stream'.Seq.nats.zipWith
-- return the squashed value at position `n`; otherwise, do nothing.
(fun n' gp => if n' = n then ⟨gp_n.a, gp_n.b + gp_succ_n.a / gp_succ_n.b⟩ else gp) s
| _ => s
#align generalized_continued_fraction.squash_seq GeneralizedContinuedFraction.squashSeq
theorem squashSeq_eq_self_of_terminated (terminated_at_succ_n : s.TerminatedAt (n + 1)) :
squashSeq s n = s := by
change s.get? (n + 1) = none at terminated_at_succ_n
cases s_nth_eq : s.get? n <;> simp only [*, squashSeq]
#align generalized_continued_fraction.squash_seq_eq_self_of_terminated GeneralizedContinuedFraction.squashSeq_eq_self_of_terminated
| Mathlib/Algebra/ContinuedFractions/ConvergentsEquiv.lean | 114 | 117 | theorem squashSeq_nth_of_not_terminated {gp_n gp_succ_n : Pair K} (s_nth_eq : s.get? n = some gp_n)
(s_succ_nth_eq : s.get? (n + 1) = some gp_succ_n) :
(squashSeq s n).get? n = some ⟨gp_n.a, gp_n.b + gp_succ_n.a / gp_succ_n.b⟩ := by |
simp [*, squashSeq]
| 397 |
import Mathlib.Algebra.ContinuedFractions.ContinuantsRecurrence
import Mathlib.Algebra.ContinuedFractions.TerminatedStable
import Mathlib.Tactic.FieldSimp
import Mathlib.Tactic.Ring
#align_import algebra.continued_fractions.convergents_equiv from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad"
variable {K : Type*} {n : ℕ}
namespace GeneralizedContinuedFraction
variable {g : GeneralizedContinuedFraction K} {s : Stream'.Seq <| Pair K}
section Squash
section WithDivisionRing
variable [DivisionRing K]
def squashSeq (s : Stream'.Seq <| Pair K) (n : ℕ) : Stream'.Seq (Pair K) :=
match Prod.mk (s.get? n) (s.get? (n + 1)) with
| ⟨some gp_n, some gp_succ_n⟩ =>
Stream'.Seq.nats.zipWith
-- return the squashed value at position `n`; otherwise, do nothing.
(fun n' gp => if n' = n then ⟨gp_n.a, gp_n.b + gp_succ_n.a / gp_succ_n.b⟩ else gp) s
| _ => s
#align generalized_continued_fraction.squash_seq GeneralizedContinuedFraction.squashSeq
theorem squashSeq_eq_self_of_terminated (terminated_at_succ_n : s.TerminatedAt (n + 1)) :
squashSeq s n = s := by
change s.get? (n + 1) = none at terminated_at_succ_n
cases s_nth_eq : s.get? n <;> simp only [*, squashSeq]
#align generalized_continued_fraction.squash_seq_eq_self_of_terminated GeneralizedContinuedFraction.squashSeq_eq_self_of_terminated
theorem squashSeq_nth_of_not_terminated {gp_n gp_succ_n : Pair K} (s_nth_eq : s.get? n = some gp_n)
(s_succ_nth_eq : s.get? (n + 1) = some gp_succ_n) :
(squashSeq s n).get? n = some ⟨gp_n.a, gp_n.b + gp_succ_n.a / gp_succ_n.b⟩ := by
simp [*, squashSeq]
#align generalized_continued_fraction.squash_seq_nth_of_not_terminated GeneralizedContinuedFraction.squashSeq_nth_of_not_terminated
| Mathlib/Algebra/ContinuedFractions/ConvergentsEquiv.lean | 121 | 129 | theorem squashSeq_nth_of_lt {m : ℕ} (m_lt_n : m < n) : (squashSeq s n).get? m = s.get? m := by |
cases s_succ_nth_eq : s.get? (n + 1) with
| none => rw [squashSeq_eq_self_of_terminated s_succ_nth_eq]
| some =>
obtain ⟨gp_n, s_nth_eq⟩ : ∃ gp_n, s.get? n = some gp_n :=
s.ge_stable n.le_succ s_succ_nth_eq
obtain ⟨gp_m, s_mth_eq⟩ : ∃ gp_m, s.get? m = some gp_m :=
s.ge_stable (le_of_lt m_lt_n) s_nth_eq
simp [*, squashSeq, m_lt_n.ne]
| 397 |
import Mathlib.Algebra.ContinuedFractions.ContinuantsRecurrence
import Mathlib.Algebra.ContinuedFractions.TerminatedStable
import Mathlib.Tactic.FieldSimp
import Mathlib.Tactic.Ring
#align_import algebra.continued_fractions.convergents_equiv from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad"
variable {K : Type*} {n : ℕ}
namespace GeneralizedContinuedFraction
variable {g : GeneralizedContinuedFraction K} {s : Stream'.Seq <| Pair K}
section Squash
section WithDivisionRing
variable [DivisionRing K]
def squashSeq (s : Stream'.Seq <| Pair K) (n : ℕ) : Stream'.Seq (Pair K) :=
match Prod.mk (s.get? n) (s.get? (n + 1)) with
| ⟨some gp_n, some gp_succ_n⟩ =>
Stream'.Seq.nats.zipWith
-- return the squashed value at position `n`; otherwise, do nothing.
(fun n' gp => if n' = n then ⟨gp_n.a, gp_n.b + gp_succ_n.a / gp_succ_n.b⟩ else gp) s
| _ => s
#align generalized_continued_fraction.squash_seq GeneralizedContinuedFraction.squashSeq
theorem squashSeq_eq_self_of_terminated (terminated_at_succ_n : s.TerminatedAt (n + 1)) :
squashSeq s n = s := by
change s.get? (n + 1) = none at terminated_at_succ_n
cases s_nth_eq : s.get? n <;> simp only [*, squashSeq]
#align generalized_continued_fraction.squash_seq_eq_self_of_terminated GeneralizedContinuedFraction.squashSeq_eq_self_of_terminated
theorem squashSeq_nth_of_not_terminated {gp_n gp_succ_n : Pair K} (s_nth_eq : s.get? n = some gp_n)
(s_succ_nth_eq : s.get? (n + 1) = some gp_succ_n) :
(squashSeq s n).get? n = some ⟨gp_n.a, gp_n.b + gp_succ_n.a / gp_succ_n.b⟩ := by
simp [*, squashSeq]
#align generalized_continued_fraction.squash_seq_nth_of_not_terminated GeneralizedContinuedFraction.squashSeq_nth_of_not_terminated
theorem squashSeq_nth_of_lt {m : ℕ} (m_lt_n : m < n) : (squashSeq s n).get? m = s.get? m := by
cases s_succ_nth_eq : s.get? (n + 1) with
| none => rw [squashSeq_eq_self_of_terminated s_succ_nth_eq]
| some =>
obtain ⟨gp_n, s_nth_eq⟩ : ∃ gp_n, s.get? n = some gp_n :=
s.ge_stable n.le_succ s_succ_nth_eq
obtain ⟨gp_m, s_mth_eq⟩ : ∃ gp_m, s.get? m = some gp_m :=
s.ge_stable (le_of_lt m_lt_n) s_nth_eq
simp [*, squashSeq, m_lt_n.ne]
#align generalized_continued_fraction.squash_seq_nth_of_lt GeneralizedContinuedFraction.squashSeq_nth_of_lt
| Mathlib/Algebra/ContinuedFractions/ConvergentsEquiv.lean | 134 | 150 | theorem squashSeq_succ_n_tail_eq_squashSeq_tail_n :
(squashSeq s (n + 1)).tail = squashSeq s.tail n := by |
cases s_succ_succ_nth_eq : s.get? (n + 2) with
| none =>
cases s_succ_nth_eq : s.get? (n + 1) <;>
simp only [squashSeq, Stream'.Seq.get?_tail, s_succ_nth_eq, s_succ_succ_nth_eq]
| some gp_succ_succ_n =>
obtain ⟨gp_succ_n, s_succ_nth_eq⟩ : ∃ gp_succ_n, s.get? (n + 1) = some gp_succ_n :=
s.ge_stable (n + 1).le_succ s_succ_succ_nth_eq
-- apply extensionality with `m` and continue by cases `m = n`.
ext1 m
cases' Decidable.em (m = n) with m_eq_n m_ne_n
· simp [*, squashSeq]
· cases s_succ_mth_eq : s.get? (m + 1)
· simp only [*, squashSeq, Stream'.Seq.get?_tail, Stream'.Seq.get?_zipWith,
Option.map₂_none_right]
· simp [*, squashSeq]
| 397 |
import Mathlib.Algebra.ContinuedFractions.ContinuantsRecurrence
import Mathlib.Algebra.ContinuedFractions.TerminatedStable
import Mathlib.Tactic.FieldSimp
import Mathlib.Tactic.Ring
#align_import algebra.continued_fractions.convergents_equiv from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad"
variable {K : Type*} {n : ℕ}
namespace GeneralizedContinuedFraction
variable {g : GeneralizedContinuedFraction K} {s : Stream'.Seq <| Pair K}
section Squash
section WithDivisionRing
variable [DivisionRing K]
def squashSeq (s : Stream'.Seq <| Pair K) (n : ℕ) : Stream'.Seq (Pair K) :=
match Prod.mk (s.get? n) (s.get? (n + 1)) with
| ⟨some gp_n, some gp_succ_n⟩ =>
Stream'.Seq.nats.zipWith
-- return the squashed value at position `n`; otherwise, do nothing.
(fun n' gp => if n' = n then ⟨gp_n.a, gp_n.b + gp_succ_n.a / gp_succ_n.b⟩ else gp) s
| _ => s
#align generalized_continued_fraction.squash_seq GeneralizedContinuedFraction.squashSeq
theorem squashSeq_eq_self_of_terminated (terminated_at_succ_n : s.TerminatedAt (n + 1)) :
squashSeq s n = s := by
change s.get? (n + 1) = none at terminated_at_succ_n
cases s_nth_eq : s.get? n <;> simp only [*, squashSeq]
#align generalized_continued_fraction.squash_seq_eq_self_of_terminated GeneralizedContinuedFraction.squashSeq_eq_self_of_terminated
theorem squashSeq_nth_of_not_terminated {gp_n gp_succ_n : Pair K} (s_nth_eq : s.get? n = some gp_n)
(s_succ_nth_eq : s.get? (n + 1) = some gp_succ_n) :
(squashSeq s n).get? n = some ⟨gp_n.a, gp_n.b + gp_succ_n.a / gp_succ_n.b⟩ := by
simp [*, squashSeq]
#align generalized_continued_fraction.squash_seq_nth_of_not_terminated GeneralizedContinuedFraction.squashSeq_nth_of_not_terminated
theorem squashSeq_nth_of_lt {m : ℕ} (m_lt_n : m < n) : (squashSeq s n).get? m = s.get? m := by
cases s_succ_nth_eq : s.get? (n + 1) with
| none => rw [squashSeq_eq_self_of_terminated s_succ_nth_eq]
| some =>
obtain ⟨gp_n, s_nth_eq⟩ : ∃ gp_n, s.get? n = some gp_n :=
s.ge_stable n.le_succ s_succ_nth_eq
obtain ⟨gp_m, s_mth_eq⟩ : ∃ gp_m, s.get? m = some gp_m :=
s.ge_stable (le_of_lt m_lt_n) s_nth_eq
simp [*, squashSeq, m_lt_n.ne]
#align generalized_continued_fraction.squash_seq_nth_of_lt GeneralizedContinuedFraction.squashSeq_nth_of_lt
theorem squashSeq_succ_n_tail_eq_squashSeq_tail_n :
(squashSeq s (n + 1)).tail = squashSeq s.tail n := by
cases s_succ_succ_nth_eq : s.get? (n + 2) with
| none =>
cases s_succ_nth_eq : s.get? (n + 1) <;>
simp only [squashSeq, Stream'.Seq.get?_tail, s_succ_nth_eq, s_succ_succ_nth_eq]
| some gp_succ_succ_n =>
obtain ⟨gp_succ_n, s_succ_nth_eq⟩ : ∃ gp_succ_n, s.get? (n + 1) = some gp_succ_n :=
s.ge_stable (n + 1).le_succ s_succ_succ_nth_eq
-- apply extensionality with `m` and continue by cases `m = n`.
ext1 m
cases' Decidable.em (m = n) with m_eq_n m_ne_n
· simp [*, squashSeq]
· cases s_succ_mth_eq : s.get? (m + 1)
· simp only [*, squashSeq, Stream'.Seq.get?_tail, Stream'.Seq.get?_zipWith,
Option.map₂_none_right]
· simp [*, squashSeq]
#align generalized_continued_fraction.squash_seq_succ_n_tail_eq_squash_seq_tail_n GeneralizedContinuedFraction.squashSeq_succ_n_tail_eq_squashSeq_tail_n
| Mathlib/Algebra/ContinuedFractions/ConvergentsEquiv.lean | 155 | 181 | theorem succ_succ_nth_convergent'_aux_eq_succ_nth_convergent'_aux_squashSeq :
convergents'Aux s (n + 2) = convergents'Aux (squashSeq s n) (n + 1) := by |
cases s_succ_nth_eq : s.get? <| n + 1 with
| none =>
rw [squashSeq_eq_self_of_terminated s_succ_nth_eq,
convergents'Aux_stable_step_of_terminated s_succ_nth_eq]
| some gp_succ_n =>
induction n generalizing s gp_succ_n with
| zero =>
obtain ⟨gp_head, s_head_eq⟩ : ∃ gp_head, s.head = some gp_head :=
s.ge_stable zero_le_one s_succ_nth_eq
have : (squashSeq s 0).head = some ⟨gp_head.a, gp_head.b + gp_succ_n.a / gp_succ_n.b⟩ :=
squashSeq_nth_of_not_terminated s_head_eq s_succ_nth_eq
simp_all [convergents'Aux, Stream'.Seq.head, Stream'.Seq.get?_tail]
| succ m IH =>
obtain ⟨gp_head, s_head_eq⟩ : ∃ gp_head, s.head = some gp_head :=
s.ge_stable (m + 2).zero_le s_succ_nth_eq
suffices
gp_head.a / (gp_head.b + convergents'Aux s.tail (m + 2)) =
convergents'Aux (squashSeq s (m + 1)) (m + 2)
by simpa only [convergents'Aux, s_head_eq]
have : convergents'Aux s.tail (m + 2) = convergents'Aux (squashSeq s.tail m) (m + 1) := by
refine IH gp_succ_n ?_
simpa [Stream'.Seq.get?_tail] using s_succ_nth_eq
have : (squashSeq s (m + 1)).head = some gp_head :=
(squashSeq_nth_of_lt m.succ_pos).trans s_head_eq
simp_all [convergents'Aux, squashSeq_succ_n_tail_eq_squashSeq_tail_n]
| 397 |
import Mathlib.Algebra.CharP.Defs
#align_import algebra.char_p.invertible from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
variable {K : Type*}
section Field
variable [Field K]
def invertibleOfRingCharNotDvd {t : ℕ} (not_dvd : ¬ringChar K ∣ t) : Invertible (t : K) :=
invertibleOfNonzero fun h => not_dvd ((ringChar.spec K t).mp h)
#align invertible_of_ring_char_not_dvd invertibleOfRingCharNotDvd
| Mathlib/Algebra/CharP/Invertible.lean | 32 | 34 | theorem not_ringChar_dvd_of_invertible {t : ℕ} [Invertible (t : K)] : ¬ringChar K ∣ t := by |
rw [← ringChar.spec, ← Ne]
exact nonzero_of_invertible (t : K)
| 398 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_eval₂_hom
variable (p : ℕ)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : ℕ) : MvPolynomial ℕ R :=
∑ i ∈ range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 81 | 86 | theorem wittPolynomial_eq_sum_C_mul_X_pow (n : ℕ) :
wittPolynomial p R n = ∑ i ∈ range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by |
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
| 399 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_eval₂_hom
variable (p : ℕ)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : ℕ) : MvPolynomial ℕ R :=
∑ i ∈ range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : ℕ) :
wittPolynomial p R n = ∑ i ∈ range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 116 | 119 | theorem map_wittPolynomial (f : R →+* S) (n : ℕ) : map f (W n) = W n := by |
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
| 399 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_eval₂_hom
variable (p : ℕ)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : ℕ) : MvPolynomial ℕ R :=
∑ i ∈ range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : ℕ) :
wittPolynomial p R n = ∑ i ∈ range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
theorem map_wittPolynomial (f : R →+* S) (n : ℕ) : map f (W n) = W n := by
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
#align map_witt_polynomial map_wittPolynomial
variable (R)
@[simp]
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 125 | 132 | theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : ℕ) :
constantCoeff (wittPolynomial p R n) = 0 := by |
simp only [wittPolynomial, map_sum, constantCoeff_monomial]
rw [sum_eq_zero]
rintro i _
rw [if_neg]
rw [Finsupp.single_eq_zero]
exact ne_of_gt (pow_pos hp.1.pos _)
| 399 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_eval₂_hom
variable (p : ℕ)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : ℕ) : MvPolynomial ℕ R :=
∑ i ∈ range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : ℕ) :
wittPolynomial p R n = ∑ i ∈ range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
theorem map_wittPolynomial (f : R →+* S) (n : ℕ) : map f (W n) = W n := by
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
#align map_witt_polynomial map_wittPolynomial
variable (R)
@[simp]
theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : ℕ) :
constantCoeff (wittPolynomial p R n) = 0 := by
simp only [wittPolynomial, map_sum, constantCoeff_monomial]
rw [sum_eq_zero]
rintro i _
rw [if_neg]
rw [Finsupp.single_eq_zero]
exact ne_of_gt (pow_pos hp.1.pos _)
#align constant_coeff_witt_polynomial constantCoeff_wittPolynomial
@[simp]
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 136 | 137 | theorem wittPolynomial_zero : wittPolynomial p R 0 = X 0 := by |
simp only [wittPolynomial, X, sum_singleton, range_one, pow_zero, zero_add, tsub_self]
| 399 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_eval₂_hom
variable (p : ℕ)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : ℕ) : MvPolynomial ℕ R :=
∑ i ∈ range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : ℕ) :
wittPolynomial p R n = ∑ i ∈ range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
theorem map_wittPolynomial (f : R →+* S) (n : ℕ) : map f (W n) = W n := by
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
#align map_witt_polynomial map_wittPolynomial
variable (R)
@[simp]
theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : ℕ) :
constantCoeff (wittPolynomial p R n) = 0 := by
simp only [wittPolynomial, map_sum, constantCoeff_monomial]
rw [sum_eq_zero]
rintro i _
rw [if_neg]
rw [Finsupp.single_eq_zero]
exact ne_of_gt (pow_pos hp.1.pos _)
#align constant_coeff_witt_polynomial constantCoeff_wittPolynomial
@[simp]
theorem wittPolynomial_zero : wittPolynomial p R 0 = X 0 := by
simp only [wittPolynomial, X, sum_singleton, range_one, pow_zero, zero_add, tsub_self]
#align witt_polynomial_zero wittPolynomial_zero
@[simp]
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 141 | 143 | theorem wittPolynomial_one : wittPolynomial p R 1 = C (p : R) * X 1 + X 0 ^ p := by |
simp only [wittPolynomial_eq_sum_C_mul_X_pow, sum_range_succ_comm, range_one, sum_singleton,
one_mul, pow_one, C_1, pow_zero, tsub_self, tsub_zero]
| 399 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_eval₂_hom
variable (p : ℕ)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : ℕ) : MvPolynomial ℕ R :=
∑ i ∈ range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : ℕ) :
wittPolynomial p R n = ∑ i ∈ range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
theorem map_wittPolynomial (f : R →+* S) (n : ℕ) : map f (W n) = W n := by
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
#align map_witt_polynomial map_wittPolynomial
variable (R)
@[simp]
theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : ℕ) :
constantCoeff (wittPolynomial p R n) = 0 := by
simp only [wittPolynomial, map_sum, constantCoeff_monomial]
rw [sum_eq_zero]
rintro i _
rw [if_neg]
rw [Finsupp.single_eq_zero]
exact ne_of_gt (pow_pos hp.1.pos _)
#align constant_coeff_witt_polynomial constantCoeff_wittPolynomial
@[simp]
theorem wittPolynomial_zero : wittPolynomial p R 0 = X 0 := by
simp only [wittPolynomial, X, sum_singleton, range_one, pow_zero, zero_add, tsub_self]
#align witt_polynomial_zero wittPolynomial_zero
@[simp]
theorem wittPolynomial_one : wittPolynomial p R 1 = C (p : R) * X 1 + X 0 ^ p := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow, sum_range_succ_comm, range_one, sum_singleton,
one_mul, pow_one, C_1, pow_zero, tsub_self, tsub_zero]
#align witt_polynomial_one wittPolynomial_one
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 146 | 148 | theorem aeval_wittPolynomial {A : Type*} [CommRing A] [Algebra R A] (f : ℕ → A) (n : ℕ) :
aeval f (W_ R n) = ∑ i ∈ range (n + 1), (p : A) ^ i * f i ^ p ^ (n - i) := by |
simp [wittPolynomial, AlgHom.map_sum, aeval_monomial, Finsupp.prod_single_index]
| 399 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_eval₂_hom
variable (p : ℕ)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : ℕ) : MvPolynomial ℕ R :=
∑ i ∈ range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : ℕ) :
wittPolynomial p R n = ∑ i ∈ range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
theorem map_wittPolynomial (f : R →+* S) (n : ℕ) : map f (W n) = W n := by
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
#align map_witt_polynomial map_wittPolynomial
variable (R)
@[simp]
theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : ℕ) :
constantCoeff (wittPolynomial p R n) = 0 := by
simp only [wittPolynomial, map_sum, constantCoeff_monomial]
rw [sum_eq_zero]
rintro i _
rw [if_neg]
rw [Finsupp.single_eq_zero]
exact ne_of_gt (pow_pos hp.1.pos _)
#align constant_coeff_witt_polynomial constantCoeff_wittPolynomial
@[simp]
theorem wittPolynomial_zero : wittPolynomial p R 0 = X 0 := by
simp only [wittPolynomial, X, sum_singleton, range_one, pow_zero, zero_add, tsub_self]
#align witt_polynomial_zero wittPolynomial_zero
@[simp]
theorem wittPolynomial_one : wittPolynomial p R 1 = C (p : R) * X 1 + X 0 ^ p := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow, sum_range_succ_comm, range_one, sum_singleton,
one_mul, pow_one, C_1, pow_zero, tsub_self, tsub_zero]
#align witt_polynomial_one wittPolynomial_one
theorem aeval_wittPolynomial {A : Type*} [CommRing A] [Algebra R A] (f : ℕ → A) (n : ℕ) :
aeval f (W_ R n) = ∑ i ∈ range (n + 1), (p : A) ^ i * f i ^ p ^ (n - i) := by
simp [wittPolynomial, AlgHom.map_sum, aeval_monomial, Finsupp.prod_single_index]
#align aeval_witt_polynomial aeval_wittPolynomial
@[simp]
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 154 | 163 | theorem wittPolynomial_zmod_self (n : ℕ) :
W_ (ZMod (p ^ (n + 1))) (n + 1) = expand p (W_ (ZMod (p ^ (n + 1))) n) := by |
simp only [wittPolynomial_eq_sum_C_mul_X_pow]
rw [sum_range_succ, ← Nat.cast_pow, CharP.cast_eq_zero (ZMod (p ^ (n + 1))) (p ^ (n + 1)), C_0,
zero_mul, add_zero, AlgHom.map_sum, sum_congr rfl]
intro k hk
rw [AlgHom.map_mul, AlgHom.map_pow, expand_X, algHom_C, ← pow_mul, ← pow_succ']
congr
rw [mem_range] at hk
rw [add_comm, add_tsub_assoc_of_le (Nat.lt_succ_iff.mp hk), ← add_comm]
| 399 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_eval₂_hom
variable (p : ℕ)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : ℕ) : MvPolynomial ℕ R :=
∑ i ∈ range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : ℕ) :
wittPolynomial p R n = ∑ i ∈ range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
theorem map_wittPolynomial (f : R →+* S) (n : ℕ) : map f (W n) = W n := by
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
#align map_witt_polynomial map_wittPolynomial
variable (R)
@[simp]
theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : ℕ) :
constantCoeff (wittPolynomial p R n) = 0 := by
simp only [wittPolynomial, map_sum, constantCoeff_monomial]
rw [sum_eq_zero]
rintro i _
rw [if_neg]
rw [Finsupp.single_eq_zero]
exact ne_of_gt (pow_pos hp.1.pos _)
#align constant_coeff_witt_polynomial constantCoeff_wittPolynomial
@[simp]
theorem wittPolynomial_zero : wittPolynomial p R 0 = X 0 := by
simp only [wittPolynomial, X, sum_singleton, range_one, pow_zero, zero_add, tsub_self]
#align witt_polynomial_zero wittPolynomial_zero
@[simp]
theorem wittPolynomial_one : wittPolynomial p R 1 = C (p : R) * X 1 + X 0 ^ p := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow, sum_range_succ_comm, range_one, sum_singleton,
one_mul, pow_one, C_1, pow_zero, tsub_self, tsub_zero]
#align witt_polynomial_one wittPolynomial_one
theorem aeval_wittPolynomial {A : Type*} [CommRing A] [Algebra R A] (f : ℕ → A) (n : ℕ) :
aeval f (W_ R n) = ∑ i ∈ range (n + 1), (p : A) ^ i * f i ^ p ^ (n - i) := by
simp [wittPolynomial, AlgHom.map_sum, aeval_monomial, Finsupp.prod_single_index]
#align aeval_witt_polynomial aeval_wittPolynomial
@[simp]
theorem wittPolynomial_zmod_self (n : ℕ) :
W_ (ZMod (p ^ (n + 1))) (n + 1) = expand p (W_ (ZMod (p ^ (n + 1))) n) := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow]
rw [sum_range_succ, ← Nat.cast_pow, CharP.cast_eq_zero (ZMod (p ^ (n + 1))) (p ^ (n + 1)), C_0,
zero_mul, add_zero, AlgHom.map_sum, sum_congr rfl]
intro k hk
rw [AlgHom.map_mul, AlgHom.map_pow, expand_X, algHom_C, ← pow_mul, ← pow_succ']
congr
rw [mem_range] at hk
rw [add_comm, add_tsub_assoc_of_le (Nat.lt_succ_iff.mp hk), ← add_comm]
#align witt_polynomial_zmod_self wittPolynomial_zmod_self
section PPrime
variable [hp : NeZero p]
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 170 | 181 | theorem wittPolynomial_vars [CharZero R] (n : ℕ) : (wittPolynomial p R n).vars = range (n + 1) := by |
have : ∀ i, (monomial (Finsupp.single i (p ^ (n - i))) ((p : R) ^ i)).vars = {i} := by
intro i
refine vars_monomial_single i (pow_ne_zero _ hp.1) ?_
rw [← Nat.cast_pow, Nat.cast_ne_zero]
exact pow_ne_zero i hp.1
rw [wittPolynomial, vars_sum_of_disjoint]
· simp only [this, biUnion_singleton_eq_self]
· simp only [this]
intro a b h
apply disjoint_singleton_left.mpr
rwa [mem_singleton]
| 399 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_eval₂_hom
variable (p : ℕ)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : ℕ) : MvPolynomial ℕ R :=
∑ i ∈ range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : ℕ) :
wittPolynomial p R n = ∑ i ∈ range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
theorem map_wittPolynomial (f : R →+* S) (n : ℕ) : map f (W n) = W n := by
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
#align map_witt_polynomial map_wittPolynomial
variable (R)
@[simp]
theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : ℕ) :
constantCoeff (wittPolynomial p R n) = 0 := by
simp only [wittPolynomial, map_sum, constantCoeff_monomial]
rw [sum_eq_zero]
rintro i _
rw [if_neg]
rw [Finsupp.single_eq_zero]
exact ne_of_gt (pow_pos hp.1.pos _)
#align constant_coeff_witt_polynomial constantCoeff_wittPolynomial
@[simp]
theorem wittPolynomial_zero : wittPolynomial p R 0 = X 0 := by
simp only [wittPolynomial, X, sum_singleton, range_one, pow_zero, zero_add, tsub_self]
#align witt_polynomial_zero wittPolynomial_zero
@[simp]
theorem wittPolynomial_one : wittPolynomial p R 1 = C (p : R) * X 1 + X 0 ^ p := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow, sum_range_succ_comm, range_one, sum_singleton,
one_mul, pow_one, C_1, pow_zero, tsub_self, tsub_zero]
#align witt_polynomial_one wittPolynomial_one
theorem aeval_wittPolynomial {A : Type*} [CommRing A] [Algebra R A] (f : ℕ → A) (n : ℕ) :
aeval f (W_ R n) = ∑ i ∈ range (n + 1), (p : A) ^ i * f i ^ p ^ (n - i) := by
simp [wittPolynomial, AlgHom.map_sum, aeval_monomial, Finsupp.prod_single_index]
#align aeval_witt_polynomial aeval_wittPolynomial
@[simp]
theorem wittPolynomial_zmod_self (n : ℕ) :
W_ (ZMod (p ^ (n + 1))) (n + 1) = expand p (W_ (ZMod (p ^ (n + 1))) n) := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow]
rw [sum_range_succ, ← Nat.cast_pow, CharP.cast_eq_zero (ZMod (p ^ (n + 1))) (p ^ (n + 1)), C_0,
zero_mul, add_zero, AlgHom.map_sum, sum_congr rfl]
intro k hk
rw [AlgHom.map_mul, AlgHom.map_pow, expand_X, algHom_C, ← pow_mul, ← pow_succ']
congr
rw [mem_range] at hk
rw [add_comm, add_tsub_assoc_of_le (Nat.lt_succ_iff.mp hk), ← add_comm]
#align witt_polynomial_zmod_self wittPolynomial_zmod_self
section PPrime
variable [hp : NeZero p]
theorem wittPolynomial_vars [CharZero R] (n : ℕ) : (wittPolynomial p R n).vars = range (n + 1) := by
have : ∀ i, (monomial (Finsupp.single i (p ^ (n - i))) ((p : R) ^ i)).vars = {i} := by
intro i
refine vars_monomial_single i (pow_ne_zero _ hp.1) ?_
rw [← Nat.cast_pow, Nat.cast_ne_zero]
exact pow_ne_zero i hp.1
rw [wittPolynomial, vars_sum_of_disjoint]
· simp only [this, biUnion_singleton_eq_self]
· simp only [this]
intro a b h
apply disjoint_singleton_left.mpr
rwa [mem_singleton]
#align witt_polynomial_vars wittPolynomial_vars
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 184 | 186 | theorem wittPolynomial_vars_subset (n : ℕ) : (wittPolynomial p R n).vars ⊆ range (n + 1) := by |
rw [← map_wittPolynomial p (Int.castRingHom R), ← wittPolynomial_vars p ℤ]
apply vars_map
| 399 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_eval₂_hom
variable (p : ℕ)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : ℕ) : MvPolynomial ℕ R :=
∑ i ∈ range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : ℕ) :
wittPolynomial p R n = ∑ i ∈ range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
theorem map_wittPolynomial (f : R →+* S) (n : ℕ) : map f (W n) = W n := by
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
#align map_witt_polynomial map_wittPolynomial
variable (R)
@[simp]
theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : ℕ) :
constantCoeff (wittPolynomial p R n) = 0 := by
simp only [wittPolynomial, map_sum, constantCoeff_monomial]
rw [sum_eq_zero]
rintro i _
rw [if_neg]
rw [Finsupp.single_eq_zero]
exact ne_of_gt (pow_pos hp.1.pos _)
#align constant_coeff_witt_polynomial constantCoeff_wittPolynomial
@[simp]
theorem wittPolynomial_zero : wittPolynomial p R 0 = X 0 := by
simp only [wittPolynomial, X, sum_singleton, range_one, pow_zero, zero_add, tsub_self]
#align witt_polynomial_zero wittPolynomial_zero
@[simp]
theorem wittPolynomial_one : wittPolynomial p R 1 = C (p : R) * X 1 + X 0 ^ p := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow, sum_range_succ_comm, range_one, sum_singleton,
one_mul, pow_one, C_1, pow_zero, tsub_self, tsub_zero]
#align witt_polynomial_one wittPolynomial_one
theorem aeval_wittPolynomial {A : Type*} [CommRing A] [Algebra R A] (f : ℕ → A) (n : ℕ) :
aeval f (W_ R n) = ∑ i ∈ range (n + 1), (p : A) ^ i * f i ^ p ^ (n - i) := by
simp [wittPolynomial, AlgHom.map_sum, aeval_monomial, Finsupp.prod_single_index]
#align aeval_witt_polynomial aeval_wittPolynomial
@[simp]
theorem wittPolynomial_zmod_self (n : ℕ) :
W_ (ZMod (p ^ (n + 1))) (n + 1) = expand p (W_ (ZMod (p ^ (n + 1))) n) := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow]
rw [sum_range_succ, ← Nat.cast_pow, CharP.cast_eq_zero (ZMod (p ^ (n + 1))) (p ^ (n + 1)), C_0,
zero_mul, add_zero, AlgHom.map_sum, sum_congr rfl]
intro k hk
rw [AlgHom.map_mul, AlgHom.map_pow, expand_X, algHom_C, ← pow_mul, ← pow_succ']
congr
rw [mem_range] at hk
rw [add_comm, add_tsub_assoc_of_le (Nat.lt_succ_iff.mp hk), ← add_comm]
#align witt_polynomial_zmod_self wittPolynomial_zmod_self
end
noncomputable def xInTermsOfW [Invertible (p : R)] : ℕ → MvPolynomial ℕ R
| n => (X n - ∑ i : Fin n,
C ((p : R) ^ (i : ℕ)) * xInTermsOfW i ^ p ^ (n - (i : ℕ))) * C ((⅟ p : R) ^ n)
set_option linter.uppercaseLean3 false in
#align X_in_terms_of_W xInTermsOfW
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 211 | 213 | theorem xInTermsOfW_eq [Invertible (p : R)] {n : ℕ} : xInTermsOfW p R n =
(X n - ∑ i ∈ range n, C ((p: R) ^ i) * xInTermsOfW p R i ^ p ^ (n - i)) * C ((⅟p : R) ^ n) := by |
rw [xInTermsOfW, ← Fin.sum_univ_eq_sum_range]
| 399 |
import Mathlib.Algebra.CharP.Invertible
import Mathlib.Algebra.MvPolynomial.Variables
import Mathlib.Algebra.MvPolynomial.CommRing
import Mathlib.Algebra.MvPolynomial.Expand
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.ZMod.Basic
#align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open MvPolynomial
open Finset hiding map
open Finsupp (single)
--attribute [-simp] coe_eval₂_hom
variable (p : ℕ)
variable (R : Type*) [CommRing R] [DecidableEq R]
noncomputable def wittPolynomial (n : ℕ) : MvPolynomial ℕ R :=
∑ i ∈ range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
#align witt_polynomial wittPolynomial
theorem wittPolynomial_eq_sum_C_mul_X_pow (n : ℕ) :
wittPolynomial p R n = ∑ i ∈ range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by
apply sum_congr rfl
rintro i -
rw [monomial_eq, Finsupp.prod_single_index]
rw [pow_zero]
set_option linter.uppercaseLean3 false in
#align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow
-- Notation with ring of coefficients explicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W_" => wittPolynomial p
-- Notation with ring of coefficients implicit
set_option quotPrecheck false in
@[inherit_doc]
scoped[Witt] notation "W" => wittPolynomial p _
open Witt
open MvPolynomial
section
variable {R} {S : Type*} [CommRing S]
@[simp]
theorem map_wittPolynomial (f : R →+* S) (n : ℕ) : map f (W n) = W n := by
rw [wittPolynomial, map_sum, wittPolynomial]
refine sum_congr rfl fun i _ => ?_
rw [map_monomial, RingHom.map_pow, map_natCast]
#align map_witt_polynomial map_wittPolynomial
variable (R)
@[simp]
theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : ℕ) :
constantCoeff (wittPolynomial p R n) = 0 := by
simp only [wittPolynomial, map_sum, constantCoeff_monomial]
rw [sum_eq_zero]
rintro i _
rw [if_neg]
rw [Finsupp.single_eq_zero]
exact ne_of_gt (pow_pos hp.1.pos _)
#align constant_coeff_witt_polynomial constantCoeff_wittPolynomial
@[simp]
theorem wittPolynomial_zero : wittPolynomial p R 0 = X 0 := by
simp only [wittPolynomial, X, sum_singleton, range_one, pow_zero, zero_add, tsub_self]
#align witt_polynomial_zero wittPolynomial_zero
@[simp]
theorem wittPolynomial_one : wittPolynomial p R 1 = C (p : R) * X 1 + X 0 ^ p := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow, sum_range_succ_comm, range_one, sum_singleton,
one_mul, pow_one, C_1, pow_zero, tsub_self, tsub_zero]
#align witt_polynomial_one wittPolynomial_one
theorem aeval_wittPolynomial {A : Type*} [CommRing A] [Algebra R A] (f : ℕ → A) (n : ℕ) :
aeval f (W_ R n) = ∑ i ∈ range (n + 1), (p : A) ^ i * f i ^ p ^ (n - i) := by
simp [wittPolynomial, AlgHom.map_sum, aeval_monomial, Finsupp.prod_single_index]
#align aeval_witt_polynomial aeval_wittPolynomial
@[simp]
theorem wittPolynomial_zmod_self (n : ℕ) :
W_ (ZMod (p ^ (n + 1))) (n + 1) = expand p (W_ (ZMod (p ^ (n + 1))) n) := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow]
rw [sum_range_succ, ← Nat.cast_pow, CharP.cast_eq_zero (ZMod (p ^ (n + 1))) (p ^ (n + 1)), C_0,
zero_mul, add_zero, AlgHom.map_sum, sum_congr rfl]
intro k hk
rw [AlgHom.map_mul, AlgHom.map_pow, expand_X, algHom_C, ← pow_mul, ← pow_succ']
congr
rw [mem_range] at hk
rw [add_comm, add_tsub_assoc_of_le (Nat.lt_succ_iff.mp hk), ← add_comm]
#align witt_polynomial_zmod_self wittPolynomial_zmod_self
end
noncomputable def xInTermsOfW [Invertible (p : R)] : ℕ → MvPolynomial ℕ R
| n => (X n - ∑ i : Fin n,
C ((p : R) ^ (i : ℕ)) * xInTermsOfW i ^ p ^ (n - (i : ℕ))) * C ((⅟ p : R) ^ n)
set_option linter.uppercaseLean3 false in
#align X_in_terms_of_W xInTermsOfW
theorem xInTermsOfW_eq [Invertible (p : R)] {n : ℕ} : xInTermsOfW p R n =
(X n - ∑ i ∈ range n, C ((p: R) ^ i) * xInTermsOfW p R i ^ p ^ (n - i)) * C ((⅟p : R) ^ n) := by
rw [xInTermsOfW, ← Fin.sum_univ_eq_sum_range]
set_option linter.uppercaseLean3 false in
#align X_in_terms_of_W_eq xInTermsOfW_eq
@[simp]
| Mathlib/RingTheory/WittVector/WittPolynomial.lean | 218 | 234 | theorem constantCoeff_xInTermsOfW [hp : Fact p.Prime] [Invertible (p : R)] (n : ℕ) :
constantCoeff (xInTermsOfW p R n) = 0 := by |
apply Nat.strongInductionOn n; clear n
intro n IH
rw [xInTermsOfW_eq, mul_comm, RingHom.map_mul, RingHom.map_sub, map_sum, constantCoeff_C,
constantCoeff_X, zero_sub, mul_neg, neg_eq_zero]
-- Porting note: here, we should be able to do `rw [sum_eq_zero]`, but the goal that
-- is created is not what we expect, and the sum is not replaced by zero...
-- is it a bug in `rw` tactic?
refine Eq.trans (?_ : _ = ((⅟↑p : R) ^ n)* 0) (mul_zero _)
congr 1
rw [sum_eq_zero]
intro m H
rw [mem_range] at H
simp only [RingHom.map_mul, RingHom.map_pow, map_natCast, IH m H]
rw [zero_pow, mul_zero]
exact pow_ne_zero _ hp.1.ne_zero
| 399 |
import Mathlib.Algebra.Group.Submonoid.Membership
import Mathlib.Algebra.Group.Units
import Mathlib.Algebra.Regular.Basic
import Mathlib.GroupTheory.Congruence.Basic
import Mathlib.Init.Data.Prod
import Mathlib.RingTheory.OreLocalization.Basic
#align_import group_theory.monoid_localization from "leanprover-community/mathlib"@"10ee941346c27bdb5e87bb3535100c0b1f08ac41"
open Function
section CommMonoid
variable {M : Type*} [CommMonoid M] (S : Submonoid M) (N : Type*) [CommMonoid N] {P : Type*}
[CommMonoid P]
namespace Localization
-- Porting note: this does not work so it is done explicitly instead
-- run_cmd to_additive.map_namespace `Localization `AddLocalization
-- run_cmd Elab.Command.liftCoreM <| ToAdditive.insertTranslation `Localization `AddLocalization
@[to_additive AddLocalization.r
"The congruence relation on `M × S`, `M` an `AddCommMonoid` and `S` an `AddSubmonoid` of `M`,
whose quotient is the localization of `M` at `S`, defined as the unique congruence relation on
`M × S` such that for any other congruence relation `s` on `M × S` where for all `y ∈ S`,
`(0, 0) ∼ (y, y)` under `s`, we have that `(x₁, y₁) ∼ (x₂, y₂)` by `r` implies
`(x₁, y₁) ∼ (x₂, y₂)` by `s`."]
def r (S : Submonoid M) : Con (M × S) :=
sInf { c | ∀ y : S, c 1 (y, y) }
#align localization.r Localization.r
#align add_localization.r AddLocalization.r
@[to_additive AddLocalization.r'
"An alternate form of the congruence relation on `M × S`, `M` a `CommMonoid` and `S` a
submonoid of `M`, whose quotient is the localization of `M` at `S`."]
def r' : Con (M × S) := by
-- note we multiply by `c` on the left so that we can later generalize to `•`
refine
{ r := fun a b : M × S ↦ ∃ c : S, ↑c * (↑b.2 * a.1) = c * (a.2 * b.1)
iseqv := ⟨fun a ↦ ⟨1, rfl⟩, fun ⟨c, hc⟩ ↦ ⟨c, hc.symm⟩, ?_⟩
mul' := ?_ }
· rintro a b c ⟨t₁, ht₁⟩ ⟨t₂, ht₂⟩
use t₂ * t₁ * b.2
simp only [Submonoid.coe_mul]
calc
(t₂ * t₁ * b.2 : M) * (c.2 * a.1) = t₂ * c.2 * (t₁ * (b.2 * a.1)) := by ac_rfl
_ = t₁ * a.2 * (t₂ * (c.2 * b.1)) := by rw [ht₁]; ac_rfl
_ = t₂ * t₁ * b.2 * (a.2 * c.1) := by rw [ht₂]; ac_rfl
· rintro a b c d ⟨t₁, ht₁⟩ ⟨t₂, ht₂⟩
use t₂ * t₁
calc
(t₂ * t₁ : M) * (b.2 * d.2 * (a.1 * c.1)) = t₂ * (d.2 * c.1) * (t₁ * (b.2 * a.1)) := by ac_rfl
_ = (t₂ * t₁ : M) * (a.2 * c.2 * (b.1 * d.1)) := by rw [ht₁, ht₂]; ac_rfl
#align localization.r' Localization.r'
#align add_localization.r' AddLocalization.r'
@[to_additive AddLocalization.r_eq_r'
"The additive congruence relation used to localize an `AddCommMonoid` at a submonoid can be
expressed equivalently as an infimum (see `AddLocalization.r`) or explicitly
(see `AddLocalization.r'`)."]
theorem r_eq_r' : r S = r' S :=
le_antisymm (sInf_le fun _ ↦ ⟨1, by simp⟩) <|
le_sInf fun b H ⟨p, q⟩ ⟨x, y⟩ ⟨t, ht⟩ ↦ by
rw [← one_mul (p, q), ← one_mul (x, y)]
refine b.trans (b.mul (H (t * y)) (b.refl _)) ?_
convert b.symm (b.mul (H (t * q)) (b.refl (x, y))) using 1
dsimp only [Prod.mk_mul_mk, Submonoid.coe_mul] at ht ⊢
simp_rw [mul_assoc, ht, mul_comm y q]
#align localization.r_eq_r' Localization.r_eq_r'
#align add_localization.r_eq_r' AddLocalization.r_eq_r'
variable {S}
@[to_additive AddLocalization.r_iff_exists]
| Mathlib/GroupTheory/MonoidLocalization.lean | 206 | 207 | theorem r_iff_exists {x y : M × S} : r S x y ↔ ∃ c : S, ↑c * (↑y.2 * x.1) = c * (x.2 * y.1) := by |
rw [r_eq_r' S]; rfl
| 400 |
import Mathlib.Algebra.Group.Equiv.Basic
import Mathlib.Data.ENat.Lattice
import Mathlib.Data.Part
import Mathlib.Tactic.NormNum
#align_import data.nat.part_enat from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
open Part hiding some
def PartENat : Type :=
Part ℕ
#align part_enat PartENat
namespace PartENat
@[coe]
def some : ℕ → PartENat :=
Part.some
#align part_enat.some PartENat.some
instance : Zero PartENat :=
⟨some 0⟩
instance : Inhabited PartENat :=
⟨0⟩
instance : One PartENat :=
⟨some 1⟩
instance : Add PartENat :=
⟨fun x y => ⟨x.Dom ∧ y.Dom, fun h => get x h.1 + get y h.2⟩⟩
instance (n : ℕ) : Decidable (some n).Dom :=
isTrue trivial
@[simp]
theorem dom_some (x : ℕ) : (some x).Dom :=
trivial
#align part_enat.dom_some PartENat.dom_some
instance addCommMonoid : AddCommMonoid PartENat where
add := (· + ·)
zero := 0
add_comm x y := Part.ext' and_comm fun _ _ => add_comm _ _
zero_add x := Part.ext' (true_and_iff _) fun _ _ => zero_add _
add_zero x := Part.ext' (and_true_iff _) fun _ _ => add_zero _
add_assoc x y z := Part.ext' and_assoc fun _ _ => add_assoc _ _ _
nsmul := nsmulRec
instance : AddCommMonoidWithOne PartENat :=
{ PartENat.addCommMonoid with
one := 1
natCast := some
natCast_zero := rfl
natCast_succ := fun _ => Part.ext' (true_and_iff _).symm fun _ _ => rfl }
theorem some_eq_natCast (n : ℕ) : some n = n :=
rfl
#align part_enat.some_eq_coe PartENat.some_eq_natCast
instance : CharZero PartENat where
cast_injective := Part.some_injective
theorem natCast_inj {x y : ℕ} : (x : PartENat) = y ↔ x = y :=
Nat.cast_inj
#align part_enat.coe_inj PartENat.natCast_inj
@[simp]
theorem dom_natCast (x : ℕ) : (x : PartENat).Dom :=
trivial
#align part_enat.dom_coe PartENat.dom_natCast
-- See note [no_index around OfNat.ofNat]
@[simp]
theorem dom_ofNat (x : ℕ) [x.AtLeastTwo] : (no_index (OfNat.ofNat x : PartENat)).Dom :=
trivial
@[simp]
theorem dom_zero : (0 : PartENat).Dom :=
trivial
@[simp]
theorem dom_one : (1 : PartENat).Dom :=
trivial
instance : CanLift PartENat ℕ (↑) Dom :=
⟨fun n hn => ⟨n.get hn, Part.some_get _⟩⟩
instance : LE PartENat :=
⟨fun x y => ∃ h : y.Dom → x.Dom, ∀ hy : y.Dom, x.get (h hy) ≤ y.get hy⟩
instance : Top PartENat :=
⟨none⟩
instance : Bot PartENat :=
⟨0⟩
instance : Sup PartENat :=
⟨fun x y => ⟨x.Dom ∧ y.Dom, fun h => x.get h.1 ⊔ y.get h.2⟩⟩
theorem le_def (x y : PartENat) :
x ≤ y ↔ ∃ h : y.Dom → x.Dom, ∀ hy : y.Dom, x.get (h hy) ≤ y.get hy :=
Iff.rfl
#align part_enat.le_def PartENat.le_def
@[elab_as_elim]
protected theorem casesOn' {P : PartENat → Prop} :
∀ a : PartENat, P ⊤ → (∀ n : ℕ, P (some n)) → P a :=
Part.induction_on
#align part_enat.cases_on' PartENat.casesOn'
@[elab_as_elim]
protected theorem casesOn {P : PartENat → Prop} : ∀ a : PartENat, P ⊤ → (∀ n : ℕ, P n) → P a := by
exact PartENat.casesOn'
#align part_enat.cases_on PartENat.casesOn
-- not a simp lemma as we will provide a `LinearOrderedAddCommMonoidWithTop` instance later
theorem top_add (x : PartENat) : ⊤ + x = ⊤ :=
Part.ext' (false_and_iff _) fun h => h.left.elim
#align part_enat.top_add PartENat.top_add
-- not a simp lemma as we will provide a `LinearOrderedAddCommMonoidWithTop` instance later
| Mathlib/Data/Nat/PartENat.lean | 175 | 175 | theorem add_top (x : PartENat) : x + ⊤ = ⊤ := by | rw [add_comm, top_add]
| 401 |
import Mathlib.Algebra.Group.Equiv.Basic
import Mathlib.Data.ENat.Lattice
import Mathlib.Data.Part
import Mathlib.Tactic.NormNum
#align_import data.nat.part_enat from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
open Part hiding some
def PartENat : Type :=
Part ℕ
#align part_enat PartENat
namespace PartENat
@[coe]
def some : ℕ → PartENat :=
Part.some
#align part_enat.some PartENat.some
instance : Zero PartENat :=
⟨some 0⟩
instance : Inhabited PartENat :=
⟨0⟩
instance : One PartENat :=
⟨some 1⟩
instance : Add PartENat :=
⟨fun x y => ⟨x.Dom ∧ y.Dom, fun h => get x h.1 + get y h.2⟩⟩
instance (n : ℕ) : Decidable (some n).Dom :=
isTrue trivial
@[simp]
theorem dom_some (x : ℕ) : (some x).Dom :=
trivial
#align part_enat.dom_some PartENat.dom_some
instance addCommMonoid : AddCommMonoid PartENat where
add := (· + ·)
zero := 0
add_comm x y := Part.ext' and_comm fun _ _ => add_comm _ _
zero_add x := Part.ext' (true_and_iff _) fun _ _ => zero_add _
add_zero x := Part.ext' (and_true_iff _) fun _ _ => add_zero _
add_assoc x y z := Part.ext' and_assoc fun _ _ => add_assoc _ _ _
nsmul := nsmulRec
instance : AddCommMonoidWithOne PartENat :=
{ PartENat.addCommMonoid with
one := 1
natCast := some
natCast_zero := rfl
natCast_succ := fun _ => Part.ext' (true_and_iff _).symm fun _ _ => rfl }
theorem some_eq_natCast (n : ℕ) : some n = n :=
rfl
#align part_enat.some_eq_coe PartENat.some_eq_natCast
instance : CharZero PartENat where
cast_injective := Part.some_injective
theorem natCast_inj {x y : ℕ} : (x : PartENat) = y ↔ x = y :=
Nat.cast_inj
#align part_enat.coe_inj PartENat.natCast_inj
@[simp]
theorem dom_natCast (x : ℕ) : (x : PartENat).Dom :=
trivial
#align part_enat.dom_coe PartENat.dom_natCast
-- See note [no_index around OfNat.ofNat]
@[simp]
theorem dom_ofNat (x : ℕ) [x.AtLeastTwo] : (no_index (OfNat.ofNat x : PartENat)).Dom :=
trivial
@[simp]
theorem dom_zero : (0 : PartENat).Dom :=
trivial
@[simp]
theorem dom_one : (1 : PartENat).Dom :=
trivial
instance : CanLift PartENat ℕ (↑) Dom :=
⟨fun n hn => ⟨n.get hn, Part.some_get _⟩⟩
instance : LE PartENat :=
⟨fun x y => ∃ h : y.Dom → x.Dom, ∀ hy : y.Dom, x.get (h hy) ≤ y.get hy⟩
instance : Top PartENat :=
⟨none⟩
instance : Bot PartENat :=
⟨0⟩
instance : Sup PartENat :=
⟨fun x y => ⟨x.Dom ∧ y.Dom, fun h => x.get h.1 ⊔ y.get h.2⟩⟩
theorem le_def (x y : PartENat) :
x ≤ y ↔ ∃ h : y.Dom → x.Dom, ∀ hy : y.Dom, x.get (h hy) ≤ y.get hy :=
Iff.rfl
#align part_enat.le_def PartENat.le_def
@[elab_as_elim]
protected theorem casesOn' {P : PartENat → Prop} :
∀ a : PartENat, P ⊤ → (∀ n : ℕ, P (some n)) → P a :=
Part.induction_on
#align part_enat.cases_on' PartENat.casesOn'
@[elab_as_elim]
protected theorem casesOn {P : PartENat → Prop} : ∀ a : PartENat, P ⊤ → (∀ n : ℕ, P n) → P a := by
exact PartENat.casesOn'
#align part_enat.cases_on PartENat.casesOn
-- not a simp lemma as we will provide a `LinearOrderedAddCommMonoidWithTop` instance later
theorem top_add (x : PartENat) : ⊤ + x = ⊤ :=
Part.ext' (false_and_iff _) fun h => h.left.elim
#align part_enat.top_add PartENat.top_add
-- not a simp lemma as we will provide a `LinearOrderedAddCommMonoidWithTop` instance later
theorem add_top (x : PartENat) : x + ⊤ = ⊤ := by rw [add_comm, top_add]
#align part_enat.add_top PartENat.add_top
@[simp]
| Mathlib/Data/Nat/PartENat.lean | 179 | 180 | theorem natCast_get {x : PartENat} (h : x.Dom) : (x.get h : PartENat) = x := by |
exact Part.ext' (iff_of_true trivial h) fun _ _ => rfl
| 401 |
import Mathlib.Algebra.Group.Equiv.Basic
import Mathlib.Data.ENat.Lattice
import Mathlib.Data.Part
import Mathlib.Tactic.NormNum
#align_import data.nat.part_enat from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
open Part hiding some
def PartENat : Type :=
Part ℕ
#align part_enat PartENat
namespace PartENat
@[coe]
def some : ℕ → PartENat :=
Part.some
#align part_enat.some PartENat.some
instance : Zero PartENat :=
⟨some 0⟩
instance : Inhabited PartENat :=
⟨0⟩
instance : One PartENat :=
⟨some 1⟩
instance : Add PartENat :=
⟨fun x y => ⟨x.Dom ∧ y.Dom, fun h => get x h.1 + get y h.2⟩⟩
instance (n : ℕ) : Decidable (some n).Dom :=
isTrue trivial
@[simp]
theorem dom_some (x : ℕ) : (some x).Dom :=
trivial
#align part_enat.dom_some PartENat.dom_some
instance addCommMonoid : AddCommMonoid PartENat where
add := (· + ·)
zero := 0
add_comm x y := Part.ext' and_comm fun _ _ => add_comm _ _
zero_add x := Part.ext' (true_and_iff _) fun _ _ => zero_add _
add_zero x := Part.ext' (and_true_iff _) fun _ _ => add_zero _
add_assoc x y z := Part.ext' and_assoc fun _ _ => add_assoc _ _ _
nsmul := nsmulRec
instance : AddCommMonoidWithOne PartENat :=
{ PartENat.addCommMonoid with
one := 1
natCast := some
natCast_zero := rfl
natCast_succ := fun _ => Part.ext' (true_and_iff _).symm fun _ _ => rfl }
theorem some_eq_natCast (n : ℕ) : some n = n :=
rfl
#align part_enat.some_eq_coe PartENat.some_eq_natCast
instance : CharZero PartENat where
cast_injective := Part.some_injective
theorem natCast_inj {x y : ℕ} : (x : PartENat) = y ↔ x = y :=
Nat.cast_inj
#align part_enat.coe_inj PartENat.natCast_inj
@[simp]
theorem dom_natCast (x : ℕ) : (x : PartENat).Dom :=
trivial
#align part_enat.dom_coe PartENat.dom_natCast
-- See note [no_index around OfNat.ofNat]
@[simp]
theorem dom_ofNat (x : ℕ) [x.AtLeastTwo] : (no_index (OfNat.ofNat x : PartENat)).Dom :=
trivial
@[simp]
theorem dom_zero : (0 : PartENat).Dom :=
trivial
@[simp]
theorem dom_one : (1 : PartENat).Dom :=
trivial
instance : CanLift PartENat ℕ (↑) Dom :=
⟨fun n hn => ⟨n.get hn, Part.some_get _⟩⟩
instance : LE PartENat :=
⟨fun x y => ∃ h : y.Dom → x.Dom, ∀ hy : y.Dom, x.get (h hy) ≤ y.get hy⟩
instance : Top PartENat :=
⟨none⟩
instance : Bot PartENat :=
⟨0⟩
instance : Sup PartENat :=
⟨fun x y => ⟨x.Dom ∧ y.Dom, fun h => x.get h.1 ⊔ y.get h.2⟩⟩
theorem le_def (x y : PartENat) :
x ≤ y ↔ ∃ h : y.Dom → x.Dom, ∀ hy : y.Dom, x.get (h hy) ≤ y.get hy :=
Iff.rfl
#align part_enat.le_def PartENat.le_def
@[elab_as_elim]
protected theorem casesOn' {P : PartENat → Prop} :
∀ a : PartENat, P ⊤ → (∀ n : ℕ, P (some n)) → P a :=
Part.induction_on
#align part_enat.cases_on' PartENat.casesOn'
@[elab_as_elim]
protected theorem casesOn {P : PartENat → Prop} : ∀ a : PartENat, P ⊤ → (∀ n : ℕ, P n) → P a := by
exact PartENat.casesOn'
#align part_enat.cases_on PartENat.casesOn
-- not a simp lemma as we will provide a `LinearOrderedAddCommMonoidWithTop` instance later
theorem top_add (x : PartENat) : ⊤ + x = ⊤ :=
Part.ext' (false_and_iff _) fun h => h.left.elim
#align part_enat.top_add PartENat.top_add
-- not a simp lemma as we will provide a `LinearOrderedAddCommMonoidWithTop` instance later
theorem add_top (x : PartENat) : x + ⊤ = ⊤ := by rw [add_comm, top_add]
#align part_enat.add_top PartENat.add_top
@[simp]
theorem natCast_get {x : PartENat} (h : x.Dom) : (x.get h : PartENat) = x := by
exact Part.ext' (iff_of_true trivial h) fun _ _ => rfl
#align part_enat.coe_get PartENat.natCast_get
@[simp, norm_cast]
| Mathlib/Data/Nat/PartENat.lean | 184 | 185 | theorem get_natCast' (x : ℕ) (h : (x : PartENat).Dom) : get (x : PartENat) h = x := by |
rw [← natCast_inj, natCast_get]
| 401 |
import Mathlib.Algebra.Group.Equiv.Basic
import Mathlib.Data.ENat.Lattice
import Mathlib.Data.Part
import Mathlib.Tactic.NormNum
#align_import data.nat.part_enat from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
open Part hiding some
def PartENat : Type :=
Part ℕ
#align part_enat PartENat
namespace PartENat
@[coe]
def some : ℕ → PartENat :=
Part.some
#align part_enat.some PartENat.some
instance : Zero PartENat :=
⟨some 0⟩
instance : Inhabited PartENat :=
⟨0⟩
instance : One PartENat :=
⟨some 1⟩
instance : Add PartENat :=
⟨fun x y => ⟨x.Dom ∧ y.Dom, fun h => get x h.1 + get y h.2⟩⟩
instance (n : ℕ) : Decidable (some n).Dom :=
isTrue trivial
@[simp]
theorem dom_some (x : ℕ) : (some x).Dom :=
trivial
#align part_enat.dom_some PartENat.dom_some
instance addCommMonoid : AddCommMonoid PartENat where
add := (· + ·)
zero := 0
add_comm x y := Part.ext' and_comm fun _ _ => add_comm _ _
zero_add x := Part.ext' (true_and_iff _) fun _ _ => zero_add _
add_zero x := Part.ext' (and_true_iff _) fun _ _ => add_zero _
add_assoc x y z := Part.ext' and_assoc fun _ _ => add_assoc _ _ _
nsmul := nsmulRec
instance : AddCommMonoidWithOne PartENat :=
{ PartENat.addCommMonoid with
one := 1
natCast := some
natCast_zero := rfl
natCast_succ := fun _ => Part.ext' (true_and_iff _).symm fun _ _ => rfl }
theorem some_eq_natCast (n : ℕ) : some n = n :=
rfl
#align part_enat.some_eq_coe PartENat.some_eq_natCast
instance : CharZero PartENat where
cast_injective := Part.some_injective
theorem natCast_inj {x y : ℕ} : (x : PartENat) = y ↔ x = y :=
Nat.cast_inj
#align part_enat.coe_inj PartENat.natCast_inj
@[simp]
theorem dom_natCast (x : ℕ) : (x : PartENat).Dom :=
trivial
#align part_enat.dom_coe PartENat.dom_natCast
-- See note [no_index around OfNat.ofNat]
@[simp]
theorem dom_ofNat (x : ℕ) [x.AtLeastTwo] : (no_index (OfNat.ofNat x : PartENat)).Dom :=
trivial
@[simp]
theorem dom_zero : (0 : PartENat).Dom :=
trivial
@[simp]
theorem dom_one : (1 : PartENat).Dom :=
trivial
instance : CanLift PartENat ℕ (↑) Dom :=
⟨fun n hn => ⟨n.get hn, Part.some_get _⟩⟩
instance : LE PartENat :=
⟨fun x y => ∃ h : y.Dom → x.Dom, ∀ hy : y.Dom, x.get (h hy) ≤ y.get hy⟩
instance : Top PartENat :=
⟨none⟩
instance : Bot PartENat :=
⟨0⟩
instance : Sup PartENat :=
⟨fun x y => ⟨x.Dom ∧ y.Dom, fun h => x.get h.1 ⊔ y.get h.2⟩⟩
theorem le_def (x y : PartENat) :
x ≤ y ↔ ∃ h : y.Dom → x.Dom, ∀ hy : y.Dom, x.get (h hy) ≤ y.get hy :=
Iff.rfl
#align part_enat.le_def PartENat.le_def
@[elab_as_elim]
protected theorem casesOn' {P : PartENat → Prop} :
∀ a : PartENat, P ⊤ → (∀ n : ℕ, P (some n)) → P a :=
Part.induction_on
#align part_enat.cases_on' PartENat.casesOn'
@[elab_as_elim]
protected theorem casesOn {P : PartENat → Prop} : ∀ a : PartENat, P ⊤ → (∀ n : ℕ, P n) → P a := by
exact PartENat.casesOn'
#align part_enat.cases_on PartENat.casesOn
-- not a simp lemma as we will provide a `LinearOrderedAddCommMonoidWithTop` instance later
theorem top_add (x : PartENat) : ⊤ + x = ⊤ :=
Part.ext' (false_and_iff _) fun h => h.left.elim
#align part_enat.top_add PartENat.top_add
-- not a simp lemma as we will provide a `LinearOrderedAddCommMonoidWithTop` instance later
theorem add_top (x : PartENat) : x + ⊤ = ⊤ := by rw [add_comm, top_add]
#align part_enat.add_top PartENat.add_top
@[simp]
theorem natCast_get {x : PartENat} (h : x.Dom) : (x.get h : PartENat) = x := by
exact Part.ext' (iff_of_true trivial h) fun _ _ => rfl
#align part_enat.coe_get PartENat.natCast_get
@[simp, norm_cast]
theorem get_natCast' (x : ℕ) (h : (x : PartENat).Dom) : get (x : PartENat) h = x := by
rw [← natCast_inj, natCast_get]
#align part_enat.get_coe' PartENat.get_natCast'
theorem get_natCast {x : ℕ} : get (x : PartENat) (dom_natCast x) = x :=
get_natCast' _ _
#align part_enat.get_coe PartENat.get_natCast
| Mathlib/Data/Nat/PartENat.lean | 192 | 194 | theorem coe_add_get {x : ℕ} {y : PartENat} (h : ((x : PartENat) + y).Dom) :
get ((x : PartENat) + y) h = x + get y h.2 := by |
rfl
| 401 |
import Mathlib.Algebra.Associated
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Algebra.SMulWithZero
import Mathlib.Data.Nat.PartENat
import Mathlib.Tactic.Linarith
#align_import ring_theory.multiplicity from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
variable {α β : Type*}
open Nat Part
def multiplicity [Monoid α] [DecidableRel ((· ∣ ·) : α → α → Prop)] (a b : α) : PartENat :=
PartENat.find fun n => ¬a ^ (n + 1) ∣ b
#align multiplicity multiplicity
namespace multiplicity
section Monoid
variable [Monoid α] [Monoid β]
abbrev Finite (a b : α) : Prop :=
∃ n : ℕ, ¬a ^ (n + 1) ∣ b
#align multiplicity.finite multiplicity.Finite
theorem finite_iff_dom [DecidableRel ((· ∣ ·) : α → α → Prop)] {a b : α} :
Finite a b ↔ (multiplicity a b).Dom :=
Iff.rfl
#align multiplicity.finite_iff_dom multiplicity.finite_iff_dom
theorem finite_def {a b : α} : Finite a b ↔ ∃ n : ℕ, ¬a ^ (n + 1) ∣ b :=
Iff.rfl
#align multiplicity.finite_def multiplicity.finite_def
theorem not_dvd_one_of_finite_one_right {a : α} : Finite a 1 → ¬a ∣ 1 := fun ⟨n, hn⟩ ⟨d, hd⟩ =>
hn ⟨d ^ (n + 1), (pow_mul_pow_eq_one (n + 1) hd.symm).symm⟩
#align multiplicity.not_dvd_one_of_finite_one_right multiplicity.not_dvd_one_of_finite_one_right
@[norm_cast]
| Mathlib/RingTheory/Multiplicity.lean | 65 | 73 | theorem Int.natCast_multiplicity (a b : ℕ) : multiplicity (a : ℤ) (b : ℤ) = multiplicity a b := by |
apply Part.ext'
· rw [← @finite_iff_dom ℕ, @finite_def ℕ, ← @finite_iff_dom ℤ, @finite_def ℤ]
norm_cast
· intro h1 h2
apply _root_.le_antisymm <;>
· apply Nat.find_mono
norm_cast
simp
| 402 |
import Mathlib.Algebra.Associated
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Algebra.SMulWithZero
import Mathlib.Data.Nat.PartENat
import Mathlib.Tactic.Linarith
#align_import ring_theory.multiplicity from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
variable {α β : Type*}
open Nat Part
def multiplicity [Monoid α] [DecidableRel ((· ∣ ·) : α → α → Prop)] (a b : α) : PartENat :=
PartENat.find fun n => ¬a ^ (n + 1) ∣ b
#align multiplicity multiplicity
namespace multiplicity
section Monoid
variable [Monoid α] [Monoid β]
abbrev Finite (a b : α) : Prop :=
∃ n : ℕ, ¬a ^ (n + 1) ∣ b
#align multiplicity.finite multiplicity.Finite
theorem finite_iff_dom [DecidableRel ((· ∣ ·) : α → α → Prop)] {a b : α} :
Finite a b ↔ (multiplicity a b).Dom :=
Iff.rfl
#align multiplicity.finite_iff_dom multiplicity.finite_iff_dom
theorem finite_def {a b : α} : Finite a b ↔ ∃ n : ℕ, ¬a ^ (n + 1) ∣ b :=
Iff.rfl
#align multiplicity.finite_def multiplicity.finite_def
theorem not_dvd_one_of_finite_one_right {a : α} : Finite a 1 → ¬a ∣ 1 := fun ⟨n, hn⟩ ⟨d, hd⟩ =>
hn ⟨d ^ (n + 1), (pow_mul_pow_eq_one (n + 1) hd.symm).symm⟩
#align multiplicity.not_dvd_one_of_finite_one_right multiplicity.not_dvd_one_of_finite_one_right
@[norm_cast]
theorem Int.natCast_multiplicity (a b : ℕ) : multiplicity (a : ℤ) (b : ℤ) = multiplicity a b := by
apply Part.ext'
· rw [← @finite_iff_dom ℕ, @finite_def ℕ, ← @finite_iff_dom ℤ, @finite_def ℤ]
norm_cast
· intro h1 h2
apply _root_.le_antisymm <;>
· apply Nat.find_mono
norm_cast
simp
#align multiplicity.int.coe_nat_multiplicity multiplicity.Int.natCast_multiplicity
@[deprecated (since := "2024-04-05")] alias Int.coe_nat_multiplicity := Int.natCast_multiplicity
theorem not_finite_iff_forall {a b : α} : ¬Finite a b ↔ ∀ n : ℕ, a ^ n ∣ b :=
⟨fun h n =>
Nat.casesOn n
(by
rw [_root_.pow_zero]
exact one_dvd _)
(by simpa [Finite, Classical.not_not] using h),
by simp [Finite, multiplicity, Classical.not_not]; tauto⟩
#align multiplicity.not_finite_iff_forall multiplicity.not_finite_iff_forall
theorem not_unit_of_finite {a b : α} (h : Finite a b) : ¬IsUnit a :=
let ⟨n, hn⟩ := h
hn ∘ IsUnit.dvd ∘ IsUnit.pow (n + 1)
#align multiplicity.not_unit_of_finite multiplicity.not_unit_of_finite
theorem finite_of_finite_mul_right {a b c : α} : Finite a (b * c) → Finite a b := fun ⟨n, hn⟩ =>
⟨n, fun h => hn (h.trans (dvd_mul_right _ _))⟩
#align multiplicity.finite_of_finite_mul_right multiplicity.finite_of_finite_mul_right
variable [DecidableRel ((· ∣ ·) : α → α → Prop)] [DecidableRel ((· ∣ ·) : β → β → Prop)]
| Mathlib/RingTheory/Multiplicity.lean | 99 | 107 | theorem pow_dvd_of_le_multiplicity {a b : α} {k : ℕ} :
(k : PartENat) ≤ multiplicity a b → a ^ k ∣ b := by |
rw [← PartENat.some_eq_natCast]
exact
Nat.casesOn k
(fun _ => by
rw [_root_.pow_zero]
exact one_dvd _)
fun k ⟨_, h₂⟩ => by_contradiction fun hk => Nat.find_min _ (lt_of_succ_le (h₂ ⟨k, hk⟩)) hk
| 402 |
import Mathlib.Algebra.Associated
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Algebra.SMulWithZero
import Mathlib.Data.Nat.PartENat
import Mathlib.Tactic.Linarith
#align_import ring_theory.multiplicity from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
variable {α β : Type*}
open Nat Part
def multiplicity [Monoid α] [DecidableRel ((· ∣ ·) : α → α → Prop)] (a b : α) : PartENat :=
PartENat.find fun n => ¬a ^ (n + 1) ∣ b
#align multiplicity multiplicity
namespace multiplicity
section Monoid
variable [Monoid α] [Monoid β]
abbrev Finite (a b : α) : Prop :=
∃ n : ℕ, ¬a ^ (n + 1) ∣ b
#align multiplicity.finite multiplicity.Finite
theorem finite_iff_dom [DecidableRel ((· ∣ ·) : α → α → Prop)] {a b : α} :
Finite a b ↔ (multiplicity a b).Dom :=
Iff.rfl
#align multiplicity.finite_iff_dom multiplicity.finite_iff_dom
theorem finite_def {a b : α} : Finite a b ↔ ∃ n : ℕ, ¬a ^ (n + 1) ∣ b :=
Iff.rfl
#align multiplicity.finite_def multiplicity.finite_def
theorem not_dvd_one_of_finite_one_right {a : α} : Finite a 1 → ¬a ∣ 1 := fun ⟨n, hn⟩ ⟨d, hd⟩ =>
hn ⟨d ^ (n + 1), (pow_mul_pow_eq_one (n + 1) hd.symm).symm⟩
#align multiplicity.not_dvd_one_of_finite_one_right multiplicity.not_dvd_one_of_finite_one_right
@[norm_cast]
theorem Int.natCast_multiplicity (a b : ℕ) : multiplicity (a : ℤ) (b : ℤ) = multiplicity a b := by
apply Part.ext'
· rw [← @finite_iff_dom ℕ, @finite_def ℕ, ← @finite_iff_dom ℤ, @finite_def ℤ]
norm_cast
· intro h1 h2
apply _root_.le_antisymm <;>
· apply Nat.find_mono
norm_cast
simp
#align multiplicity.int.coe_nat_multiplicity multiplicity.Int.natCast_multiplicity
@[deprecated (since := "2024-04-05")] alias Int.coe_nat_multiplicity := Int.natCast_multiplicity
theorem not_finite_iff_forall {a b : α} : ¬Finite a b ↔ ∀ n : ℕ, a ^ n ∣ b :=
⟨fun h n =>
Nat.casesOn n
(by
rw [_root_.pow_zero]
exact one_dvd _)
(by simpa [Finite, Classical.not_not] using h),
by simp [Finite, multiplicity, Classical.not_not]; tauto⟩
#align multiplicity.not_finite_iff_forall multiplicity.not_finite_iff_forall
theorem not_unit_of_finite {a b : α} (h : Finite a b) : ¬IsUnit a :=
let ⟨n, hn⟩ := h
hn ∘ IsUnit.dvd ∘ IsUnit.pow (n + 1)
#align multiplicity.not_unit_of_finite multiplicity.not_unit_of_finite
theorem finite_of_finite_mul_right {a b c : α} : Finite a (b * c) → Finite a b := fun ⟨n, hn⟩ =>
⟨n, fun h => hn (h.trans (dvd_mul_right _ _))⟩
#align multiplicity.finite_of_finite_mul_right multiplicity.finite_of_finite_mul_right
variable [DecidableRel ((· ∣ ·) : α → α → Prop)] [DecidableRel ((· ∣ ·) : β → β → Prop)]
theorem pow_dvd_of_le_multiplicity {a b : α} {k : ℕ} :
(k : PartENat) ≤ multiplicity a b → a ^ k ∣ b := by
rw [← PartENat.some_eq_natCast]
exact
Nat.casesOn k
(fun _ => by
rw [_root_.pow_zero]
exact one_dvd _)
fun k ⟨_, h₂⟩ => by_contradiction fun hk => Nat.find_min _ (lt_of_succ_le (h₂ ⟨k, hk⟩)) hk
#align multiplicity.pow_dvd_of_le_multiplicity multiplicity.pow_dvd_of_le_multiplicity
theorem pow_multiplicity_dvd {a b : α} (h : Finite a b) : a ^ get (multiplicity a b) h ∣ b :=
pow_dvd_of_le_multiplicity (by rw [PartENat.natCast_get])
#align multiplicity.pow_multiplicity_dvd multiplicity.pow_multiplicity_dvd
theorem is_greatest {a b : α} {m : ℕ} (hm : multiplicity a b < m) : ¬a ^ m ∣ b := fun h => by
rw [PartENat.lt_coe_iff] at hm; exact Nat.find_spec hm.fst ((pow_dvd_pow _ hm.snd).trans h)
#align multiplicity.is_greatest multiplicity.is_greatest
theorem is_greatest' {a b : α} {m : ℕ} (h : Finite a b) (hm : get (multiplicity a b) h < m) :
¬a ^ m ∣ b :=
is_greatest (by rwa [← PartENat.coe_lt_coe, PartENat.natCast_get] at hm)
#align multiplicity.is_greatest' multiplicity.is_greatest'
| Mathlib/RingTheory/Multiplicity.lean | 123 | 126 | theorem pos_of_dvd {a b : α} (hfin : Finite a b) (hdiv : a ∣ b) :
0 < (multiplicity a b).get hfin := by |
refine zero_lt_iff.2 fun h => ?_
simpa [hdiv] using is_greatest' hfin (lt_one_iff.mpr h)
| 402 |
import Mathlib.Algebra.Associated
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Algebra.SMulWithZero
import Mathlib.Data.Nat.PartENat
import Mathlib.Tactic.Linarith
#align_import ring_theory.multiplicity from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
variable {α β : Type*}
open Nat Part
def multiplicity [Monoid α] [DecidableRel ((· ∣ ·) : α → α → Prop)] (a b : α) : PartENat :=
PartENat.find fun n => ¬a ^ (n + 1) ∣ b
#align multiplicity multiplicity
namespace multiplicity
section Monoid
variable [Monoid α] [Monoid β]
abbrev Finite (a b : α) : Prop :=
∃ n : ℕ, ¬a ^ (n + 1) ∣ b
#align multiplicity.finite multiplicity.Finite
theorem finite_iff_dom [DecidableRel ((· ∣ ·) : α → α → Prop)] {a b : α} :
Finite a b ↔ (multiplicity a b).Dom :=
Iff.rfl
#align multiplicity.finite_iff_dom multiplicity.finite_iff_dom
theorem finite_def {a b : α} : Finite a b ↔ ∃ n : ℕ, ¬a ^ (n + 1) ∣ b :=
Iff.rfl
#align multiplicity.finite_def multiplicity.finite_def
theorem not_dvd_one_of_finite_one_right {a : α} : Finite a 1 → ¬a ∣ 1 := fun ⟨n, hn⟩ ⟨d, hd⟩ =>
hn ⟨d ^ (n + 1), (pow_mul_pow_eq_one (n + 1) hd.symm).symm⟩
#align multiplicity.not_dvd_one_of_finite_one_right multiplicity.not_dvd_one_of_finite_one_right
@[norm_cast]
theorem Int.natCast_multiplicity (a b : ℕ) : multiplicity (a : ℤ) (b : ℤ) = multiplicity a b := by
apply Part.ext'
· rw [← @finite_iff_dom ℕ, @finite_def ℕ, ← @finite_iff_dom ℤ, @finite_def ℤ]
norm_cast
· intro h1 h2
apply _root_.le_antisymm <;>
· apply Nat.find_mono
norm_cast
simp
#align multiplicity.int.coe_nat_multiplicity multiplicity.Int.natCast_multiplicity
@[deprecated (since := "2024-04-05")] alias Int.coe_nat_multiplicity := Int.natCast_multiplicity
theorem not_finite_iff_forall {a b : α} : ¬Finite a b ↔ ∀ n : ℕ, a ^ n ∣ b :=
⟨fun h n =>
Nat.casesOn n
(by
rw [_root_.pow_zero]
exact one_dvd _)
(by simpa [Finite, Classical.not_not] using h),
by simp [Finite, multiplicity, Classical.not_not]; tauto⟩
#align multiplicity.not_finite_iff_forall multiplicity.not_finite_iff_forall
theorem not_unit_of_finite {a b : α} (h : Finite a b) : ¬IsUnit a :=
let ⟨n, hn⟩ := h
hn ∘ IsUnit.dvd ∘ IsUnit.pow (n + 1)
#align multiplicity.not_unit_of_finite multiplicity.not_unit_of_finite
theorem finite_of_finite_mul_right {a b c : α} : Finite a (b * c) → Finite a b := fun ⟨n, hn⟩ =>
⟨n, fun h => hn (h.trans (dvd_mul_right _ _))⟩
#align multiplicity.finite_of_finite_mul_right multiplicity.finite_of_finite_mul_right
variable [DecidableRel ((· ∣ ·) : α → α → Prop)] [DecidableRel ((· ∣ ·) : β → β → Prop)]
theorem pow_dvd_of_le_multiplicity {a b : α} {k : ℕ} :
(k : PartENat) ≤ multiplicity a b → a ^ k ∣ b := by
rw [← PartENat.some_eq_natCast]
exact
Nat.casesOn k
(fun _ => by
rw [_root_.pow_zero]
exact one_dvd _)
fun k ⟨_, h₂⟩ => by_contradiction fun hk => Nat.find_min _ (lt_of_succ_le (h₂ ⟨k, hk⟩)) hk
#align multiplicity.pow_dvd_of_le_multiplicity multiplicity.pow_dvd_of_le_multiplicity
theorem pow_multiplicity_dvd {a b : α} (h : Finite a b) : a ^ get (multiplicity a b) h ∣ b :=
pow_dvd_of_le_multiplicity (by rw [PartENat.natCast_get])
#align multiplicity.pow_multiplicity_dvd multiplicity.pow_multiplicity_dvd
theorem is_greatest {a b : α} {m : ℕ} (hm : multiplicity a b < m) : ¬a ^ m ∣ b := fun h => by
rw [PartENat.lt_coe_iff] at hm; exact Nat.find_spec hm.fst ((pow_dvd_pow _ hm.snd).trans h)
#align multiplicity.is_greatest multiplicity.is_greatest
theorem is_greatest' {a b : α} {m : ℕ} (h : Finite a b) (hm : get (multiplicity a b) h < m) :
¬a ^ m ∣ b :=
is_greatest (by rwa [← PartENat.coe_lt_coe, PartENat.natCast_get] at hm)
#align multiplicity.is_greatest' multiplicity.is_greatest'
theorem pos_of_dvd {a b : α} (hfin : Finite a b) (hdiv : a ∣ b) :
0 < (multiplicity a b).get hfin := by
refine zero_lt_iff.2 fun h => ?_
simpa [hdiv] using is_greatest' hfin (lt_one_iff.mpr h)
#align multiplicity.pos_of_dvd multiplicity.pos_of_dvd
theorem unique {a b : α} {k : ℕ} (hk : a ^ k ∣ b) (hsucc : ¬a ^ (k + 1) ∣ b) :
(k : PartENat) = multiplicity a b :=
le_antisymm (le_of_not_gt fun hk' => is_greatest hk' hk) <| by
have : Finite a b := ⟨k, hsucc⟩
rw [PartENat.le_coe_iff]
exact ⟨this, Nat.find_min' _ hsucc⟩
#align multiplicity.unique multiplicity.unique
| Mathlib/RingTheory/Multiplicity.lean | 137 | 139 | theorem unique' {a b : α} {k : ℕ} (hk : a ^ k ∣ b) (hsucc : ¬a ^ (k + 1) ∣ b) :
k = get (multiplicity a b) ⟨k, hsucc⟩ := by |
rw [← PartENat.natCast_inj, PartENat.natCast_get, unique hk hsucc]
| 402 |
import Mathlib.AlgebraicGeometry.GammaSpecAdjunction
import Mathlib.AlgebraicGeometry.Restrict
import Mathlib.CategoryTheory.Limits.Opposites
import Mathlib.RingTheory.Localization.InvSubmonoid
#align_import algebraic_geometry.AffineScheme from "leanprover-community/mathlib"@"88474d1b5af6d37c2ab728b757771bced7f5194c"
-- Explicit universe annotations were used in this file to improve perfomance #12737
set_option linter.uppercaseLean3 false
noncomputable section
open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace
universe u
namespace AlgebraicGeometry
open Spec (structureSheaf)
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
def AffineScheme :=
Scheme.Spec.EssImageSubcategory
deriving Category
#align algebraic_geometry.AffineScheme AlgebraicGeometry.AffineScheme
class IsAffine (X : Scheme) : Prop where
affine : IsIso (ΓSpec.adjunction.unit.app X)
#align algebraic_geometry.is_affine AlgebraicGeometry.IsAffine
attribute [instance] IsAffine.affine
def Scheme.isoSpec (X : Scheme) [IsAffine X] : X ≅ Scheme.Spec.obj (op <| Scheme.Γ.obj <| op X) :=
asIso (ΓSpec.adjunction.unit.app X)
#align algebraic_geometry.Scheme.iso_Spec AlgebraicGeometry.Scheme.isoSpec
@[simps]
def AffineScheme.mk (X : Scheme) (_ : IsAffine X) : AffineScheme :=
⟨X, mem_essImage_of_unit_isIso (adj := ΓSpec.adjunction) _⟩
#align algebraic_geometry.AffineScheme.mk AlgebraicGeometry.AffineScheme.mk
def AffineScheme.of (X : Scheme) [h : IsAffine X] : AffineScheme :=
AffineScheme.mk X h
#align algebraic_geometry.AffineScheme.of AlgebraicGeometry.AffineScheme.of
def AffineScheme.ofHom {X Y : Scheme} [IsAffine X] [IsAffine Y] (f : X ⟶ Y) :
AffineScheme.of X ⟶ AffineScheme.of Y :=
f
#align algebraic_geometry.AffineScheme.of_hom AlgebraicGeometry.AffineScheme.ofHom
theorem mem_Spec_essImage (X : Scheme) : X ∈ Scheme.Spec.essImage ↔ IsAffine X :=
⟨fun h => ⟨Functor.essImage.unit_isIso h⟩,
fun _ => mem_essImage_of_unit_isIso (adj := ΓSpec.adjunction) _⟩
#align algebraic_geometry.mem_Spec_ess_image AlgebraicGeometry.mem_Spec_essImage
instance isAffineAffineScheme (X : AffineScheme.{u}) : IsAffine X.obj :=
⟨Functor.essImage.unit_isIso X.property⟩
#align algebraic_geometry.is_affine_AffineScheme AlgebraicGeometry.isAffineAffineScheme
instance SpecIsAffine (R : CommRingCatᵒᵖ) : IsAffine (Scheme.Spec.obj R) :=
AlgebraicGeometry.isAffineAffineScheme ⟨_, Scheme.Spec.obj_mem_essImage R⟩
#align algebraic_geometry.Spec_is_affine AlgebraicGeometry.SpecIsAffine
| Mathlib/AlgebraicGeometry/AffineScheme.lean | 101 | 102 | theorem isAffineOfIso {X Y : Scheme} (f : X ⟶ Y) [IsIso f] [h : IsAffine Y] : IsAffine X := by |
rw [← mem_Spec_essImage] at h ⊢; exact Functor.essImage.ofIso (asIso f).symm h
| 403 |
import Mathlib.AlgebraicGeometry.GammaSpecAdjunction
import Mathlib.AlgebraicGeometry.Restrict
import Mathlib.CategoryTheory.Limits.Opposites
import Mathlib.RingTheory.Localization.InvSubmonoid
#align_import algebraic_geometry.AffineScheme from "leanprover-community/mathlib"@"88474d1b5af6d37c2ab728b757771bced7f5194c"
-- Explicit universe annotations were used in this file to improve perfomance #12737
set_option linter.uppercaseLean3 false
noncomputable section
open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace
universe u
namespace AlgebraicGeometry
open Spec (structureSheaf)
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
def AffineScheme :=
Scheme.Spec.EssImageSubcategory
deriving Category
#align algebraic_geometry.AffineScheme AlgebraicGeometry.AffineScheme
class IsAffine (X : Scheme) : Prop where
affine : IsIso (ΓSpec.adjunction.unit.app X)
#align algebraic_geometry.is_affine AlgebraicGeometry.IsAffine
attribute [instance] IsAffine.affine
def Scheme.isoSpec (X : Scheme) [IsAffine X] : X ≅ Scheme.Spec.obj (op <| Scheme.Γ.obj <| op X) :=
asIso (ΓSpec.adjunction.unit.app X)
#align algebraic_geometry.Scheme.iso_Spec AlgebraicGeometry.Scheme.isoSpec
@[simps]
def AffineScheme.mk (X : Scheme) (_ : IsAffine X) : AffineScheme :=
⟨X, mem_essImage_of_unit_isIso (adj := ΓSpec.adjunction) _⟩
#align algebraic_geometry.AffineScheme.mk AlgebraicGeometry.AffineScheme.mk
def AffineScheme.of (X : Scheme) [h : IsAffine X] : AffineScheme :=
AffineScheme.mk X h
#align algebraic_geometry.AffineScheme.of AlgebraicGeometry.AffineScheme.of
def AffineScheme.ofHom {X Y : Scheme} [IsAffine X] [IsAffine Y] (f : X ⟶ Y) :
AffineScheme.of X ⟶ AffineScheme.of Y :=
f
#align algebraic_geometry.AffineScheme.of_hom AlgebraicGeometry.AffineScheme.ofHom
theorem mem_Spec_essImage (X : Scheme) : X ∈ Scheme.Spec.essImage ↔ IsAffine X :=
⟨fun h => ⟨Functor.essImage.unit_isIso h⟩,
fun _ => mem_essImage_of_unit_isIso (adj := ΓSpec.adjunction) _⟩
#align algebraic_geometry.mem_Spec_ess_image AlgebraicGeometry.mem_Spec_essImage
instance isAffineAffineScheme (X : AffineScheme.{u}) : IsAffine X.obj :=
⟨Functor.essImage.unit_isIso X.property⟩
#align algebraic_geometry.is_affine_AffineScheme AlgebraicGeometry.isAffineAffineScheme
instance SpecIsAffine (R : CommRingCatᵒᵖ) : IsAffine (Scheme.Spec.obj R) :=
AlgebraicGeometry.isAffineAffineScheme ⟨_, Scheme.Spec.obj_mem_essImage R⟩
#align algebraic_geometry.Spec_is_affine AlgebraicGeometry.SpecIsAffine
theorem isAffineOfIso {X Y : Scheme} (f : X ⟶ Y) [IsIso f] [h : IsAffine Y] : IsAffine X := by
rw [← mem_Spec_essImage] at h ⊢; exact Functor.essImage.ofIso (asIso f).symm h
#align algebraic_geometry.is_affine_of_iso AlgebraicGeometry.isAffineOfIso
def IsAffineOpen {X : Scheme} (U : Opens X) : Prop :=
IsAffine (X ∣_ᵤ U)
#align algebraic_geometry.is_affine_open AlgebraicGeometry.IsAffineOpen
def Scheme.affineOpens (X : Scheme) : Set (Opens X) :=
{U : Opens X | IsAffineOpen U}
#align algebraic_geometry.Scheme.affine_opens AlgebraicGeometry.Scheme.affineOpens
instance {Y : Scheme.{u}} (U : Y.affineOpens) :
IsAffine (Scheme.restrict Y <| Opens.openEmbedding U.val) :=
U.property
| Mathlib/AlgebraicGeometry/AffineScheme.lean | 187 | 190 | theorem rangeIsAffineOpenOfOpenImmersion {X Y : Scheme} [IsAffine X] (f : X ⟶ Y)
[H : IsOpenImmersion f] : IsAffineOpen (Scheme.Hom.opensRange f) := by |
refine isAffineOfIso (IsOpenImmersion.isoOfRangeEq f (Y.ofRestrict _) ?_).inv
exact Subtype.range_val.symm
| 403 |
import Mathlib.AlgebraicGeometry.GammaSpecAdjunction
import Mathlib.AlgebraicGeometry.Restrict
import Mathlib.CategoryTheory.Limits.Opposites
import Mathlib.RingTheory.Localization.InvSubmonoid
#align_import algebraic_geometry.AffineScheme from "leanprover-community/mathlib"@"88474d1b5af6d37c2ab728b757771bced7f5194c"
-- Explicit universe annotations were used in this file to improve perfomance #12737
set_option linter.uppercaseLean3 false
noncomputable section
open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace
universe u
namespace AlgebraicGeometry
open Spec (structureSheaf)
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
def AffineScheme :=
Scheme.Spec.EssImageSubcategory
deriving Category
#align algebraic_geometry.AffineScheme AlgebraicGeometry.AffineScheme
class IsAffine (X : Scheme) : Prop where
affine : IsIso (ΓSpec.adjunction.unit.app X)
#align algebraic_geometry.is_affine AlgebraicGeometry.IsAffine
attribute [instance] IsAffine.affine
def Scheme.isoSpec (X : Scheme) [IsAffine X] : X ≅ Scheme.Spec.obj (op <| Scheme.Γ.obj <| op X) :=
asIso (ΓSpec.adjunction.unit.app X)
#align algebraic_geometry.Scheme.iso_Spec AlgebraicGeometry.Scheme.isoSpec
@[simps]
def AffineScheme.mk (X : Scheme) (_ : IsAffine X) : AffineScheme :=
⟨X, mem_essImage_of_unit_isIso (adj := ΓSpec.adjunction) _⟩
#align algebraic_geometry.AffineScheme.mk AlgebraicGeometry.AffineScheme.mk
def AffineScheme.of (X : Scheme) [h : IsAffine X] : AffineScheme :=
AffineScheme.mk X h
#align algebraic_geometry.AffineScheme.of AlgebraicGeometry.AffineScheme.of
def AffineScheme.ofHom {X Y : Scheme} [IsAffine X] [IsAffine Y] (f : X ⟶ Y) :
AffineScheme.of X ⟶ AffineScheme.of Y :=
f
#align algebraic_geometry.AffineScheme.of_hom AlgebraicGeometry.AffineScheme.ofHom
theorem mem_Spec_essImage (X : Scheme) : X ∈ Scheme.Spec.essImage ↔ IsAffine X :=
⟨fun h => ⟨Functor.essImage.unit_isIso h⟩,
fun _ => mem_essImage_of_unit_isIso (adj := ΓSpec.adjunction) _⟩
#align algebraic_geometry.mem_Spec_ess_image AlgebraicGeometry.mem_Spec_essImage
instance isAffineAffineScheme (X : AffineScheme.{u}) : IsAffine X.obj :=
⟨Functor.essImage.unit_isIso X.property⟩
#align algebraic_geometry.is_affine_AffineScheme AlgebraicGeometry.isAffineAffineScheme
instance SpecIsAffine (R : CommRingCatᵒᵖ) : IsAffine (Scheme.Spec.obj R) :=
AlgebraicGeometry.isAffineAffineScheme ⟨_, Scheme.Spec.obj_mem_essImage R⟩
#align algebraic_geometry.Spec_is_affine AlgebraicGeometry.SpecIsAffine
theorem isAffineOfIso {X Y : Scheme} (f : X ⟶ Y) [IsIso f] [h : IsAffine Y] : IsAffine X := by
rw [← mem_Spec_essImage] at h ⊢; exact Functor.essImage.ofIso (asIso f).symm h
#align algebraic_geometry.is_affine_of_iso AlgebraicGeometry.isAffineOfIso
def IsAffineOpen {X : Scheme} (U : Opens X) : Prop :=
IsAffine (X ∣_ᵤ U)
#align algebraic_geometry.is_affine_open AlgebraicGeometry.IsAffineOpen
def Scheme.affineOpens (X : Scheme) : Set (Opens X) :=
{U : Opens X | IsAffineOpen U}
#align algebraic_geometry.Scheme.affine_opens AlgebraicGeometry.Scheme.affineOpens
instance {Y : Scheme.{u}} (U : Y.affineOpens) :
IsAffine (Scheme.restrict Y <| Opens.openEmbedding U.val) :=
U.property
theorem rangeIsAffineOpenOfOpenImmersion {X Y : Scheme} [IsAffine X] (f : X ⟶ Y)
[H : IsOpenImmersion f] : IsAffineOpen (Scheme.Hom.opensRange f) := by
refine isAffineOfIso (IsOpenImmersion.isoOfRangeEq f (Y.ofRestrict _) ?_).inv
exact Subtype.range_val.symm
#align algebraic_geometry.range_is_affine_open_of_open_immersion AlgebraicGeometry.rangeIsAffineOpenOfOpenImmersion
| Mathlib/AlgebraicGeometry/AffineScheme.lean | 193 | 196 | theorem topIsAffineOpen (X : Scheme) [IsAffine X] : IsAffineOpen (⊤ : Opens X) := by |
convert rangeIsAffineOpenOfOpenImmersion (𝟙 X)
ext1
exact Set.range_id.symm
| 403 |
import Mathlib.AlgebraicGeometry.GammaSpecAdjunction
import Mathlib.AlgebraicGeometry.Restrict
import Mathlib.CategoryTheory.Limits.Opposites
import Mathlib.RingTheory.Localization.InvSubmonoid
#align_import algebraic_geometry.AffineScheme from "leanprover-community/mathlib"@"88474d1b5af6d37c2ab728b757771bced7f5194c"
-- Explicit universe annotations were used in this file to improve perfomance #12737
set_option linter.uppercaseLean3 false
noncomputable section
open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace
universe u
namespace AlgebraicGeometry
open Spec (structureSheaf)
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
def AffineScheme :=
Scheme.Spec.EssImageSubcategory
deriving Category
#align algebraic_geometry.AffineScheme AlgebraicGeometry.AffineScheme
class IsAffine (X : Scheme) : Prop where
affine : IsIso (ΓSpec.adjunction.unit.app X)
#align algebraic_geometry.is_affine AlgebraicGeometry.IsAffine
attribute [instance] IsAffine.affine
def Scheme.isoSpec (X : Scheme) [IsAffine X] : X ≅ Scheme.Spec.obj (op <| Scheme.Γ.obj <| op X) :=
asIso (ΓSpec.adjunction.unit.app X)
#align algebraic_geometry.Scheme.iso_Spec AlgebraicGeometry.Scheme.isoSpec
@[simps]
def AffineScheme.mk (X : Scheme) (_ : IsAffine X) : AffineScheme :=
⟨X, mem_essImage_of_unit_isIso (adj := ΓSpec.adjunction) _⟩
#align algebraic_geometry.AffineScheme.mk AlgebraicGeometry.AffineScheme.mk
def AffineScheme.of (X : Scheme) [h : IsAffine X] : AffineScheme :=
AffineScheme.mk X h
#align algebraic_geometry.AffineScheme.of AlgebraicGeometry.AffineScheme.of
def AffineScheme.ofHom {X Y : Scheme} [IsAffine X] [IsAffine Y] (f : X ⟶ Y) :
AffineScheme.of X ⟶ AffineScheme.of Y :=
f
#align algebraic_geometry.AffineScheme.of_hom AlgebraicGeometry.AffineScheme.ofHom
theorem mem_Spec_essImage (X : Scheme) : X ∈ Scheme.Spec.essImage ↔ IsAffine X :=
⟨fun h => ⟨Functor.essImage.unit_isIso h⟩,
fun _ => mem_essImage_of_unit_isIso (adj := ΓSpec.adjunction) _⟩
#align algebraic_geometry.mem_Spec_ess_image AlgebraicGeometry.mem_Spec_essImage
instance isAffineAffineScheme (X : AffineScheme.{u}) : IsAffine X.obj :=
⟨Functor.essImage.unit_isIso X.property⟩
#align algebraic_geometry.is_affine_AffineScheme AlgebraicGeometry.isAffineAffineScheme
instance SpecIsAffine (R : CommRingCatᵒᵖ) : IsAffine (Scheme.Spec.obj R) :=
AlgebraicGeometry.isAffineAffineScheme ⟨_, Scheme.Spec.obj_mem_essImage R⟩
#align algebraic_geometry.Spec_is_affine AlgebraicGeometry.SpecIsAffine
theorem isAffineOfIso {X Y : Scheme} (f : X ⟶ Y) [IsIso f] [h : IsAffine Y] : IsAffine X := by
rw [← mem_Spec_essImage] at h ⊢; exact Functor.essImage.ofIso (asIso f).symm h
#align algebraic_geometry.is_affine_of_iso AlgebraicGeometry.isAffineOfIso
def IsAffineOpen {X : Scheme} (U : Opens X) : Prop :=
IsAffine (X ∣_ᵤ U)
#align algebraic_geometry.is_affine_open AlgebraicGeometry.IsAffineOpen
def Scheme.affineOpens (X : Scheme) : Set (Opens X) :=
{U : Opens X | IsAffineOpen U}
#align algebraic_geometry.Scheme.affine_opens AlgebraicGeometry.Scheme.affineOpens
instance {Y : Scheme.{u}} (U : Y.affineOpens) :
IsAffine (Scheme.restrict Y <| Opens.openEmbedding U.val) :=
U.property
theorem rangeIsAffineOpenOfOpenImmersion {X Y : Scheme} [IsAffine X] (f : X ⟶ Y)
[H : IsOpenImmersion f] : IsAffineOpen (Scheme.Hom.opensRange f) := by
refine isAffineOfIso (IsOpenImmersion.isoOfRangeEq f (Y.ofRestrict _) ?_).inv
exact Subtype.range_val.symm
#align algebraic_geometry.range_is_affine_open_of_open_immersion AlgebraicGeometry.rangeIsAffineOpenOfOpenImmersion
theorem topIsAffineOpen (X : Scheme) [IsAffine X] : IsAffineOpen (⊤ : Opens X) := by
convert rangeIsAffineOpenOfOpenImmersion (𝟙 X)
ext1
exact Set.range_id.symm
#align algebraic_geometry.top_is_affine_open AlgebraicGeometry.topIsAffineOpen
instance Scheme.affineCoverIsAffine (X : Scheme) (i : X.affineCover.J) :
IsAffine (X.affineCover.obj i) :=
AlgebraicGeometry.SpecIsAffine _
#align algebraic_geometry.Scheme.affine_cover_is_affine AlgebraicGeometry.Scheme.affineCoverIsAffine
instance Scheme.affineBasisCoverIsAffine (X : Scheme) (i : X.affineBasisCover.J) :
IsAffine (X.affineBasisCover.obj i) :=
AlgebraicGeometry.SpecIsAffine _
#align algebraic_geometry.Scheme.affine_basis_cover_is_affine AlgebraicGeometry.Scheme.affineBasisCoverIsAffine
| Mathlib/AlgebraicGeometry/AffineScheme.lean | 209 | 215 | theorem isBasis_affine_open (X : Scheme) : Opens.IsBasis X.affineOpens := by |
rw [Opens.isBasis_iff_nbhd]
rintro U x (hU : x ∈ (U : Set X))
obtain ⟨S, hS, hxS, hSU⟩ := X.affineBasisCover_is_basis.exists_subset_of_mem_open hU U.isOpen
refine ⟨⟨S, X.affineBasisCover_is_basis.isOpen hS⟩, ?_, hxS, hSU⟩
rcases hS with ⟨i, rfl⟩
exact rangeIsAffineOpenOfOpenImmersion _
| 403 |
import Mathlib.AlgebraicGeometry.GammaSpecAdjunction
import Mathlib.AlgebraicGeometry.Restrict
import Mathlib.CategoryTheory.Limits.Opposites
import Mathlib.RingTheory.Localization.InvSubmonoid
#align_import algebraic_geometry.AffineScheme from "leanprover-community/mathlib"@"88474d1b5af6d37c2ab728b757771bced7f5194c"
-- Explicit universe annotations were used in this file to improve perfomance #12737
set_option linter.uppercaseLean3 false
noncomputable section
open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace
universe u
namespace AlgebraicGeometry
open Spec (structureSheaf)
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
def AffineScheme :=
Scheme.Spec.EssImageSubcategory
deriving Category
#align algebraic_geometry.AffineScheme AlgebraicGeometry.AffineScheme
class IsAffine (X : Scheme) : Prop where
affine : IsIso (ΓSpec.adjunction.unit.app X)
#align algebraic_geometry.is_affine AlgebraicGeometry.IsAffine
attribute [instance] IsAffine.affine
def Scheme.isoSpec (X : Scheme) [IsAffine X] : X ≅ Scheme.Spec.obj (op <| Scheme.Γ.obj <| op X) :=
asIso (ΓSpec.adjunction.unit.app X)
#align algebraic_geometry.Scheme.iso_Spec AlgebraicGeometry.Scheme.isoSpec
@[simps]
def AffineScheme.mk (X : Scheme) (_ : IsAffine X) : AffineScheme :=
⟨X, mem_essImage_of_unit_isIso (adj := ΓSpec.adjunction) _⟩
#align algebraic_geometry.AffineScheme.mk AlgebraicGeometry.AffineScheme.mk
def AffineScheme.of (X : Scheme) [h : IsAffine X] : AffineScheme :=
AffineScheme.mk X h
#align algebraic_geometry.AffineScheme.of AlgebraicGeometry.AffineScheme.of
def AffineScheme.ofHom {X Y : Scheme} [IsAffine X] [IsAffine Y] (f : X ⟶ Y) :
AffineScheme.of X ⟶ AffineScheme.of Y :=
f
#align algebraic_geometry.AffineScheme.of_hom AlgebraicGeometry.AffineScheme.ofHom
theorem mem_Spec_essImage (X : Scheme) : X ∈ Scheme.Spec.essImage ↔ IsAffine X :=
⟨fun h => ⟨Functor.essImage.unit_isIso h⟩,
fun _ => mem_essImage_of_unit_isIso (adj := ΓSpec.adjunction) _⟩
#align algebraic_geometry.mem_Spec_ess_image AlgebraicGeometry.mem_Spec_essImage
instance isAffineAffineScheme (X : AffineScheme.{u}) : IsAffine X.obj :=
⟨Functor.essImage.unit_isIso X.property⟩
#align algebraic_geometry.is_affine_AffineScheme AlgebraicGeometry.isAffineAffineScheme
instance SpecIsAffine (R : CommRingCatᵒᵖ) : IsAffine (Scheme.Spec.obj R) :=
AlgebraicGeometry.isAffineAffineScheme ⟨_, Scheme.Spec.obj_mem_essImage R⟩
#align algebraic_geometry.Spec_is_affine AlgebraicGeometry.SpecIsAffine
theorem isAffineOfIso {X Y : Scheme} (f : X ⟶ Y) [IsIso f] [h : IsAffine Y] : IsAffine X := by
rw [← mem_Spec_essImage] at h ⊢; exact Functor.essImage.ofIso (asIso f).symm h
#align algebraic_geometry.is_affine_of_iso AlgebraicGeometry.isAffineOfIso
def IsAffineOpen {X : Scheme} (U : Opens X) : Prop :=
IsAffine (X ∣_ᵤ U)
#align algebraic_geometry.is_affine_open AlgebraicGeometry.IsAffineOpen
def Scheme.affineOpens (X : Scheme) : Set (Opens X) :=
{U : Opens X | IsAffineOpen U}
#align algebraic_geometry.Scheme.affine_opens AlgebraicGeometry.Scheme.affineOpens
instance {Y : Scheme.{u}} (U : Y.affineOpens) :
IsAffine (Scheme.restrict Y <| Opens.openEmbedding U.val) :=
U.property
theorem rangeIsAffineOpenOfOpenImmersion {X Y : Scheme} [IsAffine X] (f : X ⟶ Y)
[H : IsOpenImmersion f] : IsAffineOpen (Scheme.Hom.opensRange f) := by
refine isAffineOfIso (IsOpenImmersion.isoOfRangeEq f (Y.ofRestrict _) ?_).inv
exact Subtype.range_val.symm
#align algebraic_geometry.range_is_affine_open_of_open_immersion AlgebraicGeometry.rangeIsAffineOpenOfOpenImmersion
theorem topIsAffineOpen (X : Scheme) [IsAffine X] : IsAffineOpen (⊤ : Opens X) := by
convert rangeIsAffineOpenOfOpenImmersion (𝟙 X)
ext1
exact Set.range_id.symm
#align algebraic_geometry.top_is_affine_open AlgebraicGeometry.topIsAffineOpen
instance Scheme.affineCoverIsAffine (X : Scheme) (i : X.affineCover.J) :
IsAffine (X.affineCover.obj i) :=
AlgebraicGeometry.SpecIsAffine _
#align algebraic_geometry.Scheme.affine_cover_is_affine AlgebraicGeometry.Scheme.affineCoverIsAffine
instance Scheme.affineBasisCoverIsAffine (X : Scheme) (i : X.affineBasisCover.J) :
IsAffine (X.affineBasisCover.obj i) :=
AlgebraicGeometry.SpecIsAffine _
#align algebraic_geometry.Scheme.affine_basis_cover_is_affine AlgebraicGeometry.Scheme.affineBasisCoverIsAffine
theorem isBasis_affine_open (X : Scheme) : Opens.IsBasis X.affineOpens := by
rw [Opens.isBasis_iff_nbhd]
rintro U x (hU : x ∈ (U : Set X))
obtain ⟨S, hS, hxS, hSU⟩ := X.affineBasisCover_is_basis.exists_subset_of_mem_open hU U.isOpen
refine ⟨⟨S, X.affineBasisCover_is_basis.isOpen hS⟩, ?_, hxS, hSU⟩
rcases hS with ⟨i, rfl⟩
exact rangeIsAffineOpenOfOpenImmersion _
#align algebraic_geometry.is_basis_affine_open AlgebraicGeometry.isBasis_affine_open
| Mathlib/AlgebraicGeometry/AffineScheme.lean | 218 | 234 | theorem Scheme.map_PrimeSpectrum_basicOpen_of_affine
(X : Scheme) [IsAffine X] (f : Scheme.Γ.obj (op X)) :
X.isoSpec.hom ⁻¹ᵁ PrimeSpectrum.basicOpen f = X.basicOpen f := by |
rw [← basicOpen_eq_of_affine]
trans
X.isoSpec.hom ⁻¹ᵁ (Scheme.Spec.obj (op (Scheme.Γ.obj (op X)))).basicOpen
((inv (X.isoSpec.hom.1.c.app (op ((Opens.map (inv X.isoSpec.hom).val.base).obj ⊤)))) f)
· congr
rw [← IsIso.inv_eq_inv, IsIso.inv_inv, IsIso.Iso.inv_inv, NatIso.app_hom]
-- Porting note: added this `change` to prevent timeout
change SpecΓIdentity.hom.app (X.presheaf.obj <| op ⊤) = _
rw [← ΓSpec.adjunction_unit_app_app_top X]
rfl
· dsimp
refine (Scheme.preimage_basicOpen _ _).trans ?_
congr 1
exact IsIso.inv_hom_id_apply _ _
| 403 |
import Mathlib.AlgebraicGeometry.Gluing
import Mathlib.CategoryTheory.Limits.Opposites
import Mathlib.AlgebraicGeometry.AffineScheme
import Mathlib.CategoryTheory.Limits.Shapes.Diagonal
#align_import algebraic_geometry.pullbacks from "leanprover-community/mathlib"@"7316286ff2942aa14e540add9058c6b0aa1c8070"
set_option linter.uppercaseLean3 false
universe v u
noncomputable section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry
namespace AlgebraicGeometry.Scheme
namespace Pullback
variable {C : Type u} [Category.{v} C]
variable {X Y Z : Scheme.{u}} (𝒰 : OpenCover.{u} X) (f : X ⟶ Z) (g : Y ⟶ Z)
variable [∀ i, HasPullback (𝒰.map i ≫ f) g]
def v (i j : 𝒰.J) : Scheme :=
pullback ((pullback.fst : pullback (𝒰.map i ≫ f) g ⟶ _) ≫ 𝒰.map i) (𝒰.map j)
#align algebraic_geometry.Scheme.pullback.V AlgebraicGeometry.Scheme.Pullback.v
def t (i j : 𝒰.J) : v 𝒰 f g i j ⟶ v 𝒰 f g j i := by
have : HasPullback (pullback.snd ≫ 𝒰.map i ≫ f) g :=
hasPullback_assoc_symm (𝒰.map j) (𝒰.map i) (𝒰.map i ≫ f) g
have : HasPullback (pullback.snd ≫ 𝒰.map j ≫ f) g :=
hasPullback_assoc_symm (𝒰.map i) (𝒰.map j) (𝒰.map j ≫ f) g
refine (pullbackSymmetry ..).hom ≫ (pullbackAssoc ..).inv ≫ ?_
refine ?_ ≫ (pullbackAssoc ..).hom ≫ (pullbackSymmetry ..).hom
refine pullback.map _ _ _ _ (pullbackSymmetry _ _).hom (𝟙 _) (𝟙 _) ?_ ?_
· rw [pullbackSymmetry_hom_comp_snd_assoc, pullback.condition_assoc, Category.comp_id]
· rw [Category.comp_id, Category.id_comp]
#align algebraic_geometry.Scheme.pullback.t AlgebraicGeometry.Scheme.Pullback.t
@[simp, reassoc]
| Mathlib/AlgebraicGeometry/Pullbacks.lean | 64 | 67 | theorem t_fst_fst (i j : 𝒰.J) : t 𝒰 f g i j ≫ pullback.fst ≫ pullback.fst = pullback.snd := by |
simp only [t, Category.assoc, pullbackSymmetry_hom_comp_fst_assoc, pullbackAssoc_hom_snd_fst,
pullback.lift_fst_assoc, pullbackSymmetry_hom_comp_snd, pullbackAssoc_inv_fst_fst,
pullbackSymmetry_hom_comp_fst]
| 404 |
import Mathlib.AlgebraicGeometry.Gluing
import Mathlib.CategoryTheory.Limits.Opposites
import Mathlib.AlgebraicGeometry.AffineScheme
import Mathlib.CategoryTheory.Limits.Shapes.Diagonal
#align_import algebraic_geometry.pullbacks from "leanprover-community/mathlib"@"7316286ff2942aa14e540add9058c6b0aa1c8070"
set_option linter.uppercaseLean3 false
universe v u
noncomputable section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry
namespace AlgebraicGeometry.Scheme
namespace Pullback
variable {C : Type u} [Category.{v} C]
variable {X Y Z : Scheme.{u}} (𝒰 : OpenCover.{u} X) (f : X ⟶ Z) (g : Y ⟶ Z)
variable [∀ i, HasPullback (𝒰.map i ≫ f) g]
def v (i j : 𝒰.J) : Scheme :=
pullback ((pullback.fst : pullback (𝒰.map i ≫ f) g ⟶ _) ≫ 𝒰.map i) (𝒰.map j)
#align algebraic_geometry.Scheme.pullback.V AlgebraicGeometry.Scheme.Pullback.v
def t (i j : 𝒰.J) : v 𝒰 f g i j ⟶ v 𝒰 f g j i := by
have : HasPullback (pullback.snd ≫ 𝒰.map i ≫ f) g :=
hasPullback_assoc_symm (𝒰.map j) (𝒰.map i) (𝒰.map i ≫ f) g
have : HasPullback (pullback.snd ≫ 𝒰.map j ≫ f) g :=
hasPullback_assoc_symm (𝒰.map i) (𝒰.map j) (𝒰.map j ≫ f) g
refine (pullbackSymmetry ..).hom ≫ (pullbackAssoc ..).inv ≫ ?_
refine ?_ ≫ (pullbackAssoc ..).hom ≫ (pullbackSymmetry ..).hom
refine pullback.map _ _ _ _ (pullbackSymmetry _ _).hom (𝟙 _) (𝟙 _) ?_ ?_
· rw [pullbackSymmetry_hom_comp_snd_assoc, pullback.condition_assoc, Category.comp_id]
· rw [Category.comp_id, Category.id_comp]
#align algebraic_geometry.Scheme.pullback.t AlgebraicGeometry.Scheme.Pullback.t
@[simp, reassoc]
theorem t_fst_fst (i j : 𝒰.J) : t 𝒰 f g i j ≫ pullback.fst ≫ pullback.fst = pullback.snd := by
simp only [t, Category.assoc, pullbackSymmetry_hom_comp_fst_assoc, pullbackAssoc_hom_snd_fst,
pullback.lift_fst_assoc, pullbackSymmetry_hom_comp_snd, pullbackAssoc_inv_fst_fst,
pullbackSymmetry_hom_comp_fst]
#align algebraic_geometry.Scheme.pullback.t_fst_fst AlgebraicGeometry.Scheme.Pullback.t_fst_fst
@[simp, reassoc]
| Mathlib/AlgebraicGeometry/Pullbacks.lean | 71 | 74 | theorem t_fst_snd (i j : 𝒰.J) :
t 𝒰 f g i j ≫ pullback.fst ≫ pullback.snd = pullback.fst ≫ pullback.snd := by |
simp only [t, Category.assoc, pullbackSymmetry_hom_comp_fst_assoc, pullbackAssoc_hom_snd_snd,
pullback.lift_snd, Category.comp_id, pullbackAssoc_inv_snd, pullbackSymmetry_hom_comp_snd_assoc]
| 404 |
import Mathlib.AlgebraicGeometry.Gluing
import Mathlib.CategoryTheory.Limits.Opposites
import Mathlib.AlgebraicGeometry.AffineScheme
import Mathlib.CategoryTheory.Limits.Shapes.Diagonal
#align_import algebraic_geometry.pullbacks from "leanprover-community/mathlib"@"7316286ff2942aa14e540add9058c6b0aa1c8070"
set_option linter.uppercaseLean3 false
universe v u
noncomputable section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry
namespace AlgebraicGeometry.Scheme
namespace Pullback
variable {C : Type u} [Category.{v} C]
variable {X Y Z : Scheme.{u}} (𝒰 : OpenCover.{u} X) (f : X ⟶ Z) (g : Y ⟶ Z)
variable [∀ i, HasPullback (𝒰.map i ≫ f) g]
def v (i j : 𝒰.J) : Scheme :=
pullback ((pullback.fst : pullback (𝒰.map i ≫ f) g ⟶ _) ≫ 𝒰.map i) (𝒰.map j)
#align algebraic_geometry.Scheme.pullback.V AlgebraicGeometry.Scheme.Pullback.v
def t (i j : 𝒰.J) : v 𝒰 f g i j ⟶ v 𝒰 f g j i := by
have : HasPullback (pullback.snd ≫ 𝒰.map i ≫ f) g :=
hasPullback_assoc_symm (𝒰.map j) (𝒰.map i) (𝒰.map i ≫ f) g
have : HasPullback (pullback.snd ≫ 𝒰.map j ≫ f) g :=
hasPullback_assoc_symm (𝒰.map i) (𝒰.map j) (𝒰.map j ≫ f) g
refine (pullbackSymmetry ..).hom ≫ (pullbackAssoc ..).inv ≫ ?_
refine ?_ ≫ (pullbackAssoc ..).hom ≫ (pullbackSymmetry ..).hom
refine pullback.map _ _ _ _ (pullbackSymmetry _ _).hom (𝟙 _) (𝟙 _) ?_ ?_
· rw [pullbackSymmetry_hom_comp_snd_assoc, pullback.condition_assoc, Category.comp_id]
· rw [Category.comp_id, Category.id_comp]
#align algebraic_geometry.Scheme.pullback.t AlgebraicGeometry.Scheme.Pullback.t
@[simp, reassoc]
theorem t_fst_fst (i j : 𝒰.J) : t 𝒰 f g i j ≫ pullback.fst ≫ pullback.fst = pullback.snd := by
simp only [t, Category.assoc, pullbackSymmetry_hom_comp_fst_assoc, pullbackAssoc_hom_snd_fst,
pullback.lift_fst_assoc, pullbackSymmetry_hom_comp_snd, pullbackAssoc_inv_fst_fst,
pullbackSymmetry_hom_comp_fst]
#align algebraic_geometry.Scheme.pullback.t_fst_fst AlgebraicGeometry.Scheme.Pullback.t_fst_fst
@[simp, reassoc]
theorem t_fst_snd (i j : 𝒰.J) :
t 𝒰 f g i j ≫ pullback.fst ≫ pullback.snd = pullback.fst ≫ pullback.snd := by
simp only [t, Category.assoc, pullbackSymmetry_hom_comp_fst_assoc, pullbackAssoc_hom_snd_snd,
pullback.lift_snd, Category.comp_id, pullbackAssoc_inv_snd, pullbackSymmetry_hom_comp_snd_assoc]
#align algebraic_geometry.Scheme.pullback.t_fst_snd AlgebraicGeometry.Scheme.Pullback.t_fst_snd
@[simp, reassoc]
| Mathlib/AlgebraicGeometry/Pullbacks.lean | 78 | 81 | theorem t_snd (i j : 𝒰.J) : t 𝒰 f g i j ≫ pullback.snd = pullback.fst ≫ pullback.fst := by |
simp only [t, Category.assoc, pullbackSymmetry_hom_comp_snd, pullbackAssoc_hom_fst,
pullback.lift_fst_assoc, pullbackSymmetry_hom_comp_fst, pullbackAssoc_inv_fst_snd,
pullbackSymmetry_hom_comp_snd_assoc]
| 404 |
import Mathlib.AlgebraicGeometry.Gluing
import Mathlib.CategoryTheory.Limits.Opposites
import Mathlib.AlgebraicGeometry.AffineScheme
import Mathlib.CategoryTheory.Limits.Shapes.Diagonal
#align_import algebraic_geometry.pullbacks from "leanprover-community/mathlib"@"7316286ff2942aa14e540add9058c6b0aa1c8070"
set_option linter.uppercaseLean3 false
universe v u
noncomputable section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry
namespace AlgebraicGeometry.Scheme
namespace Pullback
variable {C : Type u} [Category.{v} C]
variable {X Y Z : Scheme.{u}} (𝒰 : OpenCover.{u} X) (f : X ⟶ Z) (g : Y ⟶ Z)
variable [∀ i, HasPullback (𝒰.map i ≫ f) g]
def v (i j : 𝒰.J) : Scheme :=
pullback ((pullback.fst : pullback (𝒰.map i ≫ f) g ⟶ _) ≫ 𝒰.map i) (𝒰.map j)
#align algebraic_geometry.Scheme.pullback.V AlgebraicGeometry.Scheme.Pullback.v
def t (i j : 𝒰.J) : v 𝒰 f g i j ⟶ v 𝒰 f g j i := by
have : HasPullback (pullback.snd ≫ 𝒰.map i ≫ f) g :=
hasPullback_assoc_symm (𝒰.map j) (𝒰.map i) (𝒰.map i ≫ f) g
have : HasPullback (pullback.snd ≫ 𝒰.map j ≫ f) g :=
hasPullback_assoc_symm (𝒰.map i) (𝒰.map j) (𝒰.map j ≫ f) g
refine (pullbackSymmetry ..).hom ≫ (pullbackAssoc ..).inv ≫ ?_
refine ?_ ≫ (pullbackAssoc ..).hom ≫ (pullbackSymmetry ..).hom
refine pullback.map _ _ _ _ (pullbackSymmetry _ _).hom (𝟙 _) (𝟙 _) ?_ ?_
· rw [pullbackSymmetry_hom_comp_snd_assoc, pullback.condition_assoc, Category.comp_id]
· rw [Category.comp_id, Category.id_comp]
#align algebraic_geometry.Scheme.pullback.t AlgebraicGeometry.Scheme.Pullback.t
@[simp, reassoc]
theorem t_fst_fst (i j : 𝒰.J) : t 𝒰 f g i j ≫ pullback.fst ≫ pullback.fst = pullback.snd := by
simp only [t, Category.assoc, pullbackSymmetry_hom_comp_fst_assoc, pullbackAssoc_hom_snd_fst,
pullback.lift_fst_assoc, pullbackSymmetry_hom_comp_snd, pullbackAssoc_inv_fst_fst,
pullbackSymmetry_hom_comp_fst]
#align algebraic_geometry.Scheme.pullback.t_fst_fst AlgebraicGeometry.Scheme.Pullback.t_fst_fst
@[simp, reassoc]
theorem t_fst_snd (i j : 𝒰.J) :
t 𝒰 f g i j ≫ pullback.fst ≫ pullback.snd = pullback.fst ≫ pullback.snd := by
simp only [t, Category.assoc, pullbackSymmetry_hom_comp_fst_assoc, pullbackAssoc_hom_snd_snd,
pullback.lift_snd, Category.comp_id, pullbackAssoc_inv_snd, pullbackSymmetry_hom_comp_snd_assoc]
#align algebraic_geometry.Scheme.pullback.t_fst_snd AlgebraicGeometry.Scheme.Pullback.t_fst_snd
@[simp, reassoc]
theorem t_snd (i j : 𝒰.J) : t 𝒰 f g i j ≫ pullback.snd = pullback.fst ≫ pullback.fst := by
simp only [t, Category.assoc, pullbackSymmetry_hom_comp_snd, pullbackAssoc_hom_fst,
pullback.lift_fst_assoc, pullbackSymmetry_hom_comp_fst, pullbackAssoc_inv_fst_snd,
pullbackSymmetry_hom_comp_snd_assoc]
#align algebraic_geometry.Scheme.pullback.t_snd AlgebraicGeometry.Scheme.Pullback.t_snd
| Mathlib/AlgebraicGeometry/Pullbacks.lean | 84 | 89 | theorem t_id (i : 𝒰.J) : t 𝒰 f g i i = 𝟙 _ := by |
apply pullback.hom_ext <;> rw [Category.id_comp]
· apply pullback.hom_ext
· rw [← cancel_mono (𝒰.map i)]; simp only [pullback.condition, Category.assoc, t_fst_fst]
· simp only [Category.assoc, t_fst_snd]
· rw [← cancel_mono (𝒰.map i)]; simp only [pullback.condition, t_snd, Category.assoc]
| 404 |
import Mathlib.AlgebraicGeometry.Gluing
import Mathlib.CategoryTheory.Limits.Opposites
import Mathlib.AlgebraicGeometry.AffineScheme
import Mathlib.CategoryTheory.Limits.Shapes.Diagonal
#align_import algebraic_geometry.pullbacks from "leanprover-community/mathlib"@"7316286ff2942aa14e540add9058c6b0aa1c8070"
set_option linter.uppercaseLean3 false
universe v u
noncomputable section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry
namespace AlgebraicGeometry.Scheme
namespace Pullback
variable {C : Type u} [Category.{v} C]
variable {X Y Z : Scheme.{u}} (𝒰 : OpenCover.{u} X) (f : X ⟶ Z) (g : Y ⟶ Z)
variable [∀ i, HasPullback (𝒰.map i ≫ f) g]
def v (i j : 𝒰.J) : Scheme :=
pullback ((pullback.fst : pullback (𝒰.map i ≫ f) g ⟶ _) ≫ 𝒰.map i) (𝒰.map j)
#align algebraic_geometry.Scheme.pullback.V AlgebraicGeometry.Scheme.Pullback.v
def t (i j : 𝒰.J) : v 𝒰 f g i j ⟶ v 𝒰 f g j i := by
have : HasPullback (pullback.snd ≫ 𝒰.map i ≫ f) g :=
hasPullback_assoc_symm (𝒰.map j) (𝒰.map i) (𝒰.map i ≫ f) g
have : HasPullback (pullback.snd ≫ 𝒰.map j ≫ f) g :=
hasPullback_assoc_symm (𝒰.map i) (𝒰.map j) (𝒰.map j ≫ f) g
refine (pullbackSymmetry ..).hom ≫ (pullbackAssoc ..).inv ≫ ?_
refine ?_ ≫ (pullbackAssoc ..).hom ≫ (pullbackSymmetry ..).hom
refine pullback.map _ _ _ _ (pullbackSymmetry _ _).hom (𝟙 _) (𝟙 _) ?_ ?_
· rw [pullbackSymmetry_hom_comp_snd_assoc, pullback.condition_assoc, Category.comp_id]
· rw [Category.comp_id, Category.id_comp]
#align algebraic_geometry.Scheme.pullback.t AlgebraicGeometry.Scheme.Pullback.t
@[simp, reassoc]
theorem t_fst_fst (i j : 𝒰.J) : t 𝒰 f g i j ≫ pullback.fst ≫ pullback.fst = pullback.snd := by
simp only [t, Category.assoc, pullbackSymmetry_hom_comp_fst_assoc, pullbackAssoc_hom_snd_fst,
pullback.lift_fst_assoc, pullbackSymmetry_hom_comp_snd, pullbackAssoc_inv_fst_fst,
pullbackSymmetry_hom_comp_fst]
#align algebraic_geometry.Scheme.pullback.t_fst_fst AlgebraicGeometry.Scheme.Pullback.t_fst_fst
@[simp, reassoc]
theorem t_fst_snd (i j : 𝒰.J) :
t 𝒰 f g i j ≫ pullback.fst ≫ pullback.snd = pullback.fst ≫ pullback.snd := by
simp only [t, Category.assoc, pullbackSymmetry_hom_comp_fst_assoc, pullbackAssoc_hom_snd_snd,
pullback.lift_snd, Category.comp_id, pullbackAssoc_inv_snd, pullbackSymmetry_hom_comp_snd_assoc]
#align algebraic_geometry.Scheme.pullback.t_fst_snd AlgebraicGeometry.Scheme.Pullback.t_fst_snd
@[simp, reassoc]
theorem t_snd (i j : 𝒰.J) : t 𝒰 f g i j ≫ pullback.snd = pullback.fst ≫ pullback.fst := by
simp only [t, Category.assoc, pullbackSymmetry_hom_comp_snd, pullbackAssoc_hom_fst,
pullback.lift_fst_assoc, pullbackSymmetry_hom_comp_fst, pullbackAssoc_inv_fst_snd,
pullbackSymmetry_hom_comp_snd_assoc]
#align algebraic_geometry.Scheme.pullback.t_snd AlgebraicGeometry.Scheme.Pullback.t_snd
theorem t_id (i : 𝒰.J) : t 𝒰 f g i i = 𝟙 _ := by
apply pullback.hom_ext <;> rw [Category.id_comp]
· apply pullback.hom_ext
· rw [← cancel_mono (𝒰.map i)]; simp only [pullback.condition, Category.assoc, t_fst_fst]
· simp only [Category.assoc, t_fst_snd]
· rw [← cancel_mono (𝒰.map i)]; simp only [pullback.condition, t_snd, Category.assoc]
#align algebraic_geometry.Scheme.pullback.t_id AlgebraicGeometry.Scheme.Pullback.t_id
abbrev fV (i j : 𝒰.J) : v 𝒰 f g i j ⟶ pullback (𝒰.map i ≫ f) g :=
pullback.fst
#align algebraic_geometry.Scheme.pullback.fV AlgebraicGeometry.Scheme.Pullback.fV
def t' (i j k : 𝒰.J) :
pullback (fV 𝒰 f g i j) (fV 𝒰 f g i k) ⟶ pullback (fV 𝒰 f g j k) (fV 𝒰 f g j i) := by
refine (pullbackRightPullbackFstIso ..).hom ≫ ?_
refine ?_ ≫ (pullbackSymmetry _ _).hom
refine ?_ ≫ (pullbackRightPullbackFstIso ..).inv
refine pullback.map _ _ _ _ (t 𝒰 f g i j) (𝟙 _) (𝟙 _) ?_ ?_
· simp_rw [Category.comp_id, t_fst_fst_assoc, ← pullback.condition]
· rw [Category.comp_id, Category.id_comp]
#align algebraic_geometry.Scheme.pullback.t' AlgebraicGeometry.Scheme.Pullback.t'
@[simp, reassoc]
| Mathlib/AlgebraicGeometry/Pullbacks.lean | 110 | 114 | theorem t'_fst_fst_fst (i j k : 𝒰.J) :
t' 𝒰 f g i j k ≫ pullback.fst ≫ pullback.fst ≫ pullback.fst = pullback.fst ≫ pullback.snd := by |
simp only [t', Category.assoc, pullbackSymmetry_hom_comp_fst_assoc,
pullbackRightPullbackFstIso_inv_snd_fst_assoc, pullback.lift_fst_assoc, t_fst_fst,
pullbackRightPullbackFstIso_hom_fst_assoc]
| 404 |
import Mathlib.AlgebraicGeometry.Gluing
import Mathlib.CategoryTheory.Limits.Opposites
import Mathlib.AlgebraicGeometry.AffineScheme
import Mathlib.CategoryTheory.Limits.Shapes.Diagonal
#align_import algebraic_geometry.pullbacks from "leanprover-community/mathlib"@"7316286ff2942aa14e540add9058c6b0aa1c8070"
set_option linter.uppercaseLean3 false
universe v u
noncomputable section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry
namespace AlgebraicGeometry.Scheme
namespace Pullback
variable {C : Type u} [Category.{v} C]
variable {X Y Z : Scheme.{u}} (𝒰 : OpenCover.{u} X) (f : X ⟶ Z) (g : Y ⟶ Z)
variable [∀ i, HasPullback (𝒰.map i ≫ f) g]
def v (i j : 𝒰.J) : Scheme :=
pullback ((pullback.fst : pullback (𝒰.map i ≫ f) g ⟶ _) ≫ 𝒰.map i) (𝒰.map j)
#align algebraic_geometry.Scheme.pullback.V AlgebraicGeometry.Scheme.Pullback.v
def t (i j : 𝒰.J) : v 𝒰 f g i j ⟶ v 𝒰 f g j i := by
have : HasPullback (pullback.snd ≫ 𝒰.map i ≫ f) g :=
hasPullback_assoc_symm (𝒰.map j) (𝒰.map i) (𝒰.map i ≫ f) g
have : HasPullback (pullback.snd ≫ 𝒰.map j ≫ f) g :=
hasPullback_assoc_symm (𝒰.map i) (𝒰.map j) (𝒰.map j ≫ f) g
refine (pullbackSymmetry ..).hom ≫ (pullbackAssoc ..).inv ≫ ?_
refine ?_ ≫ (pullbackAssoc ..).hom ≫ (pullbackSymmetry ..).hom
refine pullback.map _ _ _ _ (pullbackSymmetry _ _).hom (𝟙 _) (𝟙 _) ?_ ?_
· rw [pullbackSymmetry_hom_comp_snd_assoc, pullback.condition_assoc, Category.comp_id]
· rw [Category.comp_id, Category.id_comp]
#align algebraic_geometry.Scheme.pullback.t AlgebraicGeometry.Scheme.Pullback.t
@[simp, reassoc]
theorem t_fst_fst (i j : 𝒰.J) : t 𝒰 f g i j ≫ pullback.fst ≫ pullback.fst = pullback.snd := by
simp only [t, Category.assoc, pullbackSymmetry_hom_comp_fst_assoc, pullbackAssoc_hom_snd_fst,
pullback.lift_fst_assoc, pullbackSymmetry_hom_comp_snd, pullbackAssoc_inv_fst_fst,
pullbackSymmetry_hom_comp_fst]
#align algebraic_geometry.Scheme.pullback.t_fst_fst AlgebraicGeometry.Scheme.Pullback.t_fst_fst
@[simp, reassoc]
theorem t_fst_snd (i j : 𝒰.J) :
t 𝒰 f g i j ≫ pullback.fst ≫ pullback.snd = pullback.fst ≫ pullback.snd := by
simp only [t, Category.assoc, pullbackSymmetry_hom_comp_fst_assoc, pullbackAssoc_hom_snd_snd,
pullback.lift_snd, Category.comp_id, pullbackAssoc_inv_snd, pullbackSymmetry_hom_comp_snd_assoc]
#align algebraic_geometry.Scheme.pullback.t_fst_snd AlgebraicGeometry.Scheme.Pullback.t_fst_snd
@[simp, reassoc]
theorem t_snd (i j : 𝒰.J) : t 𝒰 f g i j ≫ pullback.snd = pullback.fst ≫ pullback.fst := by
simp only [t, Category.assoc, pullbackSymmetry_hom_comp_snd, pullbackAssoc_hom_fst,
pullback.lift_fst_assoc, pullbackSymmetry_hom_comp_fst, pullbackAssoc_inv_fst_snd,
pullbackSymmetry_hom_comp_snd_assoc]
#align algebraic_geometry.Scheme.pullback.t_snd AlgebraicGeometry.Scheme.Pullback.t_snd
theorem t_id (i : 𝒰.J) : t 𝒰 f g i i = 𝟙 _ := by
apply pullback.hom_ext <;> rw [Category.id_comp]
· apply pullback.hom_ext
· rw [← cancel_mono (𝒰.map i)]; simp only [pullback.condition, Category.assoc, t_fst_fst]
· simp only [Category.assoc, t_fst_snd]
· rw [← cancel_mono (𝒰.map i)]; simp only [pullback.condition, t_snd, Category.assoc]
#align algebraic_geometry.Scheme.pullback.t_id AlgebraicGeometry.Scheme.Pullback.t_id
abbrev fV (i j : 𝒰.J) : v 𝒰 f g i j ⟶ pullback (𝒰.map i ≫ f) g :=
pullback.fst
#align algebraic_geometry.Scheme.pullback.fV AlgebraicGeometry.Scheme.Pullback.fV
def t' (i j k : 𝒰.J) :
pullback (fV 𝒰 f g i j) (fV 𝒰 f g i k) ⟶ pullback (fV 𝒰 f g j k) (fV 𝒰 f g j i) := by
refine (pullbackRightPullbackFstIso ..).hom ≫ ?_
refine ?_ ≫ (pullbackSymmetry _ _).hom
refine ?_ ≫ (pullbackRightPullbackFstIso ..).inv
refine pullback.map _ _ _ _ (t 𝒰 f g i j) (𝟙 _) (𝟙 _) ?_ ?_
· simp_rw [Category.comp_id, t_fst_fst_assoc, ← pullback.condition]
· rw [Category.comp_id, Category.id_comp]
#align algebraic_geometry.Scheme.pullback.t' AlgebraicGeometry.Scheme.Pullback.t'
@[simp, reassoc]
theorem t'_fst_fst_fst (i j k : 𝒰.J) :
t' 𝒰 f g i j k ≫ pullback.fst ≫ pullback.fst ≫ pullback.fst = pullback.fst ≫ pullback.snd := by
simp only [t', Category.assoc, pullbackSymmetry_hom_comp_fst_assoc,
pullbackRightPullbackFstIso_inv_snd_fst_assoc, pullback.lift_fst_assoc, t_fst_fst,
pullbackRightPullbackFstIso_hom_fst_assoc]
#align algebraic_geometry.Scheme.pullback.t'_fst_fst_fst AlgebraicGeometry.Scheme.Pullback.t'_fst_fst_fst
@[simp, reassoc]
| Mathlib/AlgebraicGeometry/Pullbacks.lean | 118 | 123 | theorem t'_fst_fst_snd (i j k : 𝒰.J) :
t' 𝒰 f g i j k ≫ pullback.fst ≫ pullback.fst ≫ pullback.snd =
pullback.fst ≫ pullback.fst ≫ pullback.snd := by |
simp only [t', Category.assoc, pullbackSymmetry_hom_comp_fst_assoc,
pullbackRightPullbackFstIso_inv_snd_fst_assoc, pullback.lift_fst_assoc, t_fst_snd,
pullbackRightPullbackFstIso_hom_fst_assoc]
| 404 |
import Mathlib.AlgebraicGeometry.Pullbacks
import Mathlib.AlgebraicGeometry.AffineScheme
#align_import algebraic_geometry.limits from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
suppress_compilation
set_option linter.uppercaseLean3 false
universe u
open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace
namespace AlgebraicGeometry
noncomputable def specZIsTerminal : IsTerminal (Scheme.Spec.obj (op <| CommRingCat.of ℤ)) :=
@IsTerminal.isTerminalObj _ _ _ _ Scheme.Spec _ inferInstance
(terminalOpOfInitial CommRingCat.zIsInitial)
#align algebraic_geometry.Spec_Z_is_terminal AlgebraicGeometry.specZIsTerminal
instance : HasTerminal Scheme :=
hasTerminal_of_hasTerminal_of_preservesLimit Scheme.Spec
instance : IsAffine (⊤_ Scheme.{u}) :=
isAffineOfIso (PreservesTerminal.iso Scheme.Spec).inv
instance : HasFiniteLimits Scheme :=
hasFiniteLimits_of_hasTerminal_and_pullbacks
section Initial
@[simps]
def Scheme.emptyTo (X : Scheme.{u}) : ∅ ⟶ X :=
⟨{ base := ⟨fun x => PEmpty.elim x, by continuity⟩
c := { app := fun U => CommRingCat.punitIsTerminal.from _ } }, fun x => PEmpty.elim x⟩
#align algebraic_geometry.Scheme.empty_to AlgebraicGeometry.Scheme.emptyTo
@[ext]
theorem Scheme.empty_ext {X : Scheme.{u}} (f g : ∅ ⟶ X) : f = g :=
-- Porting note: `ext` regression
-- see https://github.com/leanprover-community/mathlib4/issues/5229
LocallyRingedSpace.Hom.ext _ _ <| PresheafedSpace.ext _ _ (by ext a; exact PEmpty.elim a) <|
NatTrans.ext _ _ <| funext fun a => by aesop_cat
#align algebraic_geometry.Scheme.empty_ext AlgebraicGeometry.Scheme.empty_ext
theorem Scheme.eq_emptyTo {X : Scheme.{u}} (f : ∅ ⟶ X) : f = Scheme.emptyTo X :=
Scheme.empty_ext f (Scheme.emptyTo X)
#align algebraic_geometry.Scheme.eq_empty_to AlgebraicGeometry.Scheme.eq_emptyTo
instance Scheme.hom_unique_of_empty_source (X : Scheme.{u}) : Unique (∅ ⟶ X) :=
⟨⟨Scheme.emptyTo _⟩, fun _ => Scheme.empty_ext _ _⟩
def emptyIsInitial : IsInitial (∅ : Scheme.{u}) :=
IsInitial.ofUnique _
#align algebraic_geometry.empty_is_initial AlgebraicGeometry.emptyIsInitial
@[simp]
theorem emptyIsInitial_to : emptyIsInitial.to = Scheme.emptyTo :=
rfl
#align algebraic_geometry.empty_is_initial_to AlgebraicGeometry.emptyIsInitial_to
instance : IsEmpty Scheme.empty.carrier :=
show IsEmpty PEmpty by infer_instance
instance spec_punit_isEmpty : IsEmpty (Scheme.Spec.obj (op <| CommRingCat.of PUnit)).carrier :=
inferInstanceAs <| IsEmpty (PrimeSpectrum PUnit)
#align algebraic_geometry.Spec_punit_is_empty AlgebraicGeometry.spec_punit_isEmpty
instance (priority := 100) isOpenImmersion_of_isEmpty {X Y : Scheme} (f : X ⟶ Y)
[IsEmpty X.carrier] : IsOpenImmersion f := by
apply (config := { allowSynthFailures := true }) IsOpenImmersion.of_stalk_iso
· exact .of_isEmpty (X := X.carrier) _
· intro (i : X.carrier); exact isEmptyElim i
#align algebraic_geometry.is_open_immersion_of_is_empty AlgebraicGeometry.isOpenImmersion_of_isEmpty
instance (priority := 100) isIso_of_isEmpty {X Y : Scheme} (f : X ⟶ Y) [IsEmpty Y.carrier] :
IsIso f := by
haveI : IsEmpty X.carrier := f.1.base.1.isEmpty
have : Epi f.1.base := by
rw [TopCat.epi_iff_surjective]; rintro (x : Y.carrier)
exact isEmptyElim x
apply IsOpenImmersion.to_iso
#align algebraic_geometry.is_iso_of_is_empty AlgebraicGeometry.isIso_of_isEmpty
noncomputable def isInitialOfIsEmpty {X : Scheme} [IsEmpty X.carrier] : IsInitial X :=
emptyIsInitial.ofIso (asIso <| emptyIsInitial.to _)
#align algebraic_geometry.is_initial_of_is_empty AlgebraicGeometry.isInitialOfIsEmpty
noncomputable def specPunitIsInitial : IsInitial (Scheme.Spec.obj (op <| CommRingCat.of PUnit)) :=
emptyIsInitial.ofIso (asIso <| emptyIsInitial.to _)
#align algebraic_geometry.Spec_punit_is_initial AlgebraicGeometry.specPunitIsInitial
instance (priority := 100) isAffine_of_isEmpty {X : Scheme} [IsEmpty X.carrier] : IsAffine X :=
isAffineOfIso
(inv (emptyIsInitial.to X) ≫ emptyIsInitial.to (Scheme.Spec.obj (op <| CommRingCat.of PUnit)))
#align algebraic_geometry.is_affine_of_is_empty AlgebraicGeometry.isAffine_of_isEmpty
instance : HasInitial Scheme :=
-- Porting note: this instance was not needed
haveI : (Y : Scheme) → Unique (Scheme.empty ⟶ Y) := Scheme.hom_unique_of_empty_source
hasInitial_of_unique Scheme.empty
instance initial_isEmpty : IsEmpty (⊥_ Scheme).carrier :=
⟨fun x => ((initial.to Scheme.empty : _).1.base x).elim⟩
#align algebraic_geometry.initial_is_empty AlgebraicGeometry.initial_isEmpty
| Mathlib/AlgebraicGeometry/Limits.lean | 133 | 139 | theorem bot_isAffineOpen (X : Scheme) : IsAffineOpen (⊥ : Opens X.carrier) := by |
convert rangeIsAffineOpenOfOpenImmersion (initial.to X)
ext
-- Porting note: added this `erw` to turn LHS to `False`
erw [Set.mem_empty_iff_false]
rw [false_iff_iff]
exact fun x => isEmptyElim (show (⊥_ Scheme).carrier from x.choose)
| 405 |
import Mathlib.CategoryTheory.Monoidal.Types.Symmetric
import Mathlib.CategoryTheory.Monoidal.Types.Coyoneda
import Mathlib.CategoryTheory.Monoidal.Center
import Mathlib.Tactic.ApplyFun
#align_import category_theory.enriched.basic from "leanprover-community/mathlib"@"95a87616d63b3cb49d3fe678d416fbe9c4217bf4"
universe w v u₁ u₂ u₃
noncomputable section
namespace CategoryTheory
open Opposite
open MonoidalCategory
variable (V : Type v) [Category.{w} V] [MonoidalCategory V]
class EnrichedCategory (C : Type u₁) where
Hom : C → C → V
id (X : C) : 𝟙_ V ⟶ Hom X X
comp (X Y Z : C) : Hom X Y ⊗ Hom Y Z ⟶ Hom X Z
id_comp (X Y : C) : (λ_ (Hom X Y)).inv ≫ id X ▷ _ ≫ comp X X Y = 𝟙 _ := by aesop_cat
comp_id (X Y : C) : (ρ_ (Hom X Y)).inv ≫ _ ◁ id Y ≫ comp X Y Y = 𝟙 _ := by aesop_cat
assoc (W X Y Z : C) : (α_ _ _ _).inv ≫ comp W X Y ▷ _ ≫ comp W Y Z =
_ ◁ comp X Y Z ≫ comp W X Z := by aesop_cat
#align category_theory.enriched_category CategoryTheory.EnrichedCategory
notation X " ⟶[" V "] " Y:10 => (EnrichedCategory.Hom X Y : V)
variable {C : Type u₁} [EnrichedCategory V C]
def eId (X : C) : 𝟙_ V ⟶ X ⟶[V] X :=
EnrichedCategory.id X
#align category_theory.e_id CategoryTheory.eId
def eComp (X Y Z : C) : ((X ⟶[V] Y) ⊗ Y ⟶[V] Z) ⟶ X ⟶[V] Z :=
EnrichedCategory.comp X Y Z
#align category_theory.e_comp CategoryTheory.eComp
@[reassoc (attr := simp)]
theorem e_id_comp (X Y : C) :
(λ_ (X ⟶[V] Y)).inv ≫ eId V X ▷ _ ≫ eComp V X X Y = 𝟙 (X ⟶[V] Y) :=
EnrichedCategory.id_comp X Y
#align category_theory.e_id_comp CategoryTheory.e_id_comp
@[reassoc (attr := simp)]
theorem e_comp_id (X Y : C) :
(ρ_ (X ⟶[V] Y)).inv ≫ _ ◁ eId V Y ≫ eComp V X Y Y = 𝟙 (X ⟶[V] Y) :=
EnrichedCategory.comp_id X Y
#align category_theory.e_comp_id CategoryTheory.e_comp_id
@[reassoc (attr := simp)]
theorem e_assoc (W X Y Z : C) :
(α_ _ _ _).inv ≫ eComp V W X Y ▷ _ ≫ eComp V W Y Z =
_ ◁ eComp V X Y Z ≫ eComp V W X Z :=
EnrichedCategory.assoc W X Y Z
#align category_theory.e_assoc CategoryTheory.e_assoc
@[reassoc]
| Mathlib/CategoryTheory/Enriched/Basic.lean | 98 | 101 | theorem e_assoc' (W X Y Z : C) :
(α_ _ _ _).hom ≫ _ ◁ eComp V X Y Z ≫ eComp V W X Z =
eComp V W X Y ▷ _ ≫ eComp V W Y Z := by |
rw [← e_assoc V W X Y Z, Iso.hom_inv_id_assoc]
| 406 |
import Mathlib.Algebra.Group.Semiconj.Defs
import Mathlib.Algebra.Group.Basic
#align_import algebra.group.semiconj from "leanprover-community/mathlib"@"a148d797a1094ab554ad4183a4ad6f130358ef64"
assert_not_exists MonoidWithZero
assert_not_exists DenselyOrdered
namespace SemiconjBy
variable {G : Type*}
section DivisionMonoid
variable [DivisionMonoid G] {a x y : G}
@[to_additive (attr := simp)]
| Mathlib/Algebra/Group/Semiconj/Basic.lean | 26 | 27 | theorem inv_inv_symm_iff : SemiconjBy a⁻¹ x⁻¹ y⁻¹ ↔ SemiconjBy a y x := by |
simp_rw [SemiconjBy, ← mul_inv_rev, inv_inj, eq_comm]
| 407 |
import Batteries.Tactic.Lint.Basic
import Mathlib.Algebra.Order.Monoid.Unbundled.Basic
import Mathlib.Algebra.Order.Ring.Defs
import Mathlib.Algebra.Order.ZeroLEOne
import Mathlib.Data.Nat.Cast.Order
import Mathlib.Init.Data.Int.Order
set_option autoImplicit true
namespace Linarith
theorem lt_irrefl {α : Type u} [Preorder α] {a : α} : ¬a < a := _root_.lt_irrefl a
| Mathlib/Tactic/Linarith/Lemmas.lean | 27 | 28 | theorem eq_of_eq_of_eq {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b = 0) : a + b = 0 := by |
simp [*]
| 408 |
import Batteries.Tactic.Lint.Basic
import Mathlib.Algebra.Order.Monoid.Unbundled.Basic
import Mathlib.Algebra.Order.Ring.Defs
import Mathlib.Algebra.Order.ZeroLEOne
import Mathlib.Data.Nat.Cast.Order
import Mathlib.Init.Data.Int.Order
set_option autoImplicit true
namespace Linarith
theorem lt_irrefl {α : Type u} [Preorder α] {a : α} : ¬a < a := _root_.lt_irrefl a
theorem eq_of_eq_of_eq {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b = 0) : a + b = 0 := by
simp [*]
| Mathlib/Tactic/Linarith/Lemmas.lean | 30 | 31 | theorem le_of_eq_of_le {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b ≤ 0) : a + b ≤ 0 := by |
simp [*]
| 408 |
import Batteries.Tactic.Lint.Basic
import Mathlib.Algebra.Order.Monoid.Unbundled.Basic
import Mathlib.Algebra.Order.Ring.Defs
import Mathlib.Algebra.Order.ZeroLEOne
import Mathlib.Data.Nat.Cast.Order
import Mathlib.Init.Data.Int.Order
set_option autoImplicit true
namespace Linarith
theorem lt_irrefl {α : Type u} [Preorder α] {a : α} : ¬a < a := _root_.lt_irrefl a
theorem eq_of_eq_of_eq {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b = 0) : a + b = 0 := by
simp [*]
theorem le_of_eq_of_le {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b ≤ 0) : a + b ≤ 0 := by
simp [*]
| Mathlib/Tactic/Linarith/Lemmas.lean | 33 | 34 | theorem lt_of_eq_of_lt {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b < 0) : a + b < 0 := by |
simp [*]
| 408 |
import Batteries.Tactic.Lint.Basic
import Mathlib.Algebra.Order.Monoid.Unbundled.Basic
import Mathlib.Algebra.Order.Ring.Defs
import Mathlib.Algebra.Order.ZeroLEOne
import Mathlib.Data.Nat.Cast.Order
import Mathlib.Init.Data.Int.Order
set_option autoImplicit true
namespace Linarith
theorem lt_irrefl {α : Type u} [Preorder α] {a : α} : ¬a < a := _root_.lt_irrefl a
theorem eq_of_eq_of_eq {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b = 0) : a + b = 0 := by
simp [*]
theorem le_of_eq_of_le {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b ≤ 0) : a + b ≤ 0 := by
simp [*]
theorem lt_of_eq_of_lt {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b < 0) : a + b < 0 := by
simp [*]
| Mathlib/Tactic/Linarith/Lemmas.lean | 36 | 37 | theorem le_of_le_of_eq {α} [OrderedSemiring α] {a b : α} (ha : a ≤ 0) (hb : b = 0) : a + b ≤ 0 := by |
simp [*]
| 408 |
import Batteries.Tactic.Lint.Basic
import Mathlib.Algebra.Order.Monoid.Unbundled.Basic
import Mathlib.Algebra.Order.Ring.Defs
import Mathlib.Algebra.Order.ZeroLEOne
import Mathlib.Data.Nat.Cast.Order
import Mathlib.Init.Data.Int.Order
set_option autoImplicit true
namespace Linarith
theorem lt_irrefl {α : Type u} [Preorder α] {a : α} : ¬a < a := _root_.lt_irrefl a
theorem eq_of_eq_of_eq {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b = 0) : a + b = 0 := by
simp [*]
theorem le_of_eq_of_le {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b ≤ 0) : a + b ≤ 0 := by
simp [*]
theorem lt_of_eq_of_lt {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b < 0) : a + b < 0 := by
simp [*]
theorem le_of_le_of_eq {α} [OrderedSemiring α] {a b : α} (ha : a ≤ 0) (hb : b = 0) : a + b ≤ 0 := by
simp [*]
| Mathlib/Tactic/Linarith/Lemmas.lean | 39 | 40 | theorem lt_of_lt_of_eq {α} [OrderedSemiring α] {a b : α} (ha : a < 0) (hb : b = 0) : a + b < 0 := by |
simp [*]
| 408 |
import Batteries.Tactic.Lint.Basic
import Mathlib.Algebra.Order.Monoid.Unbundled.Basic
import Mathlib.Algebra.Order.Ring.Defs
import Mathlib.Algebra.Order.ZeroLEOne
import Mathlib.Data.Nat.Cast.Order
import Mathlib.Init.Data.Int.Order
set_option autoImplicit true
namespace Linarith
theorem lt_irrefl {α : Type u} [Preorder α] {a : α} : ¬a < a := _root_.lt_irrefl a
theorem eq_of_eq_of_eq {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b = 0) : a + b = 0 := by
simp [*]
theorem le_of_eq_of_le {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b ≤ 0) : a + b ≤ 0 := by
simp [*]
theorem lt_of_eq_of_lt {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b < 0) : a + b < 0 := by
simp [*]
theorem le_of_le_of_eq {α} [OrderedSemiring α] {a b : α} (ha : a ≤ 0) (hb : b = 0) : a + b ≤ 0 := by
simp [*]
theorem lt_of_lt_of_eq {α} [OrderedSemiring α] {a b : α} (ha : a < 0) (hb : b = 0) : a + b < 0 := by
simp [*]
theorem mul_neg {α} [StrictOrderedRing α] {a b : α} (ha : a < 0) (hb : 0 < b) : b * a < 0 :=
have : (-b)*a > 0 := mul_pos_of_neg_of_neg (neg_neg_of_pos hb) ha
neg_of_neg_pos (by simpa)
theorem mul_nonpos {α} [OrderedRing α] {a b : α} (ha : a ≤ 0) (hb : 0 < b) : b * a ≤ 0 :=
have : (-b)*a ≥ 0 := mul_nonneg_of_nonpos_of_nonpos (le_of_lt (neg_neg_of_pos hb)) ha
by simpa
-- used alongside `mul_neg` and `mul_nonpos`, so has the same argument pattern for uniformity
@[nolint unusedArguments]
| Mathlib/Tactic/Linarith/Lemmas.lean | 52 | 53 | theorem mul_eq {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (_ : 0 < b) : b * a = 0 := by |
simp [*]
| 408 |
import Mathlib.Topology.Sets.Opens
#align_import topology.local_at_target from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open TopologicalSpace Set Filter
open Topology Filter
variable {α β : Type*} [TopologicalSpace α] [TopologicalSpace β] {f : α → β}
variable {s : Set β} {ι : Type*} {U : ι → Opens β} (hU : iSup U = ⊤)
| Mathlib/Topology/LocalAtTarget.lean | 29 | 34 | theorem Set.restrictPreimage_inducing (s : Set β) (h : Inducing f) :
Inducing (s.restrictPreimage f) := by |
simp_rw [← inducing_subtype_val.of_comp_iff, inducing_iff_nhds, restrictPreimage,
MapsTo.coe_restrict, restrict_eq, ← @Filter.comap_comap _ _ _ _ _ f, Function.comp_apply] at h ⊢
intro a
rw [← h, ← inducing_subtype_val.nhds_eq_comap]
| 409 |
import Mathlib.Topology.Sets.Opens
#align_import topology.local_at_target from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open TopologicalSpace Set Filter
open Topology Filter
variable {α β : Type*} [TopologicalSpace α] [TopologicalSpace β] {f : α → β}
variable {s : Set β} {ι : Type*} {U : ι → Opens β} (hU : iSup U = ⊤)
theorem Set.restrictPreimage_inducing (s : Set β) (h : Inducing f) :
Inducing (s.restrictPreimage f) := by
simp_rw [← inducing_subtype_val.of_comp_iff, inducing_iff_nhds, restrictPreimage,
MapsTo.coe_restrict, restrict_eq, ← @Filter.comap_comap _ _ _ _ _ f, Function.comp_apply] at h ⊢
intro a
rw [← h, ← inducing_subtype_val.nhds_eq_comap]
#align set.restrict_preimage_inducing Set.restrictPreimage_inducing
alias Inducing.restrictPreimage := Set.restrictPreimage_inducing
#align inducing.restrict_preimage Inducing.restrictPreimage
theorem Set.restrictPreimage_embedding (s : Set β) (h : Embedding f) :
Embedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s, h.2.restrictPreimage s⟩
#align set.restrict_preimage_embedding Set.restrictPreimage_embedding
alias Embedding.restrictPreimage := Set.restrictPreimage_embedding
#align embedding.restrict_preimage Embedding.restrictPreimage
theorem Set.restrictPreimage_openEmbedding (s : Set β) (h : OpenEmbedding f) :
OpenEmbedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm ▸ continuous_subtype_val.isOpen_preimage _ h.isOpen_range⟩
#align set.restrict_preimage_open_embedding Set.restrictPreimage_openEmbedding
alias OpenEmbedding.restrictPreimage := Set.restrictPreimage_openEmbedding
#align open_embedding.restrict_preimage OpenEmbedding.restrictPreimage
theorem Set.restrictPreimage_closedEmbedding (s : Set β) (h : ClosedEmbedding f) :
ClosedEmbedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm ▸ inducing_subtype_val.isClosed_preimage _ h.isClosed_range⟩
#align set.restrict_preimage_closed_embedding Set.restrictPreimage_closedEmbedding
alias ClosedEmbedding.restrictPreimage := Set.restrictPreimage_closedEmbedding
#align closed_embedding.restrict_preimage ClosedEmbedding.restrictPreimage
| Mathlib/Topology/LocalAtTarget.lean | 66 | 72 | theorem IsClosedMap.restrictPreimage (H : IsClosedMap f) (s : Set β) :
IsClosedMap (s.restrictPreimage f) := by |
intro t
suffices ∀ u, IsClosed u → Subtype.val ⁻¹' u = t →
∃ v, IsClosed v ∧ Subtype.val ⁻¹' v = s.restrictPreimage f '' t by
simpa [isClosed_induced_iff]
exact fun u hu e => ⟨f '' u, H u hu, by simp [← e, image_restrictPreimage]⟩
| 409 |
import Mathlib.Topology.Sets.Opens
#align_import topology.local_at_target from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open TopologicalSpace Set Filter
open Topology Filter
variable {α β : Type*} [TopologicalSpace α] [TopologicalSpace β] {f : α → β}
variable {s : Set β} {ι : Type*} {U : ι → Opens β} (hU : iSup U = ⊤)
theorem Set.restrictPreimage_inducing (s : Set β) (h : Inducing f) :
Inducing (s.restrictPreimage f) := by
simp_rw [← inducing_subtype_val.of_comp_iff, inducing_iff_nhds, restrictPreimage,
MapsTo.coe_restrict, restrict_eq, ← @Filter.comap_comap _ _ _ _ _ f, Function.comp_apply] at h ⊢
intro a
rw [← h, ← inducing_subtype_val.nhds_eq_comap]
#align set.restrict_preimage_inducing Set.restrictPreimage_inducing
alias Inducing.restrictPreimage := Set.restrictPreimage_inducing
#align inducing.restrict_preimage Inducing.restrictPreimage
theorem Set.restrictPreimage_embedding (s : Set β) (h : Embedding f) :
Embedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s, h.2.restrictPreimage s⟩
#align set.restrict_preimage_embedding Set.restrictPreimage_embedding
alias Embedding.restrictPreimage := Set.restrictPreimage_embedding
#align embedding.restrict_preimage Embedding.restrictPreimage
theorem Set.restrictPreimage_openEmbedding (s : Set β) (h : OpenEmbedding f) :
OpenEmbedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm ▸ continuous_subtype_val.isOpen_preimage _ h.isOpen_range⟩
#align set.restrict_preimage_open_embedding Set.restrictPreimage_openEmbedding
alias OpenEmbedding.restrictPreimage := Set.restrictPreimage_openEmbedding
#align open_embedding.restrict_preimage OpenEmbedding.restrictPreimage
theorem Set.restrictPreimage_closedEmbedding (s : Set β) (h : ClosedEmbedding f) :
ClosedEmbedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm ▸ inducing_subtype_val.isClosed_preimage _ h.isClosed_range⟩
#align set.restrict_preimage_closed_embedding Set.restrictPreimage_closedEmbedding
alias ClosedEmbedding.restrictPreimage := Set.restrictPreimage_closedEmbedding
#align closed_embedding.restrict_preimage ClosedEmbedding.restrictPreimage
theorem IsClosedMap.restrictPreimage (H : IsClosedMap f) (s : Set β) :
IsClosedMap (s.restrictPreimage f) := by
intro t
suffices ∀ u, IsClosed u → Subtype.val ⁻¹' u = t →
∃ v, IsClosed v ∧ Subtype.val ⁻¹' v = s.restrictPreimage f '' t by
simpa [isClosed_induced_iff]
exact fun u hu e => ⟨f '' u, H u hu, by simp [← e, image_restrictPreimage]⟩
@[deprecated (since := "2024-04-02")]
theorem Set.restrictPreimage_isClosedMap (s : Set β) (H : IsClosedMap f) :
IsClosedMap (s.restrictPreimage f) := H.restrictPreimage s
| Mathlib/Topology/LocalAtTarget.lean | 78 | 84 | theorem IsOpenMap.restrictPreimage (H : IsOpenMap f) (s : Set β) :
IsOpenMap (s.restrictPreimage f) := by |
intro t
suffices ∀ u, IsOpen u → Subtype.val ⁻¹' u = t →
∃ v, IsOpen v ∧ Subtype.val ⁻¹' v = s.restrictPreimage f '' t by
simpa [isOpen_induced_iff]
exact fun u hu e => ⟨f '' u, H u hu, by simp [← e, image_restrictPreimage]⟩
| 409 |
import Mathlib.Topology.Sets.Opens
#align_import topology.local_at_target from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open TopologicalSpace Set Filter
open Topology Filter
variable {α β : Type*} [TopologicalSpace α] [TopologicalSpace β] {f : α → β}
variable {s : Set β} {ι : Type*} {U : ι → Opens β} (hU : iSup U = ⊤)
theorem Set.restrictPreimage_inducing (s : Set β) (h : Inducing f) :
Inducing (s.restrictPreimage f) := by
simp_rw [← inducing_subtype_val.of_comp_iff, inducing_iff_nhds, restrictPreimage,
MapsTo.coe_restrict, restrict_eq, ← @Filter.comap_comap _ _ _ _ _ f, Function.comp_apply] at h ⊢
intro a
rw [← h, ← inducing_subtype_val.nhds_eq_comap]
#align set.restrict_preimage_inducing Set.restrictPreimage_inducing
alias Inducing.restrictPreimage := Set.restrictPreimage_inducing
#align inducing.restrict_preimage Inducing.restrictPreimage
theorem Set.restrictPreimage_embedding (s : Set β) (h : Embedding f) :
Embedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s, h.2.restrictPreimage s⟩
#align set.restrict_preimage_embedding Set.restrictPreimage_embedding
alias Embedding.restrictPreimage := Set.restrictPreimage_embedding
#align embedding.restrict_preimage Embedding.restrictPreimage
theorem Set.restrictPreimage_openEmbedding (s : Set β) (h : OpenEmbedding f) :
OpenEmbedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm ▸ continuous_subtype_val.isOpen_preimage _ h.isOpen_range⟩
#align set.restrict_preimage_open_embedding Set.restrictPreimage_openEmbedding
alias OpenEmbedding.restrictPreimage := Set.restrictPreimage_openEmbedding
#align open_embedding.restrict_preimage OpenEmbedding.restrictPreimage
theorem Set.restrictPreimage_closedEmbedding (s : Set β) (h : ClosedEmbedding f) :
ClosedEmbedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm ▸ inducing_subtype_val.isClosed_preimage _ h.isClosed_range⟩
#align set.restrict_preimage_closed_embedding Set.restrictPreimage_closedEmbedding
alias ClosedEmbedding.restrictPreimage := Set.restrictPreimage_closedEmbedding
#align closed_embedding.restrict_preimage ClosedEmbedding.restrictPreimage
theorem IsClosedMap.restrictPreimage (H : IsClosedMap f) (s : Set β) :
IsClosedMap (s.restrictPreimage f) := by
intro t
suffices ∀ u, IsClosed u → Subtype.val ⁻¹' u = t →
∃ v, IsClosed v ∧ Subtype.val ⁻¹' v = s.restrictPreimage f '' t by
simpa [isClosed_induced_iff]
exact fun u hu e => ⟨f '' u, H u hu, by simp [← e, image_restrictPreimage]⟩
@[deprecated (since := "2024-04-02")]
theorem Set.restrictPreimage_isClosedMap (s : Set β) (H : IsClosedMap f) :
IsClosedMap (s.restrictPreimage f) := H.restrictPreimage s
theorem IsOpenMap.restrictPreimage (H : IsOpenMap f) (s : Set β) :
IsOpenMap (s.restrictPreimage f) := by
intro t
suffices ∀ u, IsOpen u → Subtype.val ⁻¹' u = t →
∃ v, IsOpen v ∧ Subtype.val ⁻¹' v = s.restrictPreimage f '' t by
simpa [isOpen_induced_iff]
exact fun u hu e => ⟨f '' u, H u hu, by simp [← e, image_restrictPreimage]⟩
@[deprecated (since := "2024-04-02")]
theorem Set.restrictPreimage_isOpenMap (s : Set β) (H : IsOpenMap f) :
IsOpenMap (s.restrictPreimage f) := H.restrictPreimage s
| Mathlib/Topology/LocalAtTarget.lean | 90 | 98 | theorem isOpen_iff_inter_of_iSup_eq_top (s : Set β) : IsOpen s ↔ ∀ i, IsOpen (s ∩ U i) := by |
constructor
· exact fun H i => H.inter (U i).2
· intro H
have : ⋃ i, (U i : Set β) = Set.univ := by
convert congr_arg (SetLike.coe) hU
simp
rw [← s.inter_univ, ← this, Set.inter_iUnion]
exact isOpen_iUnion H
| 409 |
import Mathlib.Topology.Sets.Opens
#align_import topology.local_at_target from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open TopologicalSpace Set Filter
open Topology Filter
variable {α β : Type*} [TopologicalSpace α] [TopologicalSpace β] {f : α → β}
variable {s : Set β} {ι : Type*} {U : ι → Opens β} (hU : iSup U = ⊤)
theorem Set.restrictPreimage_inducing (s : Set β) (h : Inducing f) :
Inducing (s.restrictPreimage f) := by
simp_rw [← inducing_subtype_val.of_comp_iff, inducing_iff_nhds, restrictPreimage,
MapsTo.coe_restrict, restrict_eq, ← @Filter.comap_comap _ _ _ _ _ f, Function.comp_apply] at h ⊢
intro a
rw [← h, ← inducing_subtype_val.nhds_eq_comap]
#align set.restrict_preimage_inducing Set.restrictPreimage_inducing
alias Inducing.restrictPreimage := Set.restrictPreimage_inducing
#align inducing.restrict_preimage Inducing.restrictPreimage
theorem Set.restrictPreimage_embedding (s : Set β) (h : Embedding f) :
Embedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s, h.2.restrictPreimage s⟩
#align set.restrict_preimage_embedding Set.restrictPreimage_embedding
alias Embedding.restrictPreimage := Set.restrictPreimage_embedding
#align embedding.restrict_preimage Embedding.restrictPreimage
theorem Set.restrictPreimage_openEmbedding (s : Set β) (h : OpenEmbedding f) :
OpenEmbedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm ▸ continuous_subtype_val.isOpen_preimage _ h.isOpen_range⟩
#align set.restrict_preimage_open_embedding Set.restrictPreimage_openEmbedding
alias OpenEmbedding.restrictPreimage := Set.restrictPreimage_openEmbedding
#align open_embedding.restrict_preimage OpenEmbedding.restrictPreimage
theorem Set.restrictPreimage_closedEmbedding (s : Set β) (h : ClosedEmbedding f) :
ClosedEmbedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm ▸ inducing_subtype_val.isClosed_preimage _ h.isClosed_range⟩
#align set.restrict_preimage_closed_embedding Set.restrictPreimage_closedEmbedding
alias ClosedEmbedding.restrictPreimage := Set.restrictPreimage_closedEmbedding
#align closed_embedding.restrict_preimage ClosedEmbedding.restrictPreimage
theorem IsClosedMap.restrictPreimage (H : IsClosedMap f) (s : Set β) :
IsClosedMap (s.restrictPreimage f) := by
intro t
suffices ∀ u, IsClosed u → Subtype.val ⁻¹' u = t →
∃ v, IsClosed v ∧ Subtype.val ⁻¹' v = s.restrictPreimage f '' t by
simpa [isClosed_induced_iff]
exact fun u hu e => ⟨f '' u, H u hu, by simp [← e, image_restrictPreimage]⟩
@[deprecated (since := "2024-04-02")]
theorem Set.restrictPreimage_isClosedMap (s : Set β) (H : IsClosedMap f) :
IsClosedMap (s.restrictPreimage f) := H.restrictPreimage s
theorem IsOpenMap.restrictPreimage (H : IsOpenMap f) (s : Set β) :
IsOpenMap (s.restrictPreimage f) := by
intro t
suffices ∀ u, IsOpen u → Subtype.val ⁻¹' u = t →
∃ v, IsOpen v ∧ Subtype.val ⁻¹' v = s.restrictPreimage f '' t by
simpa [isOpen_induced_iff]
exact fun u hu e => ⟨f '' u, H u hu, by simp [← e, image_restrictPreimage]⟩
@[deprecated (since := "2024-04-02")]
theorem Set.restrictPreimage_isOpenMap (s : Set β) (H : IsOpenMap f) :
IsOpenMap (s.restrictPreimage f) := H.restrictPreimage s
theorem isOpen_iff_inter_of_iSup_eq_top (s : Set β) : IsOpen s ↔ ∀ i, IsOpen (s ∩ U i) := by
constructor
· exact fun H i => H.inter (U i).2
· intro H
have : ⋃ i, (U i : Set β) = Set.univ := by
convert congr_arg (SetLike.coe) hU
simp
rw [← s.inter_univ, ← this, Set.inter_iUnion]
exact isOpen_iUnion H
#align is_open_iff_inter_of_supr_eq_top isOpen_iff_inter_of_iSup_eq_top
| Mathlib/Topology/LocalAtTarget.lean | 101 | 108 | theorem isOpen_iff_coe_preimage_of_iSup_eq_top (s : Set β) :
IsOpen s ↔ ∀ i, IsOpen ((↑) ⁻¹' s : Set (U i)) := by |
-- Porting note: rewrote to avoid ´simp´ issues
rw [isOpen_iff_inter_of_iSup_eq_top hU s]
refine forall_congr' fun i => ?_
rw [(U _).2.openEmbedding_subtype_val.open_iff_image_open]
erw [Set.image_preimage_eq_inter_range]
rw [Subtype.range_coe, Opens.carrier_eq_coe]
| 409 |
import Mathlib.Topology.Sets.Opens
#align_import topology.local_at_target from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open TopologicalSpace Set Filter
open Topology Filter
variable {α β : Type*} [TopologicalSpace α] [TopologicalSpace β] {f : α → β}
variable {s : Set β} {ι : Type*} {U : ι → Opens β} (hU : iSup U = ⊤)
theorem Set.restrictPreimage_inducing (s : Set β) (h : Inducing f) :
Inducing (s.restrictPreimage f) := by
simp_rw [← inducing_subtype_val.of_comp_iff, inducing_iff_nhds, restrictPreimage,
MapsTo.coe_restrict, restrict_eq, ← @Filter.comap_comap _ _ _ _ _ f, Function.comp_apply] at h ⊢
intro a
rw [← h, ← inducing_subtype_val.nhds_eq_comap]
#align set.restrict_preimage_inducing Set.restrictPreimage_inducing
alias Inducing.restrictPreimage := Set.restrictPreimage_inducing
#align inducing.restrict_preimage Inducing.restrictPreimage
theorem Set.restrictPreimage_embedding (s : Set β) (h : Embedding f) :
Embedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s, h.2.restrictPreimage s⟩
#align set.restrict_preimage_embedding Set.restrictPreimage_embedding
alias Embedding.restrictPreimage := Set.restrictPreimage_embedding
#align embedding.restrict_preimage Embedding.restrictPreimage
theorem Set.restrictPreimage_openEmbedding (s : Set β) (h : OpenEmbedding f) :
OpenEmbedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm ▸ continuous_subtype_val.isOpen_preimage _ h.isOpen_range⟩
#align set.restrict_preimage_open_embedding Set.restrictPreimage_openEmbedding
alias OpenEmbedding.restrictPreimage := Set.restrictPreimage_openEmbedding
#align open_embedding.restrict_preimage OpenEmbedding.restrictPreimage
theorem Set.restrictPreimage_closedEmbedding (s : Set β) (h : ClosedEmbedding f) :
ClosedEmbedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm ▸ inducing_subtype_val.isClosed_preimage _ h.isClosed_range⟩
#align set.restrict_preimage_closed_embedding Set.restrictPreimage_closedEmbedding
alias ClosedEmbedding.restrictPreimage := Set.restrictPreimage_closedEmbedding
#align closed_embedding.restrict_preimage ClosedEmbedding.restrictPreimage
theorem IsClosedMap.restrictPreimage (H : IsClosedMap f) (s : Set β) :
IsClosedMap (s.restrictPreimage f) := by
intro t
suffices ∀ u, IsClosed u → Subtype.val ⁻¹' u = t →
∃ v, IsClosed v ∧ Subtype.val ⁻¹' v = s.restrictPreimage f '' t by
simpa [isClosed_induced_iff]
exact fun u hu e => ⟨f '' u, H u hu, by simp [← e, image_restrictPreimage]⟩
@[deprecated (since := "2024-04-02")]
theorem Set.restrictPreimage_isClosedMap (s : Set β) (H : IsClosedMap f) :
IsClosedMap (s.restrictPreimage f) := H.restrictPreimage s
theorem IsOpenMap.restrictPreimage (H : IsOpenMap f) (s : Set β) :
IsOpenMap (s.restrictPreimage f) := by
intro t
suffices ∀ u, IsOpen u → Subtype.val ⁻¹' u = t →
∃ v, IsOpen v ∧ Subtype.val ⁻¹' v = s.restrictPreimage f '' t by
simpa [isOpen_induced_iff]
exact fun u hu e => ⟨f '' u, H u hu, by simp [← e, image_restrictPreimage]⟩
@[deprecated (since := "2024-04-02")]
theorem Set.restrictPreimage_isOpenMap (s : Set β) (H : IsOpenMap f) :
IsOpenMap (s.restrictPreimage f) := H.restrictPreimage s
theorem isOpen_iff_inter_of_iSup_eq_top (s : Set β) : IsOpen s ↔ ∀ i, IsOpen (s ∩ U i) := by
constructor
· exact fun H i => H.inter (U i).2
· intro H
have : ⋃ i, (U i : Set β) = Set.univ := by
convert congr_arg (SetLike.coe) hU
simp
rw [← s.inter_univ, ← this, Set.inter_iUnion]
exact isOpen_iUnion H
#align is_open_iff_inter_of_supr_eq_top isOpen_iff_inter_of_iSup_eq_top
theorem isOpen_iff_coe_preimage_of_iSup_eq_top (s : Set β) :
IsOpen s ↔ ∀ i, IsOpen ((↑) ⁻¹' s : Set (U i)) := by
-- Porting note: rewrote to avoid ´simp´ issues
rw [isOpen_iff_inter_of_iSup_eq_top hU s]
refine forall_congr' fun i => ?_
rw [(U _).2.openEmbedding_subtype_val.open_iff_image_open]
erw [Set.image_preimage_eq_inter_range]
rw [Subtype.range_coe, Opens.carrier_eq_coe]
#align is_open_iff_coe_preimage_of_supr_eq_top isOpen_iff_coe_preimage_of_iSup_eq_top
| Mathlib/Topology/LocalAtTarget.lean | 111 | 113 | theorem isClosed_iff_coe_preimage_of_iSup_eq_top (s : Set β) :
IsClosed s ↔ ∀ i, IsClosed ((↑) ⁻¹' s : Set (U i)) := by |
simpa using isOpen_iff_coe_preimage_of_iSup_eq_top hU sᶜ
| 409 |
import Mathlib.Topology.Sets.Opens
#align_import topology.local_at_target from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
open TopologicalSpace Set Filter
open Topology Filter
variable {α β : Type*} [TopologicalSpace α] [TopologicalSpace β] {f : α → β}
variable {s : Set β} {ι : Type*} {U : ι → Opens β} (hU : iSup U = ⊤)
theorem Set.restrictPreimage_inducing (s : Set β) (h : Inducing f) :
Inducing (s.restrictPreimage f) := by
simp_rw [← inducing_subtype_val.of_comp_iff, inducing_iff_nhds, restrictPreimage,
MapsTo.coe_restrict, restrict_eq, ← @Filter.comap_comap _ _ _ _ _ f, Function.comp_apply] at h ⊢
intro a
rw [← h, ← inducing_subtype_val.nhds_eq_comap]
#align set.restrict_preimage_inducing Set.restrictPreimage_inducing
alias Inducing.restrictPreimage := Set.restrictPreimage_inducing
#align inducing.restrict_preimage Inducing.restrictPreimage
theorem Set.restrictPreimage_embedding (s : Set β) (h : Embedding f) :
Embedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s, h.2.restrictPreimage s⟩
#align set.restrict_preimage_embedding Set.restrictPreimage_embedding
alias Embedding.restrictPreimage := Set.restrictPreimage_embedding
#align embedding.restrict_preimage Embedding.restrictPreimage
theorem Set.restrictPreimage_openEmbedding (s : Set β) (h : OpenEmbedding f) :
OpenEmbedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm ▸ continuous_subtype_val.isOpen_preimage _ h.isOpen_range⟩
#align set.restrict_preimage_open_embedding Set.restrictPreimage_openEmbedding
alias OpenEmbedding.restrictPreimage := Set.restrictPreimage_openEmbedding
#align open_embedding.restrict_preimage OpenEmbedding.restrictPreimage
theorem Set.restrictPreimage_closedEmbedding (s : Set β) (h : ClosedEmbedding f) :
ClosedEmbedding (s.restrictPreimage f) :=
⟨h.1.restrictPreimage s,
(s.range_restrictPreimage f).symm ▸ inducing_subtype_val.isClosed_preimage _ h.isClosed_range⟩
#align set.restrict_preimage_closed_embedding Set.restrictPreimage_closedEmbedding
alias ClosedEmbedding.restrictPreimage := Set.restrictPreimage_closedEmbedding
#align closed_embedding.restrict_preimage ClosedEmbedding.restrictPreimage
theorem IsClosedMap.restrictPreimage (H : IsClosedMap f) (s : Set β) :
IsClosedMap (s.restrictPreimage f) := by
intro t
suffices ∀ u, IsClosed u → Subtype.val ⁻¹' u = t →
∃ v, IsClosed v ∧ Subtype.val ⁻¹' v = s.restrictPreimage f '' t by
simpa [isClosed_induced_iff]
exact fun u hu e => ⟨f '' u, H u hu, by simp [← e, image_restrictPreimage]⟩
@[deprecated (since := "2024-04-02")]
theorem Set.restrictPreimage_isClosedMap (s : Set β) (H : IsClosedMap f) :
IsClosedMap (s.restrictPreimage f) := H.restrictPreimage s
theorem IsOpenMap.restrictPreimage (H : IsOpenMap f) (s : Set β) :
IsOpenMap (s.restrictPreimage f) := by
intro t
suffices ∀ u, IsOpen u → Subtype.val ⁻¹' u = t →
∃ v, IsOpen v ∧ Subtype.val ⁻¹' v = s.restrictPreimage f '' t by
simpa [isOpen_induced_iff]
exact fun u hu e => ⟨f '' u, H u hu, by simp [← e, image_restrictPreimage]⟩
@[deprecated (since := "2024-04-02")]
theorem Set.restrictPreimage_isOpenMap (s : Set β) (H : IsOpenMap f) :
IsOpenMap (s.restrictPreimage f) := H.restrictPreimage s
theorem isOpen_iff_inter_of_iSup_eq_top (s : Set β) : IsOpen s ↔ ∀ i, IsOpen (s ∩ U i) := by
constructor
· exact fun H i => H.inter (U i).2
· intro H
have : ⋃ i, (U i : Set β) = Set.univ := by
convert congr_arg (SetLike.coe) hU
simp
rw [← s.inter_univ, ← this, Set.inter_iUnion]
exact isOpen_iUnion H
#align is_open_iff_inter_of_supr_eq_top isOpen_iff_inter_of_iSup_eq_top
theorem isOpen_iff_coe_preimage_of_iSup_eq_top (s : Set β) :
IsOpen s ↔ ∀ i, IsOpen ((↑) ⁻¹' s : Set (U i)) := by
-- Porting note: rewrote to avoid ´simp´ issues
rw [isOpen_iff_inter_of_iSup_eq_top hU s]
refine forall_congr' fun i => ?_
rw [(U _).2.openEmbedding_subtype_val.open_iff_image_open]
erw [Set.image_preimage_eq_inter_range]
rw [Subtype.range_coe, Opens.carrier_eq_coe]
#align is_open_iff_coe_preimage_of_supr_eq_top isOpen_iff_coe_preimage_of_iSup_eq_top
theorem isClosed_iff_coe_preimage_of_iSup_eq_top (s : Set β) :
IsClosed s ↔ ∀ i, IsClosed ((↑) ⁻¹' s : Set (U i)) := by
simpa using isOpen_iff_coe_preimage_of_iSup_eq_top hU sᶜ
#align is_closed_iff_coe_preimage_of_supr_eq_top isClosed_iff_coe_preimage_of_iSup_eq_top
| Mathlib/Topology/LocalAtTarget.lean | 116 | 126 | theorem isClosedMap_iff_isClosedMap_of_iSup_eq_top :
IsClosedMap f ↔ ∀ i, IsClosedMap ((U i).1.restrictPreimage f) := by |
refine ⟨fun h i => h.restrictPreimage _, ?_⟩
rintro H s hs
rw [isClosed_iff_coe_preimage_of_iSup_eq_top hU]
intro i
convert H i _ ⟨⟨_, hs.1, eq_compl_comm.mpr rfl⟩⟩
ext ⟨x, hx⟩
suffices (∃ y, y ∈ s ∧ f y = x) ↔ ∃ y, y ∈ s ∧ f y ∈ U i ∧ f y = x by
simpa [Set.restrictPreimage, ← Subtype.coe_inj]
exact ⟨fun ⟨a, b, c⟩ => ⟨a, b, c.symm ▸ hx, c⟩, fun ⟨a, b, _, c⟩ => ⟨a, b, c⟩⟩
| 409 |
import Mathlib.Algebra.GroupWithZero.Units.Lemmas
import Mathlib.Data.Rat.Cast.Defs
#align_import data.rat.cast from "leanprover-community/mathlib"@"acebd8d49928f6ed8920e502a6c90674e75bd441"
variable {F ι α β : Type*}
namespace Rat
open Rat
section WithDivRing
variable [DivisionRing α]
@[simp, norm_cast]
theorem cast_inj [CharZero α] : ∀ {m n : ℚ}, (m : α) = n ↔ m = n
| ⟨n₁, d₁, d₁0, c₁⟩, ⟨n₂, d₂, d₂0, c₂⟩ => by
refine ⟨fun h => ?_, congr_arg _⟩
have d₁a : (d₁ : α) ≠ 0 := Nat.cast_ne_zero.2 d₁0
have d₂a : (d₂ : α) ≠ 0 := Nat.cast_ne_zero.2 d₂0
rw [mk'_eq_divInt, mk'_eq_divInt] at h ⊢
rw [cast_divInt_of_ne_zero, cast_divInt_of_ne_zero] at h <;> simp [d₁0, d₂0] at h ⊢
rwa [eq_div_iff_mul_eq d₂a, division_def, mul_assoc, (d₁.cast_commute (d₂ : α)).inv_left₀.eq, ←
mul_assoc, ← division_def, eq_comm, eq_div_iff_mul_eq d₁a, eq_comm, ← Int.cast_natCast d₁, ←
Int.cast_mul, ← Int.cast_natCast d₂, ← Int.cast_mul, Int.cast_inj, ← mkRat_eq_iff d₁0 d₂0]
at h
#align rat.cast_inj Rat.cast_inj
theorem cast_injective [CharZero α] : Function.Injective ((↑) : ℚ → α)
| _, _ => cast_inj.1
#align rat.cast_injective Rat.cast_injective
@[simp]
| Mathlib/Data/Rat/Cast/CharZero.lean | 46 | 46 | theorem cast_eq_zero [CharZero α] {n : ℚ} : (n : α) = 0 ↔ n = 0 := by | rw [← cast_zero, cast_inj]
| 410 |
import Mathlib.Algebra.GroupWithZero.Units.Lemmas
import Mathlib.Data.Rat.Cast.Defs
#align_import data.rat.cast from "leanprover-community/mathlib"@"acebd8d49928f6ed8920e502a6c90674e75bd441"
variable {F ι α β : Type*}
namespace Rat
open Rat
section WithDivRing
variable [DivisionRing α]
@[simp, norm_cast]
theorem cast_inj [CharZero α] : ∀ {m n : ℚ}, (m : α) = n ↔ m = n
| ⟨n₁, d₁, d₁0, c₁⟩, ⟨n₂, d₂, d₂0, c₂⟩ => by
refine ⟨fun h => ?_, congr_arg _⟩
have d₁a : (d₁ : α) ≠ 0 := Nat.cast_ne_zero.2 d₁0
have d₂a : (d₂ : α) ≠ 0 := Nat.cast_ne_zero.2 d₂0
rw [mk'_eq_divInt, mk'_eq_divInt] at h ⊢
rw [cast_divInt_of_ne_zero, cast_divInt_of_ne_zero] at h <;> simp [d₁0, d₂0] at h ⊢
rwa [eq_div_iff_mul_eq d₂a, division_def, mul_assoc, (d₁.cast_commute (d₂ : α)).inv_left₀.eq, ←
mul_assoc, ← division_def, eq_comm, eq_div_iff_mul_eq d₁a, eq_comm, ← Int.cast_natCast d₁, ←
Int.cast_mul, ← Int.cast_natCast d₂, ← Int.cast_mul, Int.cast_inj, ← mkRat_eq_iff d₁0 d₂0]
at h
#align rat.cast_inj Rat.cast_inj
theorem cast_injective [CharZero α] : Function.Injective ((↑) : ℚ → α)
| _, _ => cast_inj.1
#align rat.cast_injective Rat.cast_injective
@[simp]
theorem cast_eq_zero [CharZero α] {n : ℚ} : (n : α) = 0 ↔ n = 0 := by rw [← cast_zero, cast_inj]
#align rat.cast_eq_zero Rat.cast_eq_zero
theorem cast_ne_zero [CharZero α] {n : ℚ} : (n : α) ≠ 0 ↔ n ≠ 0 :=
not_congr cast_eq_zero
#align rat.cast_ne_zero Rat.cast_ne_zero
@[simp, norm_cast]
theorem cast_add [CharZero α] (m n) : ((m + n : ℚ) : α) = m + n :=
cast_add_of_ne_zero (Nat.cast_ne_zero.2 <| ne_of_gt m.pos) (Nat.cast_ne_zero.2 <| ne_of_gt n.pos)
#align rat.cast_add Rat.cast_add
@[simp, norm_cast]
theorem cast_sub [CharZero α] (m n) : ((m - n : ℚ) : α) = m - n :=
cast_sub_of_ne_zero (Nat.cast_ne_zero.2 <| ne_of_gt m.pos) (Nat.cast_ne_zero.2 <| ne_of_gt n.pos)
#align rat.cast_sub Rat.cast_sub
@[simp, norm_cast]
theorem cast_mul [CharZero α] (m n) : ((m * n : ℚ) : α) = m * n :=
cast_mul_of_ne_zero (Nat.cast_ne_zero.2 <| ne_of_gt m.pos) (Nat.cast_ne_zero.2 <| ne_of_gt n.pos)
#align rat.cast_mul Rat.cast_mul
section
set_option linter.deprecated false
@[simp, norm_cast]
theorem cast_bit0 [CharZero α] (n : ℚ) : ((bit0 n : ℚ) : α) = (bit0 n : α) :=
cast_add _ _
#align rat.cast_bit0 Rat.cast_bit0
@[simp, norm_cast]
| Mathlib/Data/Rat/Cast/CharZero.lean | 78 | 79 | theorem cast_bit1 [CharZero α] (n : ℚ) : ((bit1 n : ℚ) : α) = (bit1 n : α) := by |
rw [bit1, cast_add, cast_one, cast_bit0]; rfl
| 410 |
import Mathlib.Algebra.GroupWithZero.Units.Lemmas
import Mathlib.Data.Rat.Cast.Defs
#align_import data.rat.cast from "leanprover-community/mathlib"@"acebd8d49928f6ed8920e502a6c90674e75bd441"
variable {F ι α β : Type*}
namespace Rat
open Rat
section WithDivRing
variable [DivisionRing α]
@[simp, norm_cast]
theorem cast_inj [CharZero α] : ∀ {m n : ℚ}, (m : α) = n ↔ m = n
| ⟨n₁, d₁, d₁0, c₁⟩, ⟨n₂, d₂, d₂0, c₂⟩ => by
refine ⟨fun h => ?_, congr_arg _⟩
have d₁a : (d₁ : α) ≠ 0 := Nat.cast_ne_zero.2 d₁0
have d₂a : (d₂ : α) ≠ 0 := Nat.cast_ne_zero.2 d₂0
rw [mk'_eq_divInt, mk'_eq_divInt] at h ⊢
rw [cast_divInt_of_ne_zero, cast_divInt_of_ne_zero] at h <;> simp [d₁0, d₂0] at h ⊢
rwa [eq_div_iff_mul_eq d₂a, division_def, mul_assoc, (d₁.cast_commute (d₂ : α)).inv_left₀.eq, ←
mul_assoc, ← division_def, eq_comm, eq_div_iff_mul_eq d₁a, eq_comm, ← Int.cast_natCast d₁, ←
Int.cast_mul, ← Int.cast_natCast d₂, ← Int.cast_mul, Int.cast_inj, ← mkRat_eq_iff d₁0 d₂0]
at h
#align rat.cast_inj Rat.cast_inj
theorem cast_injective [CharZero α] : Function.Injective ((↑) : ℚ → α)
| _, _ => cast_inj.1
#align rat.cast_injective Rat.cast_injective
@[simp]
theorem cast_eq_zero [CharZero α] {n : ℚ} : (n : α) = 0 ↔ n = 0 := by rw [← cast_zero, cast_inj]
#align rat.cast_eq_zero Rat.cast_eq_zero
theorem cast_ne_zero [CharZero α] {n : ℚ} : (n : α) ≠ 0 ↔ n ≠ 0 :=
not_congr cast_eq_zero
#align rat.cast_ne_zero Rat.cast_ne_zero
@[simp, norm_cast]
theorem cast_add [CharZero α] (m n) : ((m + n : ℚ) : α) = m + n :=
cast_add_of_ne_zero (Nat.cast_ne_zero.2 <| ne_of_gt m.pos) (Nat.cast_ne_zero.2 <| ne_of_gt n.pos)
#align rat.cast_add Rat.cast_add
@[simp, norm_cast]
theorem cast_sub [CharZero α] (m n) : ((m - n : ℚ) : α) = m - n :=
cast_sub_of_ne_zero (Nat.cast_ne_zero.2 <| ne_of_gt m.pos) (Nat.cast_ne_zero.2 <| ne_of_gt n.pos)
#align rat.cast_sub Rat.cast_sub
@[simp, norm_cast]
theorem cast_mul [CharZero α] (m n) : ((m * n : ℚ) : α) = m * n :=
cast_mul_of_ne_zero (Nat.cast_ne_zero.2 <| ne_of_gt m.pos) (Nat.cast_ne_zero.2 <| ne_of_gt n.pos)
#align rat.cast_mul Rat.cast_mul
section
set_option linter.deprecated false
@[simp, norm_cast]
theorem cast_bit0 [CharZero α] (n : ℚ) : ((bit0 n : ℚ) : α) = (bit0 n : α) :=
cast_add _ _
#align rat.cast_bit0 Rat.cast_bit0
@[simp, norm_cast]
theorem cast_bit1 [CharZero α] (n : ℚ) : ((bit1 n : ℚ) : α) = (bit1 n : α) := by
rw [bit1, cast_add, cast_one, cast_bit0]; rfl
#align rat.cast_bit1 Rat.cast_bit1
end
variable (α)
variable [CharZero α]
def castHom : ℚ →+* α where
toFun := (↑)
map_one' := cast_one
map_mul' := cast_mul
map_zero' := cast_zero
map_add' := cast_add
#align rat.cast_hom Rat.castHom
variable {α}
@[simp]
theorem coe_cast_hom : ⇑(castHom α) = ((↑) : ℚ → α) :=
rfl
#align rat.coe_cast_hom Rat.coe_cast_hom
@[simp, norm_cast]
theorem cast_inv (n) : ((n⁻¹ : ℚ) : α) = (n : α)⁻¹ :=
map_inv₀ (castHom α) _
#align rat.cast_inv Rat.cast_inv
@[simp, norm_cast]
theorem cast_div (m n) : ((m / n : ℚ) : α) = m / n :=
map_div₀ (castHom α) _ _
#align rat.cast_div Rat.cast_div
@[simp, norm_cast]
theorem cast_zpow (q : ℚ) (n : ℤ) : ((q ^ n : ℚ) : α) = (q : α) ^ n :=
map_zpow₀ (castHom α) q n
#align rat.cast_zpow Rat.cast_zpow
@[norm_cast]
| Mathlib/Data/Rat/Cast/CharZero.lean | 119 | 120 | theorem cast_mk (a b : ℤ) : (a /. b : α) = a / b := by |
simp only [divInt_eq_div, cast_div, cast_intCast]
| 410 |
import Mathlib.MeasureTheory.Constructions.Prod.Basic
import Mathlib.MeasureTheory.Group.Measure
#align_import measure_theory.group.prod from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
noncomputable section
open Set hiding prod_eq
open Function MeasureTheory
open Filter hiding map
open scoped Classical ENNReal Pointwise MeasureTheory
variable (G : Type*) [MeasurableSpace G]
variable [Group G] [MeasurableMul₂ G]
variable (μ ν : Measure G) [SigmaFinite ν] [SigmaFinite μ] {s : Set G}
@[to_additive "The map `(x, y) ↦ (x, x + y)` as a `MeasurableEquiv`."]
protected def MeasurableEquiv.shearMulRight [MeasurableInv G] : G × G ≃ᵐ G × G :=
{ Equiv.prodShear (Equiv.refl _) Equiv.mulLeft with
measurable_toFun := measurable_fst.prod_mk measurable_mul
measurable_invFun := measurable_fst.prod_mk <| measurable_fst.inv.mul measurable_snd }
#align measurable_equiv.shear_mul_right MeasurableEquiv.shearMulRight
#align measurable_equiv.shear_add_right MeasurableEquiv.shearAddRight
@[to_additive
"The map `(x, y) ↦ (x, y - x)` as a `MeasurableEquiv` with as inverse `(x, y) ↦ (x, y + x)`."]
protected def MeasurableEquiv.shearDivRight [MeasurableInv G] : G × G ≃ᵐ G × G :=
{ Equiv.prodShear (Equiv.refl _) Equiv.divRight with
measurable_toFun := measurable_fst.prod_mk <| measurable_snd.div measurable_fst
measurable_invFun := measurable_fst.prod_mk <| measurable_snd.mul measurable_fst }
#align measurable_equiv.shear_div_right MeasurableEquiv.shearDivRight
#align measurable_equiv.shear_sub_right MeasurableEquiv.shearSubRight
variable {G}
namespace MeasureTheory
open Measure
section LeftInvariant
@[to_additive measurePreserving_prod_add
" The shear mapping `(x, y) ↦ (x, x + y)` preserves the measure `μ × ν`. "]
theorem measurePreserving_prod_mul [IsMulLeftInvariant ν] :
MeasurePreserving (fun z : G × G => (z.1, z.1 * z.2)) (μ.prod ν) (μ.prod ν) :=
(MeasurePreserving.id μ).skew_product measurable_mul <|
Filter.eventually_of_forall <| map_mul_left_eq_self ν
#align measure_theory.measure_preserving_prod_mul MeasureTheory.measurePreserving_prod_mul
#align measure_theory.measure_preserving_prod_add MeasureTheory.measurePreserving_prod_add
@[to_additive measurePreserving_prod_add_swap
" The map `(x, y) ↦ (y, y + x)` sends the measure `μ × ν` to `ν × μ`. "]
theorem measurePreserving_prod_mul_swap [IsMulLeftInvariant μ] :
MeasurePreserving (fun z : G × G => (z.2, z.2 * z.1)) (μ.prod ν) (ν.prod μ) :=
(measurePreserving_prod_mul ν μ).comp measurePreserving_swap
#align measure_theory.measure_preserving_prod_mul_swap MeasureTheory.measurePreserving_prod_mul_swap
#align measure_theory.measure_preserving_prod_add_swap MeasureTheory.measurePreserving_prod_add_swap
@[to_additive]
| Mathlib/MeasureTheory/Group/Prod.lean | 108 | 116 | theorem measurable_measure_mul_right (hs : MeasurableSet s) :
Measurable fun x => μ ((fun y => y * x) ⁻¹' s) := by |
suffices
Measurable fun y =>
μ ((fun x => (x, y)) ⁻¹' ((fun z : G × G => ((1 : G), z.1 * z.2)) ⁻¹' univ ×ˢ s))
by convert this using 1; ext1 x; congr 1 with y : 1; simp
apply measurable_measure_prod_mk_right
apply measurable_const.prod_mk measurable_mul (MeasurableSet.univ.prod hs)
infer_instance
| 411 |
import Mathlib.MeasureTheory.Constructions.Prod.Basic
import Mathlib.MeasureTheory.Group.Measure
#align_import measure_theory.group.prod from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
noncomputable section
open Set hiding prod_eq
open Function MeasureTheory
open Filter hiding map
open scoped Classical ENNReal Pointwise MeasureTheory
variable (G : Type*) [MeasurableSpace G]
variable [Group G] [MeasurableMul₂ G]
variable (μ ν : Measure G) [SigmaFinite ν] [SigmaFinite μ] {s : Set G}
@[to_additive "The map `(x, y) ↦ (x, x + y)` as a `MeasurableEquiv`."]
protected def MeasurableEquiv.shearMulRight [MeasurableInv G] : G × G ≃ᵐ G × G :=
{ Equiv.prodShear (Equiv.refl _) Equiv.mulLeft with
measurable_toFun := measurable_fst.prod_mk measurable_mul
measurable_invFun := measurable_fst.prod_mk <| measurable_fst.inv.mul measurable_snd }
#align measurable_equiv.shear_mul_right MeasurableEquiv.shearMulRight
#align measurable_equiv.shear_add_right MeasurableEquiv.shearAddRight
@[to_additive
"The map `(x, y) ↦ (x, y - x)` as a `MeasurableEquiv` with as inverse `(x, y) ↦ (x, y + x)`."]
protected def MeasurableEquiv.shearDivRight [MeasurableInv G] : G × G ≃ᵐ G × G :=
{ Equiv.prodShear (Equiv.refl _) Equiv.divRight with
measurable_toFun := measurable_fst.prod_mk <| measurable_snd.div measurable_fst
measurable_invFun := measurable_fst.prod_mk <| measurable_snd.mul measurable_fst }
#align measurable_equiv.shear_div_right MeasurableEquiv.shearDivRight
#align measurable_equiv.shear_sub_right MeasurableEquiv.shearSubRight
variable {G}
namespace MeasureTheory
open Measure
section LeftInvariant
@[to_additive measurePreserving_prod_add
" The shear mapping `(x, y) ↦ (x, x + y)` preserves the measure `μ × ν`. "]
theorem measurePreserving_prod_mul [IsMulLeftInvariant ν] :
MeasurePreserving (fun z : G × G => (z.1, z.1 * z.2)) (μ.prod ν) (μ.prod ν) :=
(MeasurePreserving.id μ).skew_product measurable_mul <|
Filter.eventually_of_forall <| map_mul_left_eq_self ν
#align measure_theory.measure_preserving_prod_mul MeasureTheory.measurePreserving_prod_mul
#align measure_theory.measure_preserving_prod_add MeasureTheory.measurePreserving_prod_add
@[to_additive measurePreserving_prod_add_swap
" The map `(x, y) ↦ (y, y + x)` sends the measure `μ × ν` to `ν × μ`. "]
theorem measurePreserving_prod_mul_swap [IsMulLeftInvariant μ] :
MeasurePreserving (fun z : G × G => (z.2, z.2 * z.1)) (μ.prod ν) (ν.prod μ) :=
(measurePreserving_prod_mul ν μ).comp measurePreserving_swap
#align measure_theory.measure_preserving_prod_mul_swap MeasureTheory.measurePreserving_prod_mul_swap
#align measure_theory.measure_preserving_prod_add_swap MeasureTheory.measurePreserving_prod_add_swap
@[to_additive]
theorem measurable_measure_mul_right (hs : MeasurableSet s) :
Measurable fun x => μ ((fun y => y * x) ⁻¹' s) := by
suffices
Measurable fun y =>
μ ((fun x => (x, y)) ⁻¹' ((fun z : G × G => ((1 : G), z.1 * z.2)) ⁻¹' univ ×ˢ s))
by convert this using 1; ext1 x; congr 1 with y : 1; simp
apply measurable_measure_prod_mk_right
apply measurable_const.prod_mk measurable_mul (MeasurableSet.univ.prod hs)
infer_instance
#align measure_theory.measurable_measure_mul_right MeasureTheory.measurable_measure_mul_right
#align measure_theory.measurable_measure_add_right MeasureTheory.measurable_measure_add_right
variable [MeasurableInv G]
@[to_additive measurePreserving_prod_neg_add
"The map `(x, y) ↦ (x, - x + y)` is measure-preserving."]
theorem measurePreserving_prod_inv_mul [IsMulLeftInvariant ν] :
MeasurePreserving (fun z : G × G => (z.1, z.1⁻¹ * z.2)) (μ.prod ν) (μ.prod ν) :=
(measurePreserving_prod_mul μ ν).symm <| MeasurableEquiv.shearMulRight G
#align measure_theory.measure_preserving_prod_inv_mul MeasureTheory.measurePreserving_prod_inv_mul
#align measure_theory.measure_preserving_prod_neg_add MeasureTheory.measurePreserving_prod_neg_add
variable [IsMulLeftInvariant μ]
@[to_additive measurePreserving_prod_neg_add_swap
"The map `(x, y) ↦ (y, - y + x)` sends `μ × ν` to `ν × μ`."]
theorem measurePreserving_prod_inv_mul_swap :
MeasurePreserving (fun z : G × G => (z.2, z.2⁻¹ * z.1)) (μ.prod ν) (ν.prod μ) :=
(measurePreserving_prod_inv_mul ν μ).comp measurePreserving_swap
#align measure_theory.measure_preserving_prod_inv_mul_swap MeasureTheory.measurePreserving_prod_inv_mul_swap
#align measure_theory.measure_preserving_prod_neg_add_swap MeasureTheory.measurePreserving_prod_neg_add_swap
@[to_additive measurePreserving_add_prod_neg
"The map `(x, y) ↦ (y + x, - x)` is measure-preserving."]
| Mathlib/MeasureTheory/Group/Prod.lean | 151 | 156 | theorem measurePreserving_mul_prod_inv [IsMulLeftInvariant ν] :
MeasurePreserving (fun z : G × G => (z.2 * z.1, z.1⁻¹)) (μ.prod ν) (μ.prod ν) := by |
convert (measurePreserving_prod_inv_mul_swap ν μ).comp (measurePreserving_prod_mul_swap μ ν)
using 1
ext1 ⟨x, y⟩
simp_rw [Function.comp_apply, mul_inv_rev, inv_mul_cancel_right]
| 411 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.