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.BigOperators.Group.Finset
import Mathlib.Data.List.MinMax
import Mathlib.Algebra.Tropical.Basic
import Mathlib.Order.ConditionallyCompleteLattice.Finset
#align_import algebra.tropical.big_operators from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce"
variable {R S : Type*}
open Tropical Finset
theorem List.trop_sum [AddMonoid R] (l : List R) : trop l.sum = List.prod (l.map trop) := by
induction' l with hd tl IH
Β· simp
Β· simp [β IH]
#align list.trop_sum List.trop_sum
theorem Multiset.trop_sum [AddCommMonoid R] (s : Multiset R) :
trop s.sum = Multiset.prod (s.map trop) :=
Quotient.inductionOn s (by simpa using List.trop_sum)
#align multiset.trop_sum Multiset.trop_sum
theorem trop_sum [AddCommMonoid R] (s : Finset S) (f : S β R) :
trop (β i β s, f i) = β i β s, trop (f i) := by
convert Multiset.trop_sum (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align trop_sum trop_sum
theorem List.untrop_prod [AddMonoid R] (l : List (Tropical R)) :
untrop l.prod = List.sum (l.map untrop) := by
induction' l with hd tl IH
Β· simp
Β· simp [β IH]
#align list.untrop_prod List.untrop_prod
theorem Multiset.untrop_prod [AddCommMonoid R] (s : Multiset (Tropical R)) :
untrop s.prod = Multiset.sum (s.map untrop) :=
Quotient.inductionOn s (by simpa using List.untrop_prod)
#align multiset.untrop_prod Multiset.untrop_prod
theorem untrop_prod [AddCommMonoid R] (s : Finset S) (f : S β Tropical R) :
untrop (β i β s, f i) = β i β s, untrop (f i) := by
convert Multiset.untrop_prod (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align untrop_prod untrop_prod
-- Porting note: replaced `coe` with `WithTop.some` in statement
theorem List.trop_minimum [LinearOrder R] (l : List R) :
trop l.minimum = List.sum (l.map (trop β WithTop.some)) := by
induction' l with hd tl IH
Β· simp
Β· simp [List.minimum_cons, β IH]
#align list.trop_minimum List.trop_minimum
| Mathlib/Algebra/Tropical/BigOperators.lean | 85 | 89 | theorem Multiset.trop_inf [LinearOrder R] [OrderTop R] (s : Multiset R) :
trop s.inf = Multiset.sum (s.map trop) := by |
induction' s using Multiset.induction with s x IH
Β· simp
Β· simp [β IH]
| 1,221 |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Data.List.MinMax
import Mathlib.Algebra.Tropical.Basic
import Mathlib.Order.ConditionallyCompleteLattice.Finset
#align_import algebra.tropical.big_operators from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce"
variable {R S : Type*}
open Tropical Finset
theorem List.trop_sum [AddMonoid R] (l : List R) : trop l.sum = List.prod (l.map trop) := by
induction' l with hd tl IH
Β· simp
Β· simp [β IH]
#align list.trop_sum List.trop_sum
theorem Multiset.trop_sum [AddCommMonoid R] (s : Multiset R) :
trop s.sum = Multiset.prod (s.map trop) :=
Quotient.inductionOn s (by simpa using List.trop_sum)
#align multiset.trop_sum Multiset.trop_sum
theorem trop_sum [AddCommMonoid R] (s : Finset S) (f : S β R) :
trop (β i β s, f i) = β i β s, trop (f i) := by
convert Multiset.trop_sum (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align trop_sum trop_sum
theorem List.untrop_prod [AddMonoid R] (l : List (Tropical R)) :
untrop l.prod = List.sum (l.map untrop) := by
induction' l with hd tl IH
Β· simp
Β· simp [β IH]
#align list.untrop_prod List.untrop_prod
theorem Multiset.untrop_prod [AddCommMonoid R] (s : Multiset (Tropical R)) :
untrop s.prod = Multiset.sum (s.map untrop) :=
Quotient.inductionOn s (by simpa using List.untrop_prod)
#align multiset.untrop_prod Multiset.untrop_prod
theorem untrop_prod [AddCommMonoid R] (s : Finset S) (f : S β Tropical R) :
untrop (β i β s, f i) = β i β s, untrop (f i) := by
convert Multiset.untrop_prod (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align untrop_prod untrop_prod
-- Porting note: replaced `coe` with `WithTop.some` in statement
theorem List.trop_minimum [LinearOrder R] (l : List R) :
trop l.minimum = List.sum (l.map (trop β WithTop.some)) := by
induction' l with hd tl IH
Β· simp
Β· simp [List.minimum_cons, β IH]
#align list.trop_minimum List.trop_minimum
theorem Multiset.trop_inf [LinearOrder R] [OrderTop R] (s : Multiset R) :
trop s.inf = Multiset.sum (s.map trop) := by
induction' s using Multiset.induction with s x IH
Β· simp
Β· simp [β IH]
#align multiset.trop_inf Multiset.trop_inf
| Mathlib/Algebra/Tropical/BigOperators.lean | 92 | 96 | theorem Finset.trop_inf [LinearOrder R] [OrderTop R] (s : Finset S) (f : S β R) :
trop (s.inf f) = β i β s, trop (f i) := by |
convert Multiset.trop_inf (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
| 1,221 |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Data.List.MinMax
import Mathlib.Algebra.Tropical.Basic
import Mathlib.Order.ConditionallyCompleteLattice.Finset
#align_import algebra.tropical.big_operators from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce"
variable {R S : Type*}
open Tropical Finset
theorem List.trop_sum [AddMonoid R] (l : List R) : trop l.sum = List.prod (l.map trop) := by
induction' l with hd tl IH
Β· simp
Β· simp [β IH]
#align list.trop_sum List.trop_sum
theorem Multiset.trop_sum [AddCommMonoid R] (s : Multiset R) :
trop s.sum = Multiset.prod (s.map trop) :=
Quotient.inductionOn s (by simpa using List.trop_sum)
#align multiset.trop_sum Multiset.trop_sum
theorem trop_sum [AddCommMonoid R] (s : Finset S) (f : S β R) :
trop (β i β s, f i) = β i β s, trop (f i) := by
convert Multiset.trop_sum (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align trop_sum trop_sum
theorem List.untrop_prod [AddMonoid R] (l : List (Tropical R)) :
untrop l.prod = List.sum (l.map untrop) := by
induction' l with hd tl IH
Β· simp
Β· simp [β IH]
#align list.untrop_prod List.untrop_prod
theorem Multiset.untrop_prod [AddCommMonoid R] (s : Multiset (Tropical R)) :
untrop s.prod = Multiset.sum (s.map untrop) :=
Quotient.inductionOn s (by simpa using List.untrop_prod)
#align multiset.untrop_prod Multiset.untrop_prod
theorem untrop_prod [AddCommMonoid R] (s : Finset S) (f : S β Tropical R) :
untrop (β i β s, f i) = β i β s, untrop (f i) := by
convert Multiset.untrop_prod (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align untrop_prod untrop_prod
-- Porting note: replaced `coe` with `WithTop.some` in statement
theorem List.trop_minimum [LinearOrder R] (l : List R) :
trop l.minimum = List.sum (l.map (trop β WithTop.some)) := by
induction' l with hd tl IH
Β· simp
Β· simp [List.minimum_cons, β IH]
#align list.trop_minimum List.trop_minimum
theorem Multiset.trop_inf [LinearOrder R] [OrderTop R] (s : Multiset R) :
trop s.inf = Multiset.sum (s.map trop) := by
induction' s using Multiset.induction with s x IH
Β· simp
Β· simp [β IH]
#align multiset.trop_inf Multiset.trop_inf
theorem Finset.trop_inf [LinearOrder R] [OrderTop R] (s : Finset S) (f : S β R) :
trop (s.inf f) = β i β s, trop (f i) := by
convert Multiset.trop_inf (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align finset.trop_inf Finset.trop_inf
| Mathlib/Algebra/Tropical/BigOperators.lean | 99 | 103 | theorem trop_sInf_image [ConditionallyCompleteLinearOrder R] (s : Finset S) (f : S β WithTop R) :
trop (sInf (f '' s)) = β i β s, trop (f i) := by |
rcases s.eq_empty_or_nonempty with (rfl | h)
Β· simp only [Set.image_empty, coe_empty, sum_empty, WithTop.sInf_empty, trop_top]
rw [β inf'_eq_csInf_image _ h, inf'_eq_inf, s.trop_inf]
| 1,221 |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Data.List.MinMax
import Mathlib.Algebra.Tropical.Basic
import Mathlib.Order.ConditionallyCompleteLattice.Finset
#align_import algebra.tropical.big_operators from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce"
variable {R S : Type*}
open Tropical Finset
theorem List.trop_sum [AddMonoid R] (l : List R) : trop l.sum = List.prod (l.map trop) := by
induction' l with hd tl IH
Β· simp
Β· simp [β IH]
#align list.trop_sum List.trop_sum
theorem Multiset.trop_sum [AddCommMonoid R] (s : Multiset R) :
trop s.sum = Multiset.prod (s.map trop) :=
Quotient.inductionOn s (by simpa using List.trop_sum)
#align multiset.trop_sum Multiset.trop_sum
theorem trop_sum [AddCommMonoid R] (s : Finset S) (f : S β R) :
trop (β i β s, f i) = β i β s, trop (f i) := by
convert Multiset.trop_sum (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align trop_sum trop_sum
theorem List.untrop_prod [AddMonoid R] (l : List (Tropical R)) :
untrop l.prod = List.sum (l.map untrop) := by
induction' l with hd tl IH
Β· simp
Β· simp [β IH]
#align list.untrop_prod List.untrop_prod
theorem Multiset.untrop_prod [AddCommMonoid R] (s : Multiset (Tropical R)) :
untrop s.prod = Multiset.sum (s.map untrop) :=
Quotient.inductionOn s (by simpa using List.untrop_prod)
#align multiset.untrop_prod Multiset.untrop_prod
theorem untrop_prod [AddCommMonoid R] (s : Finset S) (f : S β Tropical R) :
untrop (β i β s, f i) = β i β s, untrop (f i) := by
convert Multiset.untrop_prod (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align untrop_prod untrop_prod
-- Porting note: replaced `coe` with `WithTop.some` in statement
theorem List.trop_minimum [LinearOrder R] (l : List R) :
trop l.minimum = List.sum (l.map (trop β WithTop.some)) := by
induction' l with hd tl IH
Β· simp
Β· simp [List.minimum_cons, β IH]
#align list.trop_minimum List.trop_minimum
theorem Multiset.trop_inf [LinearOrder R] [OrderTop R] (s : Multiset R) :
trop s.inf = Multiset.sum (s.map trop) := by
induction' s using Multiset.induction with s x IH
Β· simp
Β· simp [β IH]
#align multiset.trop_inf Multiset.trop_inf
theorem Finset.trop_inf [LinearOrder R] [OrderTop R] (s : Finset S) (f : S β R) :
trop (s.inf f) = β i β s, trop (f i) := by
convert Multiset.trop_inf (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align finset.trop_inf Finset.trop_inf
theorem trop_sInf_image [ConditionallyCompleteLinearOrder R] (s : Finset S) (f : S β WithTop R) :
trop (sInf (f '' s)) = β i β s, trop (f i) := by
rcases s.eq_empty_or_nonempty with (rfl | h)
Β· simp only [Set.image_empty, coe_empty, sum_empty, WithTop.sInf_empty, trop_top]
rw [β inf'_eq_csInf_image _ h, inf'_eq_inf, s.trop_inf]
#align trop_Inf_image trop_sInf_image
| Mathlib/Algebra/Tropical/BigOperators.lean | 106 | 108 | theorem trop_iInf [ConditionallyCompleteLinearOrder R] [Fintype S] (f : S β WithTop R) :
trop (β¨
i : S, f i) = β i : S, trop (f i) := by |
rw [iInf, β Set.image_univ, β coe_univ, trop_sInf_image]
| 1,221 |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Data.List.MinMax
import Mathlib.Algebra.Tropical.Basic
import Mathlib.Order.ConditionallyCompleteLattice.Finset
#align_import algebra.tropical.big_operators from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce"
variable {R S : Type*}
open Tropical Finset
theorem List.trop_sum [AddMonoid R] (l : List R) : trop l.sum = List.prod (l.map trop) := by
induction' l with hd tl IH
Β· simp
Β· simp [β IH]
#align list.trop_sum List.trop_sum
theorem Multiset.trop_sum [AddCommMonoid R] (s : Multiset R) :
trop s.sum = Multiset.prod (s.map trop) :=
Quotient.inductionOn s (by simpa using List.trop_sum)
#align multiset.trop_sum Multiset.trop_sum
theorem trop_sum [AddCommMonoid R] (s : Finset S) (f : S β R) :
trop (β i β s, f i) = β i β s, trop (f i) := by
convert Multiset.trop_sum (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align trop_sum trop_sum
theorem List.untrop_prod [AddMonoid R] (l : List (Tropical R)) :
untrop l.prod = List.sum (l.map untrop) := by
induction' l with hd tl IH
Β· simp
Β· simp [β IH]
#align list.untrop_prod List.untrop_prod
theorem Multiset.untrop_prod [AddCommMonoid R] (s : Multiset (Tropical R)) :
untrop s.prod = Multiset.sum (s.map untrop) :=
Quotient.inductionOn s (by simpa using List.untrop_prod)
#align multiset.untrop_prod Multiset.untrop_prod
theorem untrop_prod [AddCommMonoid R] (s : Finset S) (f : S β Tropical R) :
untrop (β i β s, f i) = β i β s, untrop (f i) := by
convert Multiset.untrop_prod (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align untrop_prod untrop_prod
-- Porting note: replaced `coe` with `WithTop.some` in statement
theorem List.trop_minimum [LinearOrder R] (l : List R) :
trop l.minimum = List.sum (l.map (trop β WithTop.some)) := by
induction' l with hd tl IH
Β· simp
Β· simp [List.minimum_cons, β IH]
#align list.trop_minimum List.trop_minimum
theorem Multiset.trop_inf [LinearOrder R] [OrderTop R] (s : Multiset R) :
trop s.inf = Multiset.sum (s.map trop) := by
induction' s using Multiset.induction with s x IH
Β· simp
Β· simp [β IH]
#align multiset.trop_inf Multiset.trop_inf
theorem Finset.trop_inf [LinearOrder R] [OrderTop R] (s : Finset S) (f : S β R) :
trop (s.inf f) = β i β s, trop (f i) := by
convert Multiset.trop_inf (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align finset.trop_inf Finset.trop_inf
theorem trop_sInf_image [ConditionallyCompleteLinearOrder R] (s : Finset S) (f : S β WithTop R) :
trop (sInf (f '' s)) = β i β s, trop (f i) := by
rcases s.eq_empty_or_nonempty with (rfl | h)
Β· simp only [Set.image_empty, coe_empty, sum_empty, WithTop.sInf_empty, trop_top]
rw [β inf'_eq_csInf_image _ h, inf'_eq_inf, s.trop_inf]
#align trop_Inf_image trop_sInf_image
theorem trop_iInf [ConditionallyCompleteLinearOrder R] [Fintype S] (f : S β WithTop R) :
trop (β¨
i : S, f i) = β i : S, trop (f i) := by
rw [iInf, β Set.image_univ, β coe_univ, trop_sInf_image]
#align trop_infi trop_iInf
| Mathlib/Algebra/Tropical/BigOperators.lean | 111 | 116 | theorem Multiset.untrop_sum [LinearOrder R] [OrderTop R] (s : Multiset (Tropical R)) :
untrop s.sum = Multiset.inf (s.map untrop) := by |
induction' s using Multiset.induction with s x IH
Β· simp
Β· simp only [sum_cons, ge_iff_le, untrop_add, untrop_le_iff, map_cons, inf_cons, β IH]
rfl
| 1,221 |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Data.List.MinMax
import Mathlib.Algebra.Tropical.Basic
import Mathlib.Order.ConditionallyCompleteLattice.Finset
#align_import algebra.tropical.big_operators from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce"
variable {R S : Type*}
open Tropical Finset
theorem List.trop_sum [AddMonoid R] (l : List R) : trop l.sum = List.prod (l.map trop) := by
induction' l with hd tl IH
Β· simp
Β· simp [β IH]
#align list.trop_sum List.trop_sum
theorem Multiset.trop_sum [AddCommMonoid R] (s : Multiset R) :
trop s.sum = Multiset.prod (s.map trop) :=
Quotient.inductionOn s (by simpa using List.trop_sum)
#align multiset.trop_sum Multiset.trop_sum
theorem trop_sum [AddCommMonoid R] (s : Finset S) (f : S β R) :
trop (β i β s, f i) = β i β s, trop (f i) := by
convert Multiset.trop_sum (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align trop_sum trop_sum
theorem List.untrop_prod [AddMonoid R] (l : List (Tropical R)) :
untrop l.prod = List.sum (l.map untrop) := by
induction' l with hd tl IH
Β· simp
Β· simp [β IH]
#align list.untrop_prod List.untrop_prod
theorem Multiset.untrop_prod [AddCommMonoid R] (s : Multiset (Tropical R)) :
untrop s.prod = Multiset.sum (s.map untrop) :=
Quotient.inductionOn s (by simpa using List.untrop_prod)
#align multiset.untrop_prod Multiset.untrop_prod
theorem untrop_prod [AddCommMonoid R] (s : Finset S) (f : S β Tropical R) :
untrop (β i β s, f i) = β i β s, untrop (f i) := by
convert Multiset.untrop_prod (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align untrop_prod untrop_prod
-- Porting note: replaced `coe` with `WithTop.some` in statement
theorem List.trop_minimum [LinearOrder R] (l : List R) :
trop l.minimum = List.sum (l.map (trop β WithTop.some)) := by
induction' l with hd tl IH
Β· simp
Β· simp [List.minimum_cons, β IH]
#align list.trop_minimum List.trop_minimum
theorem Multiset.trop_inf [LinearOrder R] [OrderTop R] (s : Multiset R) :
trop s.inf = Multiset.sum (s.map trop) := by
induction' s using Multiset.induction with s x IH
Β· simp
Β· simp [β IH]
#align multiset.trop_inf Multiset.trop_inf
theorem Finset.trop_inf [LinearOrder R] [OrderTop R] (s : Finset S) (f : S β R) :
trop (s.inf f) = β i β s, trop (f i) := by
convert Multiset.trop_inf (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align finset.trop_inf Finset.trop_inf
theorem trop_sInf_image [ConditionallyCompleteLinearOrder R] (s : Finset S) (f : S β WithTop R) :
trop (sInf (f '' s)) = β i β s, trop (f i) := by
rcases s.eq_empty_or_nonempty with (rfl | h)
Β· simp only [Set.image_empty, coe_empty, sum_empty, WithTop.sInf_empty, trop_top]
rw [β inf'_eq_csInf_image _ h, inf'_eq_inf, s.trop_inf]
#align trop_Inf_image trop_sInf_image
theorem trop_iInf [ConditionallyCompleteLinearOrder R] [Fintype S] (f : S β WithTop R) :
trop (β¨
i : S, f i) = β i : S, trop (f i) := by
rw [iInf, β Set.image_univ, β coe_univ, trop_sInf_image]
#align trop_infi trop_iInf
theorem Multiset.untrop_sum [LinearOrder R] [OrderTop R] (s : Multiset (Tropical R)) :
untrop s.sum = Multiset.inf (s.map untrop) := by
induction' s using Multiset.induction with s x IH
Β· simp
Β· simp only [sum_cons, ge_iff_le, untrop_add, untrop_le_iff, map_cons, inf_cons, β IH]
rfl
#align multiset.untrop_sum Multiset.untrop_sum
| Mathlib/Algebra/Tropical/BigOperators.lean | 119 | 123 | theorem Finset.untrop_sum' [LinearOrder R] [OrderTop R] (s : Finset S) (f : S β Tropical R) :
untrop (β i β s, f i) = s.inf (untrop β f) := by |
convert Multiset.untrop_sum (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
| 1,221 |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Data.List.MinMax
import Mathlib.Algebra.Tropical.Basic
import Mathlib.Order.ConditionallyCompleteLattice.Finset
#align_import algebra.tropical.big_operators from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce"
variable {R S : Type*}
open Tropical Finset
theorem List.trop_sum [AddMonoid R] (l : List R) : trop l.sum = List.prod (l.map trop) := by
induction' l with hd tl IH
Β· simp
Β· simp [β IH]
#align list.trop_sum List.trop_sum
theorem Multiset.trop_sum [AddCommMonoid R] (s : Multiset R) :
trop s.sum = Multiset.prod (s.map trop) :=
Quotient.inductionOn s (by simpa using List.trop_sum)
#align multiset.trop_sum Multiset.trop_sum
theorem trop_sum [AddCommMonoid R] (s : Finset S) (f : S β R) :
trop (β i β s, f i) = β i β s, trop (f i) := by
convert Multiset.trop_sum (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align trop_sum trop_sum
theorem List.untrop_prod [AddMonoid R] (l : List (Tropical R)) :
untrop l.prod = List.sum (l.map untrop) := by
induction' l with hd tl IH
Β· simp
Β· simp [β IH]
#align list.untrop_prod List.untrop_prod
theorem Multiset.untrop_prod [AddCommMonoid R] (s : Multiset (Tropical R)) :
untrop s.prod = Multiset.sum (s.map untrop) :=
Quotient.inductionOn s (by simpa using List.untrop_prod)
#align multiset.untrop_prod Multiset.untrop_prod
theorem untrop_prod [AddCommMonoid R] (s : Finset S) (f : S β Tropical R) :
untrop (β i β s, f i) = β i β s, untrop (f i) := by
convert Multiset.untrop_prod (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align untrop_prod untrop_prod
-- Porting note: replaced `coe` with `WithTop.some` in statement
theorem List.trop_minimum [LinearOrder R] (l : List R) :
trop l.minimum = List.sum (l.map (trop β WithTop.some)) := by
induction' l with hd tl IH
Β· simp
Β· simp [List.minimum_cons, β IH]
#align list.trop_minimum List.trop_minimum
theorem Multiset.trop_inf [LinearOrder R] [OrderTop R] (s : Multiset R) :
trop s.inf = Multiset.sum (s.map trop) := by
induction' s using Multiset.induction with s x IH
Β· simp
Β· simp [β IH]
#align multiset.trop_inf Multiset.trop_inf
theorem Finset.trop_inf [LinearOrder R] [OrderTop R] (s : Finset S) (f : S β R) :
trop (s.inf f) = β i β s, trop (f i) := by
convert Multiset.trop_inf (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align finset.trop_inf Finset.trop_inf
theorem trop_sInf_image [ConditionallyCompleteLinearOrder R] (s : Finset S) (f : S β WithTop R) :
trop (sInf (f '' s)) = β i β s, trop (f i) := by
rcases s.eq_empty_or_nonempty with (rfl | h)
Β· simp only [Set.image_empty, coe_empty, sum_empty, WithTop.sInf_empty, trop_top]
rw [β inf'_eq_csInf_image _ h, inf'_eq_inf, s.trop_inf]
#align trop_Inf_image trop_sInf_image
theorem trop_iInf [ConditionallyCompleteLinearOrder R] [Fintype S] (f : S β WithTop R) :
trop (β¨
i : S, f i) = β i : S, trop (f i) := by
rw [iInf, β Set.image_univ, β coe_univ, trop_sInf_image]
#align trop_infi trop_iInf
theorem Multiset.untrop_sum [LinearOrder R] [OrderTop R] (s : Multiset (Tropical R)) :
untrop s.sum = Multiset.inf (s.map untrop) := by
induction' s using Multiset.induction with s x IH
Β· simp
Β· simp only [sum_cons, ge_iff_le, untrop_add, untrop_le_iff, map_cons, inf_cons, β IH]
rfl
#align multiset.untrop_sum Multiset.untrop_sum
theorem Finset.untrop_sum' [LinearOrder R] [OrderTop R] (s : Finset S) (f : S β Tropical R) :
untrop (β i β s, f i) = s.inf (untrop β f) := by
convert Multiset.untrop_sum (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align finset.untrop_sum' Finset.untrop_sum'
| Mathlib/Algebra/Tropical/BigOperators.lean | 126 | 130 | theorem untrop_sum_eq_sInf_image [ConditionallyCompleteLinearOrder R] (s : Finset S)
(f : S β Tropical (WithTop R)) : untrop (β i β s, f i) = sInf (untrop β f '' s) := by |
rcases s.eq_empty_or_nonempty with (rfl | h)
Β· simp only [Set.image_empty, coe_empty, sum_empty, WithTop.sInf_empty, untrop_zero]
Β· rw [β inf'_eq_csInf_image _ h, inf'_eq_inf, Finset.untrop_sum']
| 1,221 |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Data.List.MinMax
import Mathlib.Algebra.Tropical.Basic
import Mathlib.Order.ConditionallyCompleteLattice.Finset
#align_import algebra.tropical.big_operators from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce"
variable {R S : Type*}
open Tropical Finset
theorem List.trop_sum [AddMonoid R] (l : List R) : trop l.sum = List.prod (l.map trop) := by
induction' l with hd tl IH
Β· simp
Β· simp [β IH]
#align list.trop_sum List.trop_sum
theorem Multiset.trop_sum [AddCommMonoid R] (s : Multiset R) :
trop s.sum = Multiset.prod (s.map trop) :=
Quotient.inductionOn s (by simpa using List.trop_sum)
#align multiset.trop_sum Multiset.trop_sum
theorem trop_sum [AddCommMonoid R] (s : Finset S) (f : S β R) :
trop (β i β s, f i) = β i β s, trop (f i) := by
convert Multiset.trop_sum (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align trop_sum trop_sum
theorem List.untrop_prod [AddMonoid R] (l : List (Tropical R)) :
untrop l.prod = List.sum (l.map untrop) := by
induction' l with hd tl IH
Β· simp
Β· simp [β IH]
#align list.untrop_prod List.untrop_prod
theorem Multiset.untrop_prod [AddCommMonoid R] (s : Multiset (Tropical R)) :
untrop s.prod = Multiset.sum (s.map untrop) :=
Quotient.inductionOn s (by simpa using List.untrop_prod)
#align multiset.untrop_prod Multiset.untrop_prod
theorem untrop_prod [AddCommMonoid R] (s : Finset S) (f : S β Tropical R) :
untrop (β i β s, f i) = β i β s, untrop (f i) := by
convert Multiset.untrop_prod (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align untrop_prod untrop_prod
-- Porting note: replaced `coe` with `WithTop.some` in statement
theorem List.trop_minimum [LinearOrder R] (l : List R) :
trop l.minimum = List.sum (l.map (trop β WithTop.some)) := by
induction' l with hd tl IH
Β· simp
Β· simp [List.minimum_cons, β IH]
#align list.trop_minimum List.trop_minimum
theorem Multiset.trop_inf [LinearOrder R] [OrderTop R] (s : Multiset R) :
trop s.inf = Multiset.sum (s.map trop) := by
induction' s using Multiset.induction with s x IH
Β· simp
Β· simp [β IH]
#align multiset.trop_inf Multiset.trop_inf
theorem Finset.trop_inf [LinearOrder R] [OrderTop R] (s : Finset S) (f : S β R) :
trop (s.inf f) = β i β s, trop (f i) := by
convert Multiset.trop_inf (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align finset.trop_inf Finset.trop_inf
theorem trop_sInf_image [ConditionallyCompleteLinearOrder R] (s : Finset S) (f : S β WithTop R) :
trop (sInf (f '' s)) = β i β s, trop (f i) := by
rcases s.eq_empty_or_nonempty with (rfl | h)
Β· simp only [Set.image_empty, coe_empty, sum_empty, WithTop.sInf_empty, trop_top]
rw [β inf'_eq_csInf_image _ h, inf'_eq_inf, s.trop_inf]
#align trop_Inf_image trop_sInf_image
theorem trop_iInf [ConditionallyCompleteLinearOrder R] [Fintype S] (f : S β WithTop R) :
trop (β¨
i : S, f i) = β i : S, trop (f i) := by
rw [iInf, β Set.image_univ, β coe_univ, trop_sInf_image]
#align trop_infi trop_iInf
theorem Multiset.untrop_sum [LinearOrder R] [OrderTop R] (s : Multiset (Tropical R)) :
untrop s.sum = Multiset.inf (s.map untrop) := by
induction' s using Multiset.induction with s x IH
Β· simp
Β· simp only [sum_cons, ge_iff_le, untrop_add, untrop_le_iff, map_cons, inf_cons, β IH]
rfl
#align multiset.untrop_sum Multiset.untrop_sum
theorem Finset.untrop_sum' [LinearOrder R] [OrderTop R] (s : Finset S) (f : S β Tropical R) :
untrop (β i β s, f i) = s.inf (untrop β f) := by
convert Multiset.untrop_sum (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align finset.untrop_sum' Finset.untrop_sum'
theorem untrop_sum_eq_sInf_image [ConditionallyCompleteLinearOrder R] (s : Finset S)
(f : S β Tropical (WithTop R)) : untrop (β i β s, f i) = sInf (untrop β f '' s) := by
rcases s.eq_empty_or_nonempty with (rfl | h)
Β· simp only [Set.image_empty, coe_empty, sum_empty, WithTop.sInf_empty, untrop_zero]
Β· rw [β inf'_eq_csInf_image _ h, inf'_eq_inf, Finset.untrop_sum']
#align untrop_sum_eq_Inf_image untrop_sum_eq_sInf_image
| Mathlib/Algebra/Tropical/BigOperators.lean | 133 | 136 | theorem untrop_sum [ConditionallyCompleteLinearOrder R] [Fintype S] (f : S β Tropical (WithTop R)) :
untrop (β i : S, f i) = β¨
i : S, untrop (f i) := by |
rw [iInf,β Set.image_univ,β coe_univ, untrop_sum_eq_sInf_image]
rfl
| 1,221 |
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Data.List.MinMax
import Mathlib.Algebra.Tropical.Basic
import Mathlib.Order.ConditionallyCompleteLattice.Finset
#align_import algebra.tropical.big_operators from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce"
variable {R S : Type*}
open Tropical Finset
theorem List.trop_sum [AddMonoid R] (l : List R) : trop l.sum = List.prod (l.map trop) := by
induction' l with hd tl IH
Β· simp
Β· simp [β IH]
#align list.trop_sum List.trop_sum
theorem Multiset.trop_sum [AddCommMonoid R] (s : Multiset R) :
trop s.sum = Multiset.prod (s.map trop) :=
Quotient.inductionOn s (by simpa using List.trop_sum)
#align multiset.trop_sum Multiset.trop_sum
theorem trop_sum [AddCommMonoid R] (s : Finset S) (f : S β R) :
trop (β i β s, f i) = β i β s, trop (f i) := by
convert Multiset.trop_sum (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align trop_sum trop_sum
theorem List.untrop_prod [AddMonoid R] (l : List (Tropical R)) :
untrop l.prod = List.sum (l.map untrop) := by
induction' l with hd tl IH
Β· simp
Β· simp [β IH]
#align list.untrop_prod List.untrop_prod
theorem Multiset.untrop_prod [AddCommMonoid R] (s : Multiset (Tropical R)) :
untrop s.prod = Multiset.sum (s.map untrop) :=
Quotient.inductionOn s (by simpa using List.untrop_prod)
#align multiset.untrop_prod Multiset.untrop_prod
theorem untrop_prod [AddCommMonoid R] (s : Finset S) (f : S β Tropical R) :
untrop (β i β s, f i) = β i β s, untrop (f i) := by
convert Multiset.untrop_prod (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align untrop_prod untrop_prod
-- Porting note: replaced `coe` with `WithTop.some` in statement
theorem List.trop_minimum [LinearOrder R] (l : List R) :
trop l.minimum = List.sum (l.map (trop β WithTop.some)) := by
induction' l with hd tl IH
Β· simp
Β· simp [List.minimum_cons, β IH]
#align list.trop_minimum List.trop_minimum
theorem Multiset.trop_inf [LinearOrder R] [OrderTop R] (s : Multiset R) :
trop s.inf = Multiset.sum (s.map trop) := by
induction' s using Multiset.induction with s x IH
Β· simp
Β· simp [β IH]
#align multiset.trop_inf Multiset.trop_inf
theorem Finset.trop_inf [LinearOrder R] [OrderTop R] (s : Finset S) (f : S β R) :
trop (s.inf f) = β i β s, trop (f i) := by
convert Multiset.trop_inf (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align finset.trop_inf Finset.trop_inf
theorem trop_sInf_image [ConditionallyCompleteLinearOrder R] (s : Finset S) (f : S β WithTop R) :
trop (sInf (f '' s)) = β i β s, trop (f i) := by
rcases s.eq_empty_or_nonempty with (rfl | h)
Β· simp only [Set.image_empty, coe_empty, sum_empty, WithTop.sInf_empty, trop_top]
rw [β inf'_eq_csInf_image _ h, inf'_eq_inf, s.trop_inf]
#align trop_Inf_image trop_sInf_image
theorem trop_iInf [ConditionallyCompleteLinearOrder R] [Fintype S] (f : S β WithTop R) :
trop (β¨
i : S, f i) = β i : S, trop (f i) := by
rw [iInf, β Set.image_univ, β coe_univ, trop_sInf_image]
#align trop_infi trop_iInf
theorem Multiset.untrop_sum [LinearOrder R] [OrderTop R] (s : Multiset (Tropical R)) :
untrop s.sum = Multiset.inf (s.map untrop) := by
induction' s using Multiset.induction with s x IH
Β· simp
Β· simp only [sum_cons, ge_iff_le, untrop_add, untrop_le_iff, map_cons, inf_cons, β IH]
rfl
#align multiset.untrop_sum Multiset.untrop_sum
theorem Finset.untrop_sum' [LinearOrder R] [OrderTop R] (s : Finset S) (f : S β Tropical R) :
untrop (β i β s, f i) = s.inf (untrop β f) := by
convert Multiset.untrop_sum (s.val.map f)
simp only [Multiset.map_map, Function.comp_apply]
rfl
#align finset.untrop_sum' Finset.untrop_sum'
theorem untrop_sum_eq_sInf_image [ConditionallyCompleteLinearOrder R] (s : Finset S)
(f : S β Tropical (WithTop R)) : untrop (β i β s, f i) = sInf (untrop β f '' s) := by
rcases s.eq_empty_or_nonempty with (rfl | h)
Β· simp only [Set.image_empty, coe_empty, sum_empty, WithTop.sInf_empty, untrop_zero]
Β· rw [β inf'_eq_csInf_image _ h, inf'_eq_inf, Finset.untrop_sum']
#align untrop_sum_eq_Inf_image untrop_sum_eq_sInf_image
theorem untrop_sum [ConditionallyCompleteLinearOrder R] [Fintype S] (f : S β Tropical (WithTop R)) :
untrop (β i : S, f i) = β¨
i : S, untrop (f i) := by
rw [iInf,β Set.image_univ,β coe_univ, untrop_sum_eq_sInf_image]
rfl
#align untrop_sum untrop_sum
| Mathlib/Algebra/Tropical/BigOperators.lean | 141 | 143 | theorem Finset.untrop_sum [ConditionallyCompleteLinearOrder R] (s : Finset S)
(f : S β Tropical (WithTop R)) : untrop (β i β s, f i) = β¨
i : s, untrop (f i) := by |
simpa [β _root_.untrop_sum] using (sum_attach _ _).symm
| 1,221 |
import Mathlib.Algebra.Group.Commute.Units
import Mathlib.Algebra.Group.Int
import Mathlib.Algebra.GroupWithZero.Semiconj
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Bounds.Basic
#align_import data.int.gcd from "leanprover-community/mathlib"@"47a1a73351de8dd6c8d3d32b569c8e434b03ca47"
namespace Nat
def xgcdAux : β β β€ β β€ β β β β€ β β€ β β Γ β€ Γ β€
| 0, _, _, r', s', t' => (r', s', t')
| succ k, s, t, r', s', t' =>
let q := r' / succ k
xgcdAux (r' % succ k) (s' - q * s) (t' - q * t) (succ k) s t
termination_by k => k
decreasing_by exact mod_lt _ <| (succ_pos _).gt
#align nat.xgcd_aux Nat.xgcdAux
@[simp]
| Mathlib/Data/Int/GCD.lean | 48 | 48 | theorem xgcd_zero_left {s t r' s' t'} : xgcdAux 0 s t r' s' t' = (r', s', t') := by | simp [xgcdAux]
| 1,222 |
import Mathlib.Algebra.Group.Commute.Units
import Mathlib.Algebra.Group.Int
import Mathlib.Algebra.GroupWithZero.Semiconj
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Bounds.Basic
#align_import data.int.gcd from "leanprover-community/mathlib"@"47a1a73351de8dd6c8d3d32b569c8e434b03ca47"
namespace Nat
def xgcdAux : β β β€ β β€ β β β β€ β β€ β β Γ β€ Γ β€
| 0, _, _, r', s', t' => (r', s', t')
| succ k, s, t, r', s', t' =>
let q := r' / succ k
xgcdAux (r' % succ k) (s' - q * s) (t' - q * t) (succ k) s t
termination_by k => k
decreasing_by exact mod_lt _ <| (succ_pos _).gt
#align nat.xgcd_aux Nat.xgcdAux
@[simp]
theorem xgcd_zero_left {s t r' s' t'} : xgcdAux 0 s t r' s' t' = (r', s', t') := by simp [xgcdAux]
#align nat.xgcd_zero_left Nat.xgcd_zero_left
| Mathlib/Data/Int/GCD.lean | 51 | 54 | theorem xgcdAux_rec {r s t r' s' t'} (h : 0 < r) :
xgcdAux r s t r' s' t' = xgcdAux (r' % r) (s' - r' / r * s) (t' - r' / r * t) r s t := by |
obtain β¨r, rflβ© := Nat.exists_eq_succ_of_ne_zero h.ne'
simp [xgcdAux]
| 1,222 |
import Mathlib.Algebra.Group.Commute.Units
import Mathlib.Algebra.Group.Int
import Mathlib.Algebra.GroupWithZero.Semiconj
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Bounds.Basic
#align_import data.int.gcd from "leanprover-community/mathlib"@"47a1a73351de8dd6c8d3d32b569c8e434b03ca47"
namespace Nat
def xgcdAux : β β β€ β β€ β β β β€ β β€ β β Γ β€ Γ β€
| 0, _, _, r', s', t' => (r', s', t')
| succ k, s, t, r', s', t' =>
let q := r' / succ k
xgcdAux (r' % succ k) (s' - q * s) (t' - q * t) (succ k) s t
termination_by k => k
decreasing_by exact mod_lt _ <| (succ_pos _).gt
#align nat.xgcd_aux Nat.xgcdAux
@[simp]
theorem xgcd_zero_left {s t r' s' t'} : xgcdAux 0 s t r' s' t' = (r', s', t') := by simp [xgcdAux]
#align nat.xgcd_zero_left Nat.xgcd_zero_left
theorem xgcdAux_rec {r s t r' s' t'} (h : 0 < r) :
xgcdAux r s t r' s' t' = xgcdAux (r' % r) (s' - r' / r * s) (t' - r' / r * t) r s t := by
obtain β¨r, rflβ© := Nat.exists_eq_succ_of_ne_zero h.ne'
simp [xgcdAux]
#align nat.xgcd_aux_rec Nat.xgcdAux_rec
def xgcd (x y : β) : β€ Γ β€ :=
(xgcdAux x 1 0 y 0 1).2
#align nat.xgcd Nat.xgcd
def gcdA (x y : β) : β€ :=
(xgcd x y).1
#align nat.gcd_a Nat.gcdA
def gcdB (x y : β) : β€ :=
(xgcd x y).2
#align nat.gcd_b Nat.gcdB
@[simp]
| Mathlib/Data/Int/GCD.lean | 74 | 76 | theorem gcdA_zero_left {s : β} : gcdA 0 s = 0 := by |
unfold gcdA
rw [xgcd, xgcd_zero_left]
| 1,222 |
import Mathlib.Algebra.Group.Commute.Units
import Mathlib.Algebra.Group.Int
import Mathlib.Algebra.GroupWithZero.Semiconj
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Bounds.Basic
#align_import data.int.gcd from "leanprover-community/mathlib"@"47a1a73351de8dd6c8d3d32b569c8e434b03ca47"
namespace Nat
def xgcdAux : β β β€ β β€ β β β β€ β β€ β β Γ β€ Γ β€
| 0, _, _, r', s', t' => (r', s', t')
| succ k, s, t, r', s', t' =>
let q := r' / succ k
xgcdAux (r' % succ k) (s' - q * s) (t' - q * t) (succ k) s t
termination_by k => k
decreasing_by exact mod_lt _ <| (succ_pos _).gt
#align nat.xgcd_aux Nat.xgcdAux
@[simp]
theorem xgcd_zero_left {s t r' s' t'} : xgcdAux 0 s t r' s' t' = (r', s', t') := by simp [xgcdAux]
#align nat.xgcd_zero_left Nat.xgcd_zero_left
theorem xgcdAux_rec {r s t r' s' t'} (h : 0 < r) :
xgcdAux r s t r' s' t' = xgcdAux (r' % r) (s' - r' / r * s) (t' - r' / r * t) r s t := by
obtain β¨r, rflβ© := Nat.exists_eq_succ_of_ne_zero h.ne'
simp [xgcdAux]
#align nat.xgcd_aux_rec Nat.xgcdAux_rec
def xgcd (x y : β) : β€ Γ β€ :=
(xgcdAux x 1 0 y 0 1).2
#align nat.xgcd Nat.xgcd
def gcdA (x y : β) : β€ :=
(xgcd x y).1
#align nat.gcd_a Nat.gcdA
def gcdB (x y : β) : β€ :=
(xgcd x y).2
#align nat.gcd_b Nat.gcdB
@[simp]
theorem gcdA_zero_left {s : β} : gcdA 0 s = 0 := by
unfold gcdA
rw [xgcd, xgcd_zero_left]
#align nat.gcd_a_zero_left Nat.gcdA_zero_left
@[simp]
| Mathlib/Data/Int/GCD.lean | 80 | 82 | theorem gcdB_zero_left {s : β} : gcdB 0 s = 1 := by |
unfold gcdB
rw [xgcd, xgcd_zero_left]
| 1,222 |
import Mathlib.Algebra.Group.Commute.Units
import Mathlib.Algebra.Group.Int
import Mathlib.Algebra.GroupWithZero.Semiconj
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Bounds.Basic
#align_import data.int.gcd from "leanprover-community/mathlib"@"47a1a73351de8dd6c8d3d32b569c8e434b03ca47"
namespace Nat
def xgcdAux : β β β€ β β€ β β β β€ β β€ β β Γ β€ Γ β€
| 0, _, _, r', s', t' => (r', s', t')
| succ k, s, t, r', s', t' =>
let q := r' / succ k
xgcdAux (r' % succ k) (s' - q * s) (t' - q * t) (succ k) s t
termination_by k => k
decreasing_by exact mod_lt _ <| (succ_pos _).gt
#align nat.xgcd_aux Nat.xgcdAux
@[simp]
theorem xgcd_zero_left {s t r' s' t'} : xgcdAux 0 s t r' s' t' = (r', s', t') := by simp [xgcdAux]
#align nat.xgcd_zero_left Nat.xgcd_zero_left
theorem xgcdAux_rec {r s t r' s' t'} (h : 0 < r) :
xgcdAux r s t r' s' t' = xgcdAux (r' % r) (s' - r' / r * s) (t' - r' / r * t) r s t := by
obtain β¨r, rflβ© := Nat.exists_eq_succ_of_ne_zero h.ne'
simp [xgcdAux]
#align nat.xgcd_aux_rec Nat.xgcdAux_rec
def xgcd (x y : β) : β€ Γ β€ :=
(xgcdAux x 1 0 y 0 1).2
#align nat.xgcd Nat.xgcd
def gcdA (x y : β) : β€ :=
(xgcd x y).1
#align nat.gcd_a Nat.gcdA
def gcdB (x y : β) : β€ :=
(xgcd x y).2
#align nat.gcd_b Nat.gcdB
@[simp]
theorem gcdA_zero_left {s : β} : gcdA 0 s = 0 := by
unfold gcdA
rw [xgcd, xgcd_zero_left]
#align nat.gcd_a_zero_left Nat.gcdA_zero_left
@[simp]
theorem gcdB_zero_left {s : β} : gcdB 0 s = 1 := by
unfold gcdB
rw [xgcd, xgcd_zero_left]
#align nat.gcd_b_zero_left Nat.gcdB_zero_left
@[simp]
| Mathlib/Data/Int/GCD.lean | 86 | 90 | theorem gcdA_zero_right {s : β} (h : s β 0) : gcdA s 0 = 1 := by |
unfold gcdA xgcd
obtain β¨s, rflβ© := Nat.exists_eq_succ_of_ne_zero h
rw [xgcdAux]
simp
| 1,222 |
import Mathlib.Algebra.Group.Commute.Units
import Mathlib.Algebra.Group.Int
import Mathlib.Algebra.GroupWithZero.Semiconj
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Bounds.Basic
#align_import data.int.gcd from "leanprover-community/mathlib"@"47a1a73351de8dd6c8d3d32b569c8e434b03ca47"
namespace Nat
def xgcdAux : β β β€ β β€ β β β β€ β β€ β β Γ β€ Γ β€
| 0, _, _, r', s', t' => (r', s', t')
| succ k, s, t, r', s', t' =>
let q := r' / succ k
xgcdAux (r' % succ k) (s' - q * s) (t' - q * t) (succ k) s t
termination_by k => k
decreasing_by exact mod_lt _ <| (succ_pos _).gt
#align nat.xgcd_aux Nat.xgcdAux
@[simp]
theorem xgcd_zero_left {s t r' s' t'} : xgcdAux 0 s t r' s' t' = (r', s', t') := by simp [xgcdAux]
#align nat.xgcd_zero_left Nat.xgcd_zero_left
theorem xgcdAux_rec {r s t r' s' t'} (h : 0 < r) :
xgcdAux r s t r' s' t' = xgcdAux (r' % r) (s' - r' / r * s) (t' - r' / r * t) r s t := by
obtain β¨r, rflβ© := Nat.exists_eq_succ_of_ne_zero h.ne'
simp [xgcdAux]
#align nat.xgcd_aux_rec Nat.xgcdAux_rec
def xgcd (x y : β) : β€ Γ β€ :=
(xgcdAux x 1 0 y 0 1).2
#align nat.xgcd Nat.xgcd
def gcdA (x y : β) : β€ :=
(xgcd x y).1
#align nat.gcd_a Nat.gcdA
def gcdB (x y : β) : β€ :=
(xgcd x y).2
#align nat.gcd_b Nat.gcdB
@[simp]
theorem gcdA_zero_left {s : β} : gcdA 0 s = 0 := by
unfold gcdA
rw [xgcd, xgcd_zero_left]
#align nat.gcd_a_zero_left Nat.gcdA_zero_left
@[simp]
theorem gcdB_zero_left {s : β} : gcdB 0 s = 1 := by
unfold gcdB
rw [xgcd, xgcd_zero_left]
#align nat.gcd_b_zero_left Nat.gcdB_zero_left
@[simp]
theorem gcdA_zero_right {s : β} (h : s β 0) : gcdA s 0 = 1 := by
unfold gcdA xgcd
obtain β¨s, rflβ© := Nat.exists_eq_succ_of_ne_zero h
rw [xgcdAux]
simp
#align nat.gcd_a_zero_right Nat.gcdA_zero_right
@[simp]
| Mathlib/Data/Int/GCD.lean | 94 | 98 | theorem gcdB_zero_right {s : β} (h : s β 0) : gcdB s 0 = 0 := by |
unfold gcdB xgcd
obtain β¨s, rflβ© := Nat.exists_eq_succ_of_ne_zero h
rw [xgcdAux]
simp
| 1,222 |
import Mathlib.Algebra.Group.Commute.Units
import Mathlib.Algebra.Group.Int
import Mathlib.Algebra.GroupWithZero.Semiconj
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Bounds.Basic
#align_import data.int.gcd from "leanprover-community/mathlib"@"47a1a73351de8dd6c8d3d32b569c8e434b03ca47"
namespace Nat
def xgcdAux : β β β€ β β€ β β β β€ β β€ β β Γ β€ Γ β€
| 0, _, _, r', s', t' => (r', s', t')
| succ k, s, t, r', s', t' =>
let q := r' / succ k
xgcdAux (r' % succ k) (s' - q * s) (t' - q * t) (succ k) s t
termination_by k => k
decreasing_by exact mod_lt _ <| (succ_pos _).gt
#align nat.xgcd_aux Nat.xgcdAux
@[simp]
theorem xgcd_zero_left {s t r' s' t'} : xgcdAux 0 s t r' s' t' = (r', s', t') := by simp [xgcdAux]
#align nat.xgcd_zero_left Nat.xgcd_zero_left
theorem xgcdAux_rec {r s t r' s' t'} (h : 0 < r) :
xgcdAux r s t r' s' t' = xgcdAux (r' % r) (s' - r' / r * s) (t' - r' / r * t) r s t := by
obtain β¨r, rflβ© := Nat.exists_eq_succ_of_ne_zero h.ne'
simp [xgcdAux]
#align nat.xgcd_aux_rec Nat.xgcdAux_rec
def xgcd (x y : β) : β€ Γ β€ :=
(xgcdAux x 1 0 y 0 1).2
#align nat.xgcd Nat.xgcd
def gcdA (x y : β) : β€ :=
(xgcd x y).1
#align nat.gcd_a Nat.gcdA
def gcdB (x y : β) : β€ :=
(xgcd x y).2
#align nat.gcd_b Nat.gcdB
@[simp]
theorem gcdA_zero_left {s : β} : gcdA 0 s = 0 := by
unfold gcdA
rw [xgcd, xgcd_zero_left]
#align nat.gcd_a_zero_left Nat.gcdA_zero_left
@[simp]
theorem gcdB_zero_left {s : β} : gcdB 0 s = 1 := by
unfold gcdB
rw [xgcd, xgcd_zero_left]
#align nat.gcd_b_zero_left Nat.gcdB_zero_left
@[simp]
theorem gcdA_zero_right {s : β} (h : s β 0) : gcdA s 0 = 1 := by
unfold gcdA xgcd
obtain β¨s, rflβ© := Nat.exists_eq_succ_of_ne_zero h
rw [xgcdAux]
simp
#align nat.gcd_a_zero_right Nat.gcdA_zero_right
@[simp]
theorem gcdB_zero_right {s : β} (h : s β 0) : gcdB s 0 = 0 := by
unfold gcdB xgcd
obtain β¨s, rflβ© := Nat.exists_eq_succ_of_ne_zero h
rw [xgcdAux]
simp
#align nat.gcd_b_zero_right Nat.gcdB_zero_right
@[simp]
theorem xgcdAux_fst (x y) : β s t s' t', (xgcdAux x s t y s' t').1 = gcd x y :=
gcd.induction x y (by simp) fun x y h IH s t s' t' => by
simp only [h, xgcdAux_rec, IH]
rw [β gcd_rec]
#align nat.xgcd_aux_fst Nat.xgcdAux_fst
| Mathlib/Data/Int/GCD.lean | 108 | 109 | theorem xgcdAux_val (x y) : xgcdAux x 1 0 y 0 1 = (gcd x y, xgcd x y) := by |
rw [xgcd, β xgcdAux_fst x y 1 0 0 1]
| 1,222 |
import Mathlib.Algebra.Group.Commute.Units
import Mathlib.Algebra.Group.Int
import Mathlib.Algebra.GroupWithZero.Semiconj
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Bounds.Basic
#align_import data.int.gcd from "leanprover-community/mathlib"@"47a1a73351de8dd6c8d3d32b569c8e434b03ca47"
namespace Nat
def xgcdAux : β β β€ β β€ β β β β€ β β€ β β Γ β€ Γ β€
| 0, _, _, r', s', t' => (r', s', t')
| succ k, s, t, r', s', t' =>
let q := r' / succ k
xgcdAux (r' % succ k) (s' - q * s) (t' - q * t) (succ k) s t
termination_by k => k
decreasing_by exact mod_lt _ <| (succ_pos _).gt
#align nat.xgcd_aux Nat.xgcdAux
@[simp]
theorem xgcd_zero_left {s t r' s' t'} : xgcdAux 0 s t r' s' t' = (r', s', t') := by simp [xgcdAux]
#align nat.xgcd_zero_left Nat.xgcd_zero_left
theorem xgcdAux_rec {r s t r' s' t'} (h : 0 < r) :
xgcdAux r s t r' s' t' = xgcdAux (r' % r) (s' - r' / r * s) (t' - r' / r * t) r s t := by
obtain β¨r, rflβ© := Nat.exists_eq_succ_of_ne_zero h.ne'
simp [xgcdAux]
#align nat.xgcd_aux_rec Nat.xgcdAux_rec
def xgcd (x y : β) : β€ Γ β€ :=
(xgcdAux x 1 0 y 0 1).2
#align nat.xgcd Nat.xgcd
def gcdA (x y : β) : β€ :=
(xgcd x y).1
#align nat.gcd_a Nat.gcdA
def gcdB (x y : β) : β€ :=
(xgcd x y).2
#align nat.gcd_b Nat.gcdB
@[simp]
theorem gcdA_zero_left {s : β} : gcdA 0 s = 0 := by
unfold gcdA
rw [xgcd, xgcd_zero_left]
#align nat.gcd_a_zero_left Nat.gcdA_zero_left
@[simp]
theorem gcdB_zero_left {s : β} : gcdB 0 s = 1 := by
unfold gcdB
rw [xgcd, xgcd_zero_left]
#align nat.gcd_b_zero_left Nat.gcdB_zero_left
@[simp]
theorem gcdA_zero_right {s : β} (h : s β 0) : gcdA s 0 = 1 := by
unfold gcdA xgcd
obtain β¨s, rflβ© := Nat.exists_eq_succ_of_ne_zero h
rw [xgcdAux]
simp
#align nat.gcd_a_zero_right Nat.gcdA_zero_right
@[simp]
theorem gcdB_zero_right {s : β} (h : s β 0) : gcdB s 0 = 0 := by
unfold gcdB xgcd
obtain β¨s, rflβ© := Nat.exists_eq_succ_of_ne_zero h
rw [xgcdAux]
simp
#align nat.gcd_b_zero_right Nat.gcdB_zero_right
@[simp]
theorem xgcdAux_fst (x y) : β s t s' t', (xgcdAux x s t y s' t').1 = gcd x y :=
gcd.induction x y (by simp) fun x y h IH s t s' t' => by
simp only [h, xgcdAux_rec, IH]
rw [β gcd_rec]
#align nat.xgcd_aux_fst Nat.xgcdAux_fst
theorem xgcdAux_val (x y) : xgcdAux x 1 0 y 0 1 = (gcd x y, xgcd x y) := by
rw [xgcd, β xgcdAux_fst x y 1 0 0 1]
#align nat.xgcd_aux_val Nat.xgcdAux_val
| Mathlib/Data/Int/GCD.lean | 112 | 113 | theorem xgcd_val (x y) : xgcd x y = (gcdA x y, gcdB x y) := by |
unfold gcdA gcdB; cases xgcd x y; rfl
| 1,222 |
import Mathlib.Algebra.Group.Commute.Units
import Mathlib.Algebra.Group.Int
import Mathlib.Algebra.GroupWithZero.Semiconj
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Bounds.Basic
#align_import data.int.gcd from "leanprover-community/mathlib"@"47a1a73351de8dd6c8d3d32b569c8e434b03ca47"
namespace Nat
def xgcdAux : β β β€ β β€ β β β β€ β β€ β β Γ β€ Γ β€
| 0, _, _, r', s', t' => (r', s', t')
| succ k, s, t, r', s', t' =>
let q := r' / succ k
xgcdAux (r' % succ k) (s' - q * s) (t' - q * t) (succ k) s t
termination_by k => k
decreasing_by exact mod_lt _ <| (succ_pos _).gt
#align nat.xgcd_aux Nat.xgcdAux
@[simp]
theorem xgcd_zero_left {s t r' s' t'} : xgcdAux 0 s t r' s' t' = (r', s', t') := by simp [xgcdAux]
#align nat.xgcd_zero_left Nat.xgcd_zero_left
theorem xgcdAux_rec {r s t r' s' t'} (h : 0 < r) :
xgcdAux r s t r' s' t' = xgcdAux (r' % r) (s' - r' / r * s) (t' - r' / r * t) r s t := by
obtain β¨r, rflβ© := Nat.exists_eq_succ_of_ne_zero h.ne'
simp [xgcdAux]
#align nat.xgcd_aux_rec Nat.xgcdAux_rec
def xgcd (x y : β) : β€ Γ β€ :=
(xgcdAux x 1 0 y 0 1).2
#align nat.xgcd Nat.xgcd
def gcdA (x y : β) : β€ :=
(xgcd x y).1
#align nat.gcd_a Nat.gcdA
def gcdB (x y : β) : β€ :=
(xgcd x y).2
#align nat.gcd_b Nat.gcdB
@[simp]
theorem gcdA_zero_left {s : β} : gcdA 0 s = 0 := by
unfold gcdA
rw [xgcd, xgcd_zero_left]
#align nat.gcd_a_zero_left Nat.gcdA_zero_left
@[simp]
theorem gcdB_zero_left {s : β} : gcdB 0 s = 1 := by
unfold gcdB
rw [xgcd, xgcd_zero_left]
#align nat.gcd_b_zero_left Nat.gcdB_zero_left
@[simp]
theorem gcdA_zero_right {s : β} (h : s β 0) : gcdA s 0 = 1 := by
unfold gcdA xgcd
obtain β¨s, rflβ© := Nat.exists_eq_succ_of_ne_zero h
rw [xgcdAux]
simp
#align nat.gcd_a_zero_right Nat.gcdA_zero_right
@[simp]
theorem gcdB_zero_right {s : β} (h : s β 0) : gcdB s 0 = 0 := by
unfold gcdB xgcd
obtain β¨s, rflβ© := Nat.exists_eq_succ_of_ne_zero h
rw [xgcdAux]
simp
#align nat.gcd_b_zero_right Nat.gcdB_zero_right
@[simp]
theorem xgcdAux_fst (x y) : β s t s' t', (xgcdAux x s t y s' t').1 = gcd x y :=
gcd.induction x y (by simp) fun x y h IH s t s' t' => by
simp only [h, xgcdAux_rec, IH]
rw [β gcd_rec]
#align nat.xgcd_aux_fst Nat.xgcdAux_fst
theorem xgcdAux_val (x y) : xgcdAux x 1 0 y 0 1 = (gcd x y, xgcd x y) := by
rw [xgcd, β xgcdAux_fst x y 1 0 0 1]
#align nat.xgcd_aux_val Nat.xgcdAux_val
theorem xgcd_val (x y) : xgcd x y = (gcdA x y, gcdB x y) := by
unfold gcdA gcdB; cases xgcd x y; rfl
#align nat.xgcd_val Nat.xgcd_val
section
variable (x y : β)
private def P : β Γ β€ Γ β€ β Prop
| (r, s, t) => (r : β€) = x * s + y * t
| Mathlib/Data/Int/GCD.lean | 123 | 132 | theorem xgcdAux_P {r r'} :
β {s t s' t'}, P x y (r, s, t) β P x y (r', s', t') β P x y (xgcdAux r s t r' s' t') := by |
induction r, r' using gcd.induction with
| H0 => simp
| H1 a b h IH =>
intro s t s' t' p p'
rw [xgcdAux_rec h]; refine IH ?_ p; dsimp [P] at *
rw [Int.emod_def]; generalize (b / a : β€) = k
rw [p, p', Int.mul_sub, sub_add_eq_add_sub, Int.mul_sub, Int.add_mul, mul_comm k t,
mul_comm k s, β mul_assoc, β mul_assoc, add_comm (x * s * k), β add_sub_assoc, sub_sub]
| 1,222 |
import Mathlib.Algebra.Group.Commute.Units
import Mathlib.Algebra.Group.Int
import Mathlib.Algebra.GroupWithZero.Semiconj
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Bounds.Basic
#align_import data.int.gcd from "leanprover-community/mathlib"@"47a1a73351de8dd6c8d3d32b569c8e434b03ca47"
namespace Nat
def xgcdAux : β β β€ β β€ β β β β€ β β€ β β Γ β€ Γ β€
| 0, _, _, r', s', t' => (r', s', t')
| succ k, s, t, r', s', t' =>
let q := r' / succ k
xgcdAux (r' % succ k) (s' - q * s) (t' - q * t) (succ k) s t
termination_by k => k
decreasing_by exact mod_lt _ <| (succ_pos _).gt
#align nat.xgcd_aux Nat.xgcdAux
@[simp]
theorem xgcd_zero_left {s t r' s' t'} : xgcdAux 0 s t r' s' t' = (r', s', t') := by simp [xgcdAux]
#align nat.xgcd_zero_left Nat.xgcd_zero_left
theorem xgcdAux_rec {r s t r' s' t'} (h : 0 < r) :
xgcdAux r s t r' s' t' = xgcdAux (r' % r) (s' - r' / r * s) (t' - r' / r * t) r s t := by
obtain β¨r, rflβ© := Nat.exists_eq_succ_of_ne_zero h.ne'
simp [xgcdAux]
#align nat.xgcd_aux_rec Nat.xgcdAux_rec
def xgcd (x y : β) : β€ Γ β€ :=
(xgcdAux x 1 0 y 0 1).2
#align nat.xgcd Nat.xgcd
def gcdA (x y : β) : β€ :=
(xgcd x y).1
#align nat.gcd_a Nat.gcdA
def gcdB (x y : β) : β€ :=
(xgcd x y).2
#align nat.gcd_b Nat.gcdB
@[simp]
theorem gcdA_zero_left {s : β} : gcdA 0 s = 0 := by
unfold gcdA
rw [xgcd, xgcd_zero_left]
#align nat.gcd_a_zero_left Nat.gcdA_zero_left
@[simp]
theorem gcdB_zero_left {s : β} : gcdB 0 s = 1 := by
unfold gcdB
rw [xgcd, xgcd_zero_left]
#align nat.gcd_b_zero_left Nat.gcdB_zero_left
@[simp]
theorem gcdA_zero_right {s : β} (h : s β 0) : gcdA s 0 = 1 := by
unfold gcdA xgcd
obtain β¨s, rflβ© := Nat.exists_eq_succ_of_ne_zero h
rw [xgcdAux]
simp
#align nat.gcd_a_zero_right Nat.gcdA_zero_right
@[simp]
theorem gcdB_zero_right {s : β} (h : s β 0) : gcdB s 0 = 0 := by
unfold gcdB xgcd
obtain β¨s, rflβ© := Nat.exists_eq_succ_of_ne_zero h
rw [xgcdAux]
simp
#align nat.gcd_b_zero_right Nat.gcdB_zero_right
@[simp]
theorem xgcdAux_fst (x y) : β s t s' t', (xgcdAux x s t y s' t').1 = gcd x y :=
gcd.induction x y (by simp) fun x y h IH s t s' t' => by
simp only [h, xgcdAux_rec, IH]
rw [β gcd_rec]
#align nat.xgcd_aux_fst Nat.xgcdAux_fst
theorem xgcdAux_val (x y) : xgcdAux x 1 0 y 0 1 = (gcd x y, xgcd x y) := by
rw [xgcd, β xgcdAux_fst x y 1 0 0 1]
#align nat.xgcd_aux_val Nat.xgcdAux_val
theorem xgcd_val (x y) : xgcd x y = (gcdA x y, gcdB x y) := by
unfold gcdA gcdB; cases xgcd x y; rfl
#align nat.xgcd_val Nat.xgcd_val
section
variable (x y : β)
private def P : β Γ β€ Γ β€ β Prop
| (r, s, t) => (r : β€) = x * s + y * t
theorem xgcdAux_P {r r'} :
β {s t s' t'}, P x y (r, s, t) β P x y (r', s', t') β P x y (xgcdAux r s t r' s' t') := by
induction r, r' using gcd.induction with
| H0 => simp
| H1 a b h IH =>
intro s t s' t' p p'
rw [xgcdAux_rec h]; refine IH ?_ p; dsimp [P] at *
rw [Int.emod_def]; generalize (b / a : β€) = k
rw [p, p', Int.mul_sub, sub_add_eq_add_sub, Int.mul_sub, Int.add_mul, mul_comm k t,
mul_comm k s, β mul_assoc, β mul_assoc, add_comm (x * s * k), β add_sub_assoc, sub_sub]
set_option linter.uppercaseLean3 false in
#align nat.xgcd_aux_P Nat.xgcdAux_P
| Mathlib/Data/Int/GCD.lean | 139 | 141 | theorem gcd_eq_gcd_ab : (gcd x y : β€) = x * gcdA x y + y * gcdB x y := by |
have := @xgcdAux_P x y x y 1 0 0 1 (by simp [P]) (by simp [P])
rwa [xgcdAux_val, xgcd_val] at this
| 1,222 |
import Mathlib.Algebra.Group.Commute.Units
import Mathlib.Algebra.Group.Int
import Mathlib.Algebra.GroupWithZero.Semiconj
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Bounds.Basic
#align_import data.int.gcd from "leanprover-community/mathlib"@"47a1a73351de8dd6c8d3d32b569c8e434b03ca47"
namespace Nat
def xgcdAux : β β β€ β β€ β β β β€ β β€ β β Γ β€ Γ β€
| 0, _, _, r', s', t' => (r', s', t')
| succ k, s, t, r', s', t' =>
let q := r' / succ k
xgcdAux (r' % succ k) (s' - q * s) (t' - q * t) (succ k) s t
termination_by k => k
decreasing_by exact mod_lt _ <| (succ_pos _).gt
#align nat.xgcd_aux Nat.xgcdAux
@[simp]
theorem xgcd_zero_left {s t r' s' t'} : xgcdAux 0 s t r' s' t' = (r', s', t') := by simp [xgcdAux]
#align nat.xgcd_zero_left Nat.xgcd_zero_left
theorem xgcdAux_rec {r s t r' s' t'} (h : 0 < r) :
xgcdAux r s t r' s' t' = xgcdAux (r' % r) (s' - r' / r * s) (t' - r' / r * t) r s t := by
obtain β¨r, rflβ© := Nat.exists_eq_succ_of_ne_zero h.ne'
simp [xgcdAux]
#align nat.xgcd_aux_rec Nat.xgcdAux_rec
def xgcd (x y : β) : β€ Γ β€ :=
(xgcdAux x 1 0 y 0 1).2
#align nat.xgcd Nat.xgcd
def gcdA (x y : β) : β€ :=
(xgcd x y).1
#align nat.gcd_a Nat.gcdA
def gcdB (x y : β) : β€ :=
(xgcd x y).2
#align nat.gcd_b Nat.gcdB
@[simp]
theorem gcdA_zero_left {s : β} : gcdA 0 s = 0 := by
unfold gcdA
rw [xgcd, xgcd_zero_left]
#align nat.gcd_a_zero_left Nat.gcdA_zero_left
@[simp]
theorem gcdB_zero_left {s : β} : gcdB 0 s = 1 := by
unfold gcdB
rw [xgcd, xgcd_zero_left]
#align nat.gcd_b_zero_left Nat.gcdB_zero_left
@[simp]
theorem gcdA_zero_right {s : β} (h : s β 0) : gcdA s 0 = 1 := by
unfold gcdA xgcd
obtain β¨s, rflβ© := Nat.exists_eq_succ_of_ne_zero h
rw [xgcdAux]
simp
#align nat.gcd_a_zero_right Nat.gcdA_zero_right
@[simp]
theorem gcdB_zero_right {s : β} (h : s β 0) : gcdB s 0 = 0 := by
unfold gcdB xgcd
obtain β¨s, rflβ© := Nat.exists_eq_succ_of_ne_zero h
rw [xgcdAux]
simp
#align nat.gcd_b_zero_right Nat.gcdB_zero_right
@[simp]
theorem xgcdAux_fst (x y) : β s t s' t', (xgcdAux x s t y s' t').1 = gcd x y :=
gcd.induction x y (by simp) fun x y h IH s t s' t' => by
simp only [h, xgcdAux_rec, IH]
rw [β gcd_rec]
#align nat.xgcd_aux_fst Nat.xgcdAux_fst
theorem xgcdAux_val (x y) : xgcdAux x 1 0 y 0 1 = (gcd x y, xgcd x y) := by
rw [xgcd, β xgcdAux_fst x y 1 0 0 1]
#align nat.xgcd_aux_val Nat.xgcdAux_val
theorem xgcd_val (x y) : xgcd x y = (gcdA x y, gcdB x y) := by
unfold gcdA gcdB; cases xgcd x y; rfl
#align nat.xgcd_val Nat.xgcd_val
section
variable (x y : β)
private def P : β Γ β€ Γ β€ β Prop
| (r, s, t) => (r : β€) = x * s + y * t
theorem xgcdAux_P {r r'} :
β {s t s' t'}, P x y (r, s, t) β P x y (r', s', t') β P x y (xgcdAux r s t r' s' t') := by
induction r, r' using gcd.induction with
| H0 => simp
| H1 a b h IH =>
intro s t s' t' p p'
rw [xgcdAux_rec h]; refine IH ?_ p; dsimp [P] at *
rw [Int.emod_def]; generalize (b / a : β€) = k
rw [p, p', Int.mul_sub, sub_add_eq_add_sub, Int.mul_sub, Int.add_mul, mul_comm k t,
mul_comm k s, β mul_assoc, β mul_assoc, add_comm (x * s * k), β add_sub_assoc, sub_sub]
set_option linter.uppercaseLean3 false in
#align nat.xgcd_aux_P Nat.xgcdAux_P
theorem gcd_eq_gcd_ab : (gcd x y : β€) = x * gcdA x y + y * gcdB x y := by
have := @xgcdAux_P x y x y 1 0 0 1 (by simp [P]) (by simp [P])
rwa [xgcdAux_val, xgcd_val] at this
#align nat.gcd_eq_gcd_ab Nat.gcd_eq_gcd_ab
end
| Mathlib/Data/Int/GCD.lean | 146 | 154 | theorem exists_mul_emod_eq_gcd {k n : β} (hk : gcd n k < k) : β m, n * m % k = gcd n k := by |
have hk' := Int.ofNat_ne_zero.2 (ne_of_gt (lt_of_le_of_lt (zero_le (gcd n k)) hk))
have key := congr_arg (fun (m : β€) => (m % k).toNat) (gcd_eq_gcd_ab n k)
simp only at key
rw [Int.add_mul_emod_self_left, β Int.natCast_mod, Int.toNat_natCast, mod_eq_of_lt hk] at key
refine β¨(n.gcdA k % k).toNat, Eq.trans (Int.ofNat.inj ?_) key.symmβ©
rw [Int.ofNat_eq_coe, Int.natCast_mod, Int.ofNat_mul, Int.toNat_of_nonneg (Int.emod_nonneg _ hk'),
Int.ofNat_eq_coe, Int.toNat_of_nonneg (Int.emod_nonneg _ hk'), Int.mul_emod, Int.emod_emod,
β Int.mul_emod]
| 1,222 |
import Mathlib.Algebra.Ring.Regular
import Mathlib.Data.Int.GCD
import Mathlib.Data.Int.Order.Lemmas
import Mathlib.Tactic.NormNum.Basic
#align_import data.nat.modeq from "leanprover-community/mathlib"@"47a1a73351de8dd6c8d3d32b569c8e434b03ca47"
assert_not_exists Function.support
namespace Nat
def ModEq (n a b : β) :=
a % n = b % n
#align nat.modeq Nat.ModEq
@[inherit_doc]
notation:50 a " β‘ " b " [MOD " n "]" => ModEq n a b
variable {m n a b c d : β}
-- Porting note: This instance should be derivable automatically
instance : Decidable (ModEq n a b) := decEq (a % n) (b % n)
| Mathlib/Data/Nat/ModEq.lean | 78 | 78 | theorem modEq_zero_iff_dvd : a β‘ 0 [MOD n] β n β£ a := by | rw [ModEq, zero_mod, dvd_iff_mod_eq_zero]
| 1,223 |
import Mathlib.Algebra.Ring.Regular
import Mathlib.Data.Int.GCD
import Mathlib.Data.Int.Order.Lemmas
import Mathlib.Tactic.NormNum.Basic
#align_import data.nat.modeq from "leanprover-community/mathlib"@"47a1a73351de8dd6c8d3d32b569c8e434b03ca47"
assert_not_exists Function.support
namespace Nat
def ModEq (n a b : β) :=
a % n = b % n
#align nat.modeq Nat.ModEq
@[inherit_doc]
notation:50 a " β‘ " b " [MOD " n "]" => ModEq n a b
variable {m n a b c d : β}
-- Porting note: This instance should be derivable automatically
instance : Decidable (ModEq n a b) := decEq (a % n) (b % n)
theorem modEq_zero_iff_dvd : a β‘ 0 [MOD n] β n β£ a := by rw [ModEq, zero_mod, dvd_iff_mod_eq_zero]
#align nat.modeq_zero_iff_dvd Nat.modEq_zero_iff_dvd
theorem _root_.Dvd.dvd.modEq_zero_nat (h : n β£ a) : a β‘ 0 [MOD n] :=
modEq_zero_iff_dvd.2 h
#align has_dvd.dvd.modeq_zero_nat Dvd.dvd.modEq_zero_nat
theorem _root_.Dvd.dvd.zero_modEq_nat (h : n β£ a) : 0 β‘ a [MOD n] :=
h.modEq_zero_nat.symm
#align has_dvd.dvd.zero_modeq_nat Dvd.dvd.zero_modEq_nat
| Mathlib/Data/Nat/ModEq.lean | 89 | 91 | theorem modEq_iff_dvd : a β‘ b [MOD n] β (n : β€) β£ b - a := by |
rw [ModEq, eq_comm, β Int.natCast_inj, Int.natCast_mod, Int.natCast_mod,
Int.emod_eq_emod_iff_emod_sub_eq_zero, Int.dvd_iff_emod_eq_zero]
| 1,223 |
import Mathlib.Algebra.Ring.Regular
import Mathlib.Data.Int.GCD
import Mathlib.Data.Int.Order.Lemmas
import Mathlib.Tactic.NormNum.Basic
#align_import data.nat.modeq from "leanprover-community/mathlib"@"47a1a73351de8dd6c8d3d32b569c8e434b03ca47"
assert_not_exists Function.support
namespace Nat
def ModEq (n a b : β) :=
a % n = b % n
#align nat.modeq Nat.ModEq
@[inherit_doc]
notation:50 a " β‘ " b " [MOD " n "]" => ModEq n a b
variable {m n a b c d : β}
-- Porting note: This instance should be derivable automatically
instance : Decidable (ModEq n a b) := decEq (a % n) (b % n)
theorem modEq_zero_iff_dvd : a β‘ 0 [MOD n] β n β£ a := by rw [ModEq, zero_mod, dvd_iff_mod_eq_zero]
#align nat.modeq_zero_iff_dvd Nat.modEq_zero_iff_dvd
theorem _root_.Dvd.dvd.modEq_zero_nat (h : n β£ a) : a β‘ 0 [MOD n] :=
modEq_zero_iff_dvd.2 h
#align has_dvd.dvd.modeq_zero_nat Dvd.dvd.modEq_zero_nat
theorem _root_.Dvd.dvd.zero_modEq_nat (h : n β£ a) : 0 β‘ a [MOD n] :=
h.modEq_zero_nat.symm
#align has_dvd.dvd.zero_modeq_nat Dvd.dvd.zero_modEq_nat
theorem modEq_iff_dvd : a β‘ b [MOD n] β (n : β€) β£ b - a := by
rw [ModEq, eq_comm, β Int.natCast_inj, Int.natCast_mod, Int.natCast_mod,
Int.emod_eq_emod_iff_emod_sub_eq_zero, Int.dvd_iff_emod_eq_zero]
#align nat.modeq_iff_dvd Nat.modEq_iff_dvd
alias β¨ModEq.dvd, modEq_of_dvdβ© := modEq_iff_dvd
#align nat.modeq.dvd Nat.ModEq.dvd
#align nat.modeq_of_dvd Nat.modEq_of_dvd
| Mathlib/Data/Nat/ModEq.lean | 99 | 100 | theorem modEq_iff_dvd' (h : a β€ b) : a β‘ b [MOD n] β n β£ b - a := by |
rw [modEq_iff_dvd, β Int.natCast_dvd_natCast, Int.ofNat_sub h]
| 1,223 |
import Mathlib.Algebra.Group.Fin
import Mathlib.Algebra.NeZero
import Mathlib.Data.Nat.ModEq
import Mathlib.Data.Fintype.Card
#align_import data.zmod.defs from "leanprover-community/mathlib"@"3a2b5524a138b5d0b818b858b516d4ac8a484b03"
def ZMod : β β Type
| 0 => β€
| n + 1 => Fin (n + 1)
#align zmod ZMod
instance ZMod.decidableEq : β n : β, DecidableEq (ZMod n)
| 0 => inferInstanceAs (DecidableEq β€)
| n + 1 => inferInstanceAs (DecidableEq (Fin (n + 1)))
#align zmod.decidable_eq ZMod.decidableEq
instance ZMod.repr : β n : β, Repr (ZMod n)
| 0 => by dsimp [ZMod]; infer_instance
| n + 1 => by dsimp [ZMod]; infer_instance
#align zmod.has_repr ZMod.repr
namespace ZMod
instance instUnique : Unique (ZMod 1) := Fin.uniqueFinOne
instance fintype : β (n : β) [NeZero n], Fintype (ZMod n)
| 0, h => (h.ne rfl).elim
| n + 1, _ => Fin.fintype (n + 1)
#align zmod.fintype ZMod.fintype
instance infinite : Infinite (ZMod 0) :=
Int.infinite
#align zmod.infinite ZMod.infinite
@[simp]
| Mathlib/Data/ZMod/Defs.lean | 124 | 127 | theorem card (n : β) [Fintype (ZMod n)] : Fintype.card (ZMod n) = n := by |
cases n with
| zero => exact (not_finite (ZMod 0)).elim
| succ n => convert Fintype.card_fin (n + 1) using 2
| 1,224 |
import Mathlib.Data.ULift
import Mathlib.Data.ZMod.Defs
import Mathlib.SetTheory.Cardinal.PartENat
#align_import set_theory.cardinal.finite from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
set_option autoImplicit true
open Cardinal Function
noncomputable section
variable {Ξ± Ξ² : Type*}
namespace Nat
protected def card (Ξ± : Type*) : β :=
toNat (mk Ξ±)
#align nat.card Nat.card
@[simp]
theorem card_eq_fintype_card [Fintype Ξ±] : Nat.card Ξ± = Fintype.card Ξ± :=
mk_toNat_eq_card
#align nat.card_eq_fintype_card Nat.card_eq_fintype_card
theorem _root_.Fintype.card_eq_nat_card {_ : Fintype Ξ±} : Fintype.card Ξ± = Nat.card Ξ± :=
mk_toNat_eq_card.symm
lemma card_eq_finsetCard (s : Finset Ξ±) : Nat.card s = s.card := by
simp only [Nat.card_eq_fintype_card, Fintype.card_coe]
lemma card_eq_card_toFinset (s : Set Ξ±) [Fintype s] : Nat.card s = s.toFinset.card := by
simp only [β Nat.card_eq_finsetCard, s.mem_toFinset]
lemma card_eq_card_finite_toFinset {s : Set Ξ±} (hs : s.Finite) : Nat.card s = hs.toFinset.card := by
simp only [β Nat.card_eq_finsetCard, hs.mem_toFinset]
@[simp] theorem card_of_isEmpty [IsEmpty Ξ±] : Nat.card Ξ± = 0 := by simp [Nat.card]
#align nat.card_of_is_empty Nat.card_of_isEmpty
@[simp] lemma card_eq_zero_of_infinite [Infinite Ξ±] : Nat.card Ξ± = 0 := mk_toNat_of_infinite
#align nat.card_eq_zero_of_infinite Nat.card_eq_zero_of_infinite
lemma _root_.Set.Infinite.card_eq_zero {s : Set Ξ±} (hs : s.Infinite) : Nat.card s = 0 :=
@card_eq_zero_of_infinite _ hs.to_subtype
lemma card_eq_zero : Nat.card Ξ± = 0 β IsEmpty Ξ± β¨ Infinite Ξ± := by
simp [Nat.card, mk_eq_zero_iff, aleph0_le_mk_iff]
lemma card_ne_zero : Nat.card Ξ± β 0 β Nonempty Ξ± β§ Finite Ξ± := by simp [card_eq_zero, not_or]
lemma card_pos_iff : 0 < Nat.card Ξ± β Nonempty Ξ± β§ Finite Ξ± := by
simp [Nat.card, mk_eq_zero_iff, mk_lt_aleph0_iff]
@[simp] lemma card_pos [Nonempty Ξ±] [Finite Ξ±] : 0 < Nat.card Ξ± := card_pos_iff.2 β¨βΉ_βΊ, βΉ_βΊβ©
theorem finite_of_card_ne_zero (h : Nat.card Ξ± β 0) : Finite Ξ± := (card_ne_zero.1 h).2
#align nat.finite_of_card_ne_zero Nat.finite_of_card_ne_zero
theorem card_congr (f : Ξ± β Ξ²) : Nat.card Ξ± = Nat.card Ξ² :=
Cardinal.toNat_congr f
#align nat.card_congr Nat.card_congr
lemma card_le_card_of_injective {Ξ± : Type u} {Ξ² : Type v} [Finite Ξ²] (f : Ξ± β Ξ²)
(hf : Injective f) : Nat.card Ξ± β€ Nat.card Ξ² := by
simpa using toNat_le_toNat (lift_mk_le_lift_mk_of_injective hf) (by simp [lt_aleph0_of_finite])
lemma card_le_card_of_surjective {Ξ± : Type u} {Ξ² : Type v} [Finite Ξ±] (f : Ξ± β Ξ²)
(hf : Surjective f) : Nat.card Ξ² β€ Nat.card Ξ± := by
have : lift.{u} #Ξ² β€ lift.{v} #Ξ± := mk_le_of_surjective (ULift.map_surjective.2 hf)
simpa using toNat_le_toNat this (by simp [lt_aleph0_of_finite])
theorem card_eq_of_bijective (f : Ξ± β Ξ²) (hf : Function.Bijective f) : Nat.card Ξ± = Nat.card Ξ² :=
card_congr (Equiv.ofBijective f hf)
#align nat.card_eq_of_bijective Nat.card_eq_of_bijective
| Mathlib/SetTheory/Cardinal/Finite.lean | 97 | 98 | theorem card_eq_of_equiv_fin {Ξ± : Type*} {n : β} (f : Ξ± β Fin n) : Nat.card Ξ± = n := by |
simpa only [card_eq_fintype_card, Fintype.card_fin] using card_congr f
| 1,225 |
import Mathlib.Data.ULift
import Mathlib.Data.ZMod.Defs
import Mathlib.SetTheory.Cardinal.PartENat
#align_import set_theory.cardinal.finite from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
set_option autoImplicit true
open Cardinal Function
noncomputable section
variable {Ξ± Ξ² : Type*}
namespace Nat
protected def card (Ξ± : Type*) : β :=
toNat (mk Ξ±)
#align nat.card Nat.card
@[simp]
theorem card_eq_fintype_card [Fintype Ξ±] : Nat.card Ξ± = Fintype.card Ξ± :=
mk_toNat_eq_card
#align nat.card_eq_fintype_card Nat.card_eq_fintype_card
theorem _root_.Fintype.card_eq_nat_card {_ : Fintype Ξ±} : Fintype.card Ξ± = Nat.card Ξ± :=
mk_toNat_eq_card.symm
lemma card_eq_finsetCard (s : Finset Ξ±) : Nat.card s = s.card := by
simp only [Nat.card_eq_fintype_card, Fintype.card_coe]
lemma card_eq_card_toFinset (s : Set Ξ±) [Fintype s] : Nat.card s = s.toFinset.card := by
simp only [β Nat.card_eq_finsetCard, s.mem_toFinset]
lemma card_eq_card_finite_toFinset {s : Set Ξ±} (hs : s.Finite) : Nat.card s = hs.toFinset.card := by
simp only [β Nat.card_eq_finsetCard, hs.mem_toFinset]
@[simp] theorem card_of_isEmpty [IsEmpty Ξ±] : Nat.card Ξ± = 0 := by simp [Nat.card]
#align nat.card_of_is_empty Nat.card_of_isEmpty
@[simp] lemma card_eq_zero_of_infinite [Infinite Ξ±] : Nat.card Ξ± = 0 := mk_toNat_of_infinite
#align nat.card_eq_zero_of_infinite Nat.card_eq_zero_of_infinite
lemma _root_.Set.Infinite.card_eq_zero {s : Set Ξ±} (hs : s.Infinite) : Nat.card s = 0 :=
@card_eq_zero_of_infinite _ hs.to_subtype
lemma card_eq_zero : Nat.card Ξ± = 0 β IsEmpty Ξ± β¨ Infinite Ξ± := by
simp [Nat.card, mk_eq_zero_iff, aleph0_le_mk_iff]
lemma card_ne_zero : Nat.card Ξ± β 0 β Nonempty Ξ± β§ Finite Ξ± := by simp [card_eq_zero, not_or]
lemma card_pos_iff : 0 < Nat.card Ξ± β Nonempty Ξ± β§ Finite Ξ± := by
simp [Nat.card, mk_eq_zero_iff, mk_lt_aleph0_iff]
@[simp] lemma card_pos [Nonempty Ξ±] [Finite Ξ±] : 0 < Nat.card Ξ± := card_pos_iff.2 β¨βΉ_βΊ, βΉ_βΊβ©
theorem finite_of_card_ne_zero (h : Nat.card Ξ± β 0) : Finite Ξ± := (card_ne_zero.1 h).2
#align nat.finite_of_card_ne_zero Nat.finite_of_card_ne_zero
theorem card_congr (f : Ξ± β Ξ²) : Nat.card Ξ± = Nat.card Ξ² :=
Cardinal.toNat_congr f
#align nat.card_congr Nat.card_congr
lemma card_le_card_of_injective {Ξ± : Type u} {Ξ² : Type v} [Finite Ξ²] (f : Ξ± β Ξ²)
(hf : Injective f) : Nat.card Ξ± β€ Nat.card Ξ² := by
simpa using toNat_le_toNat (lift_mk_le_lift_mk_of_injective hf) (by simp [lt_aleph0_of_finite])
lemma card_le_card_of_surjective {Ξ± : Type u} {Ξ² : Type v} [Finite Ξ±] (f : Ξ± β Ξ²)
(hf : Surjective f) : Nat.card Ξ² β€ Nat.card Ξ± := by
have : lift.{u} #Ξ² β€ lift.{v} #Ξ± := mk_le_of_surjective (ULift.map_surjective.2 hf)
simpa using toNat_le_toNat this (by simp [lt_aleph0_of_finite])
theorem card_eq_of_bijective (f : Ξ± β Ξ²) (hf : Function.Bijective f) : Nat.card Ξ± = Nat.card Ξ² :=
card_congr (Equiv.ofBijective f hf)
#align nat.card_eq_of_bijective Nat.card_eq_of_bijective
theorem card_eq_of_equiv_fin {Ξ± : Type*} {n : β} (f : Ξ± β Fin n) : Nat.card Ξ± = n := by
simpa only [card_eq_fintype_card, Fintype.card_fin] using card_congr f
#align nat.card_eq_of_equiv_fin Nat.card_eq_of_equiv_fin
def equivFinOfCardPos {Ξ± : Type*} (h : Nat.card Ξ± β 0) : Ξ± β Fin (Nat.card Ξ±) := by
cases fintypeOrInfinite Ξ±
Β· simpa only [card_eq_fintype_card] using Fintype.equivFin Ξ±
Β· simp only [card_eq_zero_of_infinite, ne_eq, not_true_eq_false] at h
#align nat.equiv_fin_of_card_pos Nat.equivFinOfCardPos
| Mathlib/SetTheory/Cardinal/Finite.lean | 144 | 146 | theorem card_of_subsingleton (a : Ξ±) [Subsingleton Ξ±] : Nat.card Ξ± = 1 := by |
letI := Fintype.ofSubsingleton a
rw [card_eq_fintype_card, Fintype.card_ofSubsingleton a]
| 1,225 |
import Mathlib.Data.ULift
import Mathlib.Data.ZMod.Defs
import Mathlib.SetTheory.Cardinal.PartENat
#align_import set_theory.cardinal.finite from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
set_option autoImplicit true
open Cardinal Function
noncomputable section
variable {Ξ± Ξ² : Type*}
namespace Nat
protected def card (Ξ± : Type*) : β :=
toNat (mk Ξ±)
#align nat.card Nat.card
@[simp]
theorem card_eq_fintype_card [Fintype Ξ±] : Nat.card Ξ± = Fintype.card Ξ± :=
mk_toNat_eq_card
#align nat.card_eq_fintype_card Nat.card_eq_fintype_card
theorem _root_.Fintype.card_eq_nat_card {_ : Fintype Ξ±} : Fintype.card Ξ± = Nat.card Ξ± :=
mk_toNat_eq_card.symm
lemma card_eq_finsetCard (s : Finset Ξ±) : Nat.card s = s.card := by
simp only [Nat.card_eq_fintype_card, Fintype.card_coe]
lemma card_eq_card_toFinset (s : Set Ξ±) [Fintype s] : Nat.card s = s.toFinset.card := by
simp only [β Nat.card_eq_finsetCard, s.mem_toFinset]
lemma card_eq_card_finite_toFinset {s : Set Ξ±} (hs : s.Finite) : Nat.card s = hs.toFinset.card := by
simp only [β Nat.card_eq_finsetCard, hs.mem_toFinset]
@[simp] theorem card_of_isEmpty [IsEmpty Ξ±] : Nat.card Ξ± = 0 := by simp [Nat.card]
#align nat.card_of_is_empty Nat.card_of_isEmpty
@[simp] lemma card_eq_zero_of_infinite [Infinite Ξ±] : Nat.card Ξ± = 0 := mk_toNat_of_infinite
#align nat.card_eq_zero_of_infinite Nat.card_eq_zero_of_infinite
lemma _root_.Set.Infinite.card_eq_zero {s : Set Ξ±} (hs : s.Infinite) : Nat.card s = 0 :=
@card_eq_zero_of_infinite _ hs.to_subtype
lemma card_eq_zero : Nat.card Ξ± = 0 β IsEmpty Ξ± β¨ Infinite Ξ± := by
simp [Nat.card, mk_eq_zero_iff, aleph0_le_mk_iff]
lemma card_ne_zero : Nat.card Ξ± β 0 β Nonempty Ξ± β§ Finite Ξ± := by simp [card_eq_zero, not_or]
lemma card_pos_iff : 0 < Nat.card Ξ± β Nonempty Ξ± β§ Finite Ξ± := by
simp [Nat.card, mk_eq_zero_iff, mk_lt_aleph0_iff]
@[simp] lemma card_pos [Nonempty Ξ±] [Finite Ξ±] : 0 < Nat.card Ξ± := card_pos_iff.2 β¨βΉ_βΊ, βΉ_βΊβ©
theorem finite_of_card_ne_zero (h : Nat.card Ξ± β 0) : Finite Ξ± := (card_ne_zero.1 h).2
#align nat.finite_of_card_ne_zero Nat.finite_of_card_ne_zero
theorem card_congr (f : Ξ± β Ξ²) : Nat.card Ξ± = Nat.card Ξ² :=
Cardinal.toNat_congr f
#align nat.card_congr Nat.card_congr
lemma card_le_card_of_injective {Ξ± : Type u} {Ξ² : Type v} [Finite Ξ²] (f : Ξ± β Ξ²)
(hf : Injective f) : Nat.card Ξ± β€ Nat.card Ξ² := by
simpa using toNat_le_toNat (lift_mk_le_lift_mk_of_injective hf) (by simp [lt_aleph0_of_finite])
lemma card_le_card_of_surjective {Ξ± : Type u} {Ξ² : Type v} [Finite Ξ±] (f : Ξ± β Ξ²)
(hf : Surjective f) : Nat.card Ξ² β€ Nat.card Ξ± := by
have : lift.{u} #Ξ² β€ lift.{v} #Ξ± := mk_le_of_surjective (ULift.map_surjective.2 hf)
simpa using toNat_le_toNat this (by simp [lt_aleph0_of_finite])
theorem card_eq_of_bijective (f : Ξ± β Ξ²) (hf : Function.Bijective f) : Nat.card Ξ± = Nat.card Ξ² :=
card_congr (Equiv.ofBijective f hf)
#align nat.card_eq_of_bijective Nat.card_eq_of_bijective
theorem card_eq_of_equiv_fin {Ξ± : Type*} {n : β} (f : Ξ± β Fin n) : Nat.card Ξ± = n := by
simpa only [card_eq_fintype_card, Fintype.card_fin] using card_congr f
#align nat.card_eq_of_equiv_fin Nat.card_eq_of_equiv_fin
def equivFinOfCardPos {Ξ± : Type*} (h : Nat.card Ξ± β 0) : Ξ± β Fin (Nat.card Ξ±) := by
cases fintypeOrInfinite Ξ±
Β· simpa only [card_eq_fintype_card] using Fintype.equivFin Ξ±
Β· simp only [card_eq_zero_of_infinite, ne_eq, not_true_eq_false] at h
#align nat.equiv_fin_of_card_pos Nat.equivFinOfCardPos
theorem card_of_subsingleton (a : Ξ±) [Subsingleton Ξ±] : Nat.card Ξ± = 1 := by
letI := Fintype.ofSubsingleton a
rw [card_eq_fintype_card, Fintype.card_ofSubsingleton a]
#align nat.card_of_subsingleton Nat.card_of_subsingleton
-- @[simp] -- Porting note (#10618): simp can prove this
theorem card_unique [Unique Ξ±] : Nat.card Ξ± = 1 :=
card_of_subsingleton default
#align nat.card_unique Nat.card_unique
theorem card_eq_one_iff_unique : Nat.card Ξ± = 1 β Subsingleton Ξ± β§ Nonempty Ξ± :=
Cardinal.toNat_eq_one_iff_unique
#align nat.card_eq_one_iff_unique Nat.card_eq_one_iff_unique
theorem card_eq_two_iff : Nat.card Ξ± = 2 β β x y : Ξ±, x β y β§ {x, y} = @Set.univ Ξ± :=
toNat_eq_ofNat.trans mk_eq_two_iff
#align nat.card_eq_two_iff Nat.card_eq_two_iff
theorem card_eq_two_iff' (x : Ξ±) : Nat.card Ξ± = 2 β β! y, y β x :=
toNat_eq_ofNat.trans (mk_eq_two_iff' x)
#align nat.card_eq_two_iff' Nat.card_eq_two_iff'
@[simp]
| Mathlib/SetTheory/Cardinal/Finite.lean | 167 | 170 | theorem card_sum [Finite Ξ±] [Finite Ξ²] : Nat.card (Ξ± β Ξ²) = Nat.card Ξ± + Nat.card Ξ² := by |
have := Fintype.ofFinite Ξ±
have := Fintype.ofFinite Ξ²
simp_rw [Nat.card_eq_fintype_card, Fintype.card_sum]
| 1,225 |
import Mathlib.Data.Finset.Pointwise
import Mathlib.SetTheory.Cardinal.Finite
#align_import combinatorics.additive.ruzsa_covering from "leanprover-community/mathlib"@"b363547b3113d350d053abdf2884e9850a56b205"
open Pointwise
namespace Finset
variable {Ξ± : Type*} [DecidableEq Ξ±] [CommGroup Ξ±] (s : Finset Ξ±) {t : Finset Ξ±}
@[to_additive "**Ruzsa's covering lemma**"]
| Mathlib/Combinatorics/Additive/RuzsaCovering.lean | 31 | 53 | theorem exists_subset_mul_div (ht : t.Nonempty) :
β u : Finset Ξ±, u.card * t.card β€ (s * t).card β§ s β u * t / t := by |
haveI : β u, Decidable ((u : Set Ξ±).PairwiseDisjoint (Β· β’ t)) := fun u β¦ Classical.dec _
set C := s.powerset.filter fun u β¦ u.toSet.PairwiseDisjoint (Β· β’ t)
obtain β¨u, hu, hCmaxβ© := C.exists_maximal (filter_nonempty_iff.2
β¨β
, empty_mem_powerset _, by rw [coe_empty]; exact Set.pairwiseDisjoint_emptyβ©)
rw [mem_filter, mem_powerset] at hu
refine β¨u,
(card_mul_iff.2 <| pairwiseDisjoint_smul_iff.1 hu.2).ge.trans
(card_le_card <| mul_subset_mul_right hu.1),
fun a ha β¦ ?_β©
rw [mul_div_assoc]
by_cases hau : a β u
Β· exact subset_mul_left _ ht.one_mem_div hau
by_cases H : β b β u, Disjoint (a β’ t) (b β’ t)
Β· refine (hCmax _ ?_ <| ssubset_insert hau).elim
rw [mem_filter, mem_powerset, insert_subset_iff, coe_insert]
exact β¨β¨ha, hu.1β©, hu.2.insert fun _ hb _ β¦ H _ hbβ©
push_neg at H
simp_rw [not_disjoint_iff, β inv_smul_mem_iff] at H
obtain β¨b, hb, c, hcβ, hcββ© := H
refine mem_mul.2 β¨b, hb, a / b, ?_, by simpβ©
exact mem_div.2 β¨_, hcβ, _, hcβ, by simp [inv_mul_eq_div]β©
| 1,226 |
import Mathlib.Data.Fintype.Prod
import Mathlib.Data.Fintype.Sum
import Mathlib.SetTheory.Cardinal.Finite
#align_import data.fintype.units from "leanprover-community/mathlib"@"509de852e1de55e1efa8eacfa11df0823f26f226"
variable {Ξ± : Type*}
instance UnitsInt.fintype : Fintype β€Λ£ :=
β¨{1, -1}, fun x β¦ by cases Int.units_eq_one_or x <;> simp [*]β©
#align units_int.fintype UnitsInt.fintype
@[simp]
theorem UnitsInt.univ : (Finset.univ : Finset β€Λ£) = {1, -1} := rfl
#align units_int.univ UnitsInt.univ
@[simp]
theorem Fintype.card_units_int : Fintype.card β€Λ£ = 2 := rfl
#align fintype.card_units_int Fintype.card_units_int
instance [Monoid Ξ±] [Fintype Ξ±] [DecidableEq Ξ±] : Fintype Ξ±Λ£ :=
Fintype.ofEquiv _ (unitsEquivProdSubtype Ξ±).symm
instance [Monoid Ξ±] [Finite Ξ±] : Finite Ξ±Λ£ := Finite.of_injective _ Units.ext
| Mathlib/Data/Fintype/Units.lean | 36 | 40 | theorem Fintype.card_eq_card_units_add_one [GroupWithZero Ξ±] [Fintype Ξ±] [DecidableEq Ξ±] :
Fintype.card Ξ± = Fintype.card Ξ±Λ£ + 1 := by |
rw [eq_comm, Fintype.card_congr unitsEquivNeZero]
have := Fintype.card_congr (Equiv.sumCompl (Β· = (0 : Ξ±)))
rwa [Fintype.card_sum, add_comm, Fintype.card_subtype_eq] at this
| 1,227 |
import Mathlib.Data.Fintype.Prod
import Mathlib.Data.Fintype.Sum
import Mathlib.SetTheory.Cardinal.Finite
#align_import data.fintype.units from "leanprover-community/mathlib"@"509de852e1de55e1efa8eacfa11df0823f26f226"
variable {Ξ± : Type*}
instance UnitsInt.fintype : Fintype β€Λ£ :=
β¨{1, -1}, fun x β¦ by cases Int.units_eq_one_or x <;> simp [*]β©
#align units_int.fintype UnitsInt.fintype
@[simp]
theorem UnitsInt.univ : (Finset.univ : Finset β€Λ£) = {1, -1} := rfl
#align units_int.univ UnitsInt.univ
@[simp]
theorem Fintype.card_units_int : Fintype.card β€Λ£ = 2 := rfl
#align fintype.card_units_int Fintype.card_units_int
instance [Monoid Ξ±] [Fintype Ξ±] [DecidableEq Ξ±] : Fintype Ξ±Λ£ :=
Fintype.ofEquiv _ (unitsEquivProdSubtype Ξ±).symm
instance [Monoid Ξ±] [Finite Ξ±] : Finite Ξ±Λ£ := Finite.of_injective _ Units.ext
theorem Fintype.card_eq_card_units_add_one [GroupWithZero Ξ±] [Fintype Ξ±] [DecidableEq Ξ±] :
Fintype.card Ξ± = Fintype.card Ξ±Λ£ + 1 := by
rw [eq_comm, Fintype.card_congr unitsEquivNeZero]
have := Fintype.card_congr (Equiv.sumCompl (Β· = (0 : Ξ±)))
rwa [Fintype.card_sum, add_comm, Fintype.card_subtype_eq] at this
| Mathlib/Data/Fintype/Units.lean | 42 | 46 | theorem Nat.card_eq_card_units_add_one [GroupWithZero Ξ±] [Finite Ξ±] :
Nat.card Ξ± = Nat.card Ξ±Λ£ + 1 := by |
have : Fintype Ξ± := Fintype.ofFinite Ξ±
classical
rw [Nat.card_eq_fintype_card, Nat.card_eq_fintype_card, Fintype.card_eq_card_units_add_one]
| 1,227 |
import Mathlib.Data.Fintype.Prod
import Mathlib.Data.Fintype.Sum
import Mathlib.SetTheory.Cardinal.Finite
#align_import data.fintype.units from "leanprover-community/mathlib"@"509de852e1de55e1efa8eacfa11df0823f26f226"
variable {Ξ± : Type*}
instance UnitsInt.fintype : Fintype β€Λ£ :=
β¨{1, -1}, fun x β¦ by cases Int.units_eq_one_or x <;> simp [*]β©
#align units_int.fintype UnitsInt.fintype
@[simp]
theorem UnitsInt.univ : (Finset.univ : Finset β€Λ£) = {1, -1} := rfl
#align units_int.univ UnitsInt.univ
@[simp]
theorem Fintype.card_units_int : Fintype.card β€Λ£ = 2 := rfl
#align fintype.card_units_int Fintype.card_units_int
instance [Monoid Ξ±] [Fintype Ξ±] [DecidableEq Ξ±] : Fintype Ξ±Λ£ :=
Fintype.ofEquiv _ (unitsEquivProdSubtype Ξ±).symm
instance [Monoid Ξ±] [Finite Ξ±] : Finite Ξ±Λ£ := Finite.of_injective _ Units.ext
theorem Fintype.card_eq_card_units_add_one [GroupWithZero Ξ±] [Fintype Ξ±] [DecidableEq Ξ±] :
Fintype.card Ξ± = Fintype.card Ξ±Λ£ + 1 := by
rw [eq_comm, Fintype.card_congr unitsEquivNeZero]
have := Fintype.card_congr (Equiv.sumCompl (Β· = (0 : Ξ±)))
rwa [Fintype.card_sum, add_comm, Fintype.card_subtype_eq] at this
theorem Nat.card_eq_card_units_add_one [GroupWithZero Ξ±] [Finite Ξ±] :
Nat.card Ξ± = Nat.card Ξ±Λ£ + 1 := by
have : Fintype Ξ± := Fintype.ofFinite Ξ±
classical
rw [Nat.card_eq_fintype_card, Nat.card_eq_fintype_card, Fintype.card_eq_card_units_add_one]
| Mathlib/Data/Fintype/Units.lean | 48 | 50 | theorem Fintype.card_units [GroupWithZero Ξ±] [Fintype Ξ±] [DecidableEq Ξ±] :
Fintype.card Ξ±Λ£ = Fintype.card Ξ± - 1 := by |
rw [@Fintype.card_eq_card_units_add_one Ξ±, Nat.add_sub_cancel]
| 1,227 |
import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Combinatorics.Hall.Basic
import Mathlib.Data.Fintype.BigOperators
import Mathlib.SetTheory.Cardinal.Finite
#align_import combinatorics.configuration from "leanprover-community/mathlib"@"d2d8742b0c21426362a9dacebc6005db895ca963"
open Finset
namespace Configuration
variable (P L : Type*) [Membership P L]
def Dual :=
P
#align configuration.dual Configuration.Dual
-- Porting note: was `this` instead of `h`
instance [h : Inhabited P] : Inhabited (Dual P) :=
h
instance [Finite P] : Finite (Dual P) :=
βΉFinite PβΊ
-- Porting note: was `this` instead of `h`
instance [h : Fintype P] : Fintype (Dual P) :=
h
-- Porting note (#11215): TODO: figure out if this is needed.
set_option synthInstance.checkSynthOrder false in
instance : Membership (Dual L) (Dual P) :=
β¨Function.swap (Membership.mem : P β L β Prop)β©
class Nondegenerate : Prop where
exists_point : β l : L, β p, p β l
exists_line : β p, β l : L, p β l
eq_or_eq : β {pβ pβ : P} {lβ lβ : L}, pβ β lβ β pβ β lβ β pβ β lβ β pβ β lβ β pβ = pβ β¨ lβ = lβ
#align configuration.nondegenerate Configuration.Nondegenerate
class HasPoints extends Nondegenerate P L where
mkPoint : β {lβ lβ : L}, lβ β lβ β P
mkPoint_ax : β {lβ lβ : L} (h : lβ β lβ), mkPoint h β lβ β§ mkPoint h β lβ
#align configuration.has_points Configuration.HasPoints
class HasLines extends Nondegenerate P L where
mkLine : β {pβ pβ : P}, pβ β pβ β L
mkLine_ax : β {pβ pβ : P} (h : pβ β pβ), pβ β mkLine h β§ pβ β mkLine h
#align configuration.has_lines Configuration.HasLines
open Nondegenerate
open HasPoints (mkPoint mkPoint_ax)
open HasLines (mkLine mkLine_ax)
instance Dual.Nondegenerate [Nondegenerate P L] : Nondegenerate (Dual L) (Dual P) where
exists_point := @exists_line P L _ _
exists_line := @exists_point P L _ _
eq_or_eq := @fun lβ lβ pβ pβ hβ hβ hβ hβ => (@eq_or_eq P L _ _ pβ pβ lβ lβ hβ hβ hβ hβ).symm
instance Dual.hasLines [HasPoints P L] : HasLines (Dual L) (Dual P) :=
{ Dual.Nondegenerate _ _ with
mkLine := @mkPoint P L _ _
mkLine_ax := @mkPoint_ax P L _ _ }
instance Dual.hasPoints [HasLines P L] : HasPoints (Dual L) (Dual P) :=
{ Dual.Nondegenerate _ _ with
mkPoint := @mkLine P L _ _
mkPoint_ax := @mkLine_ax P L _ _ }
theorem HasPoints.existsUnique_point [HasPoints P L] (lβ lβ : L) (hl : lβ β lβ) :
β! p, p β lβ β§ p β lβ :=
β¨mkPoint hl, mkPoint_ax hl, fun _ hp =>
(eq_or_eq hp.1 (mkPoint_ax hl).1 hp.2 (mkPoint_ax hl).2).resolve_right hlβ©
#align configuration.has_points.exists_unique_point Configuration.HasPoints.existsUnique_point
theorem HasLines.existsUnique_line [HasLines P L] (pβ pβ : P) (hp : pβ β pβ) :
β! l : L, pβ β l β§ pβ β l :=
HasPoints.existsUnique_point (Dual L) (Dual P) pβ pβ hp
#align configuration.has_lines.exists_unique_line Configuration.HasLines.existsUnique_line
variable {P L}
| Mathlib/Combinatorics/Configuration.lean | 125 | 166 | theorem Nondegenerate.exists_injective_of_card_le [Nondegenerate P L] [Fintype P] [Fintype L]
(h : Fintype.card L β€ Fintype.card P) : β f : L β P, Function.Injective f β§ β l, f l β l := by |
classical
let t : L β Finset P := fun l => Set.toFinset { p | p β l }
suffices β s : Finset L, s.card β€ (s.biUnion t).card by
-- Hall's marriage theorem
obtain β¨f, hf1, hf2β© := (Finset.all_card_le_biUnion_card_iff_exists_injective t).mp this
exact β¨f, hf1, fun l => Set.mem_toFinset.mp (hf2 l)β©
intro s
by_cases hsβ : s.card = 0
-- If `s = β
`, then `s.card = 0 β€ (s.bUnion t).card`
Β· simp_rw [hsβ, zero_le]
by_cases hsβ : s.card = 1
-- If `s = {l}`, then pick a point `p β l`
Β· obtain β¨l, rflβ© := Finset.card_eq_one.mp hsβ
obtain β¨p, hlβ© := exists_point l
rw [Finset.card_singleton, Finset.singleton_biUnion, Nat.one_le_iff_ne_zero]
exact Finset.card_ne_zero_of_mem (Set.mem_toFinset.mpr hl)
suffices (s.biUnion t)αΆ.card β€ sαΆ.card by
-- Rephrase in terms of complements (uses `h`)
rw [Finset.card_compl, Finset.card_compl, tsub_le_iff_left] at this
replace := h.trans this
rwa [β add_tsub_assoc_of_le s.card_le_univ, le_tsub_iff_left (le_add_left s.card_le_univ),
add_le_add_iff_right] at this
have hsβ : (s.biUnion t)αΆ.card β€ 1 := by
-- At most one line through two points of `s`
refine Finset.card_le_one_iff.mpr @fun pβ pβ hpβ hpβ => ?_
simp_rw [t, Finset.mem_compl, Finset.mem_biUnion, not_exists, not_and,
Set.mem_toFinset, Set.mem_setOf_eq, Classical.not_not] at hpβ hpβ
obtain β¨lβ, lβ, hlβ, hlβ, hlββ© :=
Finset.one_lt_card_iff.mp (Nat.one_lt_iff_ne_zero_and_ne_one.mpr β¨hsβ, hsββ©)
exact (eq_or_eq (hpβ lβ hlβ) (hpβ lβ hlβ) (hpβ lβ hlβ) (hpβ lβ hlβ)).resolve_right hlβ
by_cases hsβ : sαΆ.card = 0
Β· rw [hsβ, Nat.le_zero]
rw [Finset.card_compl, tsub_eq_zero_iff_le, LE.le.le_iff_eq (Finset.card_le_univ _), eq_comm,
Finset.card_eq_iff_eq_univ] at hsβ β’
rw [hsβ]
rw [Finset.eq_univ_iff_forall] at hsβ β’
exact fun p =>
Exists.elim (exists_line p)-- If `s = univ`, then show `s.bUnion t = univ`
fun l hl => Finset.mem_biUnion.mpr β¨l, Finset.mem_univ l, Set.mem_toFinset.mpr hlβ©
Β· exact hsβ.trans (Nat.one_le_iff_ne_zero.mpr hsβ)
| 1,228 |
import Mathlib.Algebra.Quotient
import Mathlib.Algebra.Group.Subgroup.Actions
import Mathlib.Algebra.Group.Subgroup.MulOpposite
import Mathlib.GroupTheory.GroupAction.Basic
import Mathlib.SetTheory.Cardinal.Finite
#align_import group_theory.coset from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c"
open Function MulOpposite Set
open scoped Pointwise
variable {Ξ± : Type*}
#align left_coset HSMul.hSMul
#align left_add_coset HVAdd.hVAdd
#noalign right_coset
#noalign right_add_coset
section CosetSemigroup
variable [Semigroup Ξ±]
@[to_additive leftAddCoset_assoc]
| Mathlib/GroupTheory/Coset.lean | 105 | 106 | theorem leftCoset_assoc (s : Set Ξ±) (a b : Ξ±) : a β’ (b β’ s) = (a * b) β’ s := by |
simp [β image_smul, (image_comp _ _ _).symm, Function.comp, mul_assoc]
| 1,229 |
import Mathlib.Algebra.Quotient
import Mathlib.Algebra.Group.Subgroup.Actions
import Mathlib.Algebra.Group.Subgroup.MulOpposite
import Mathlib.GroupTheory.GroupAction.Basic
import Mathlib.SetTheory.Cardinal.Finite
#align_import group_theory.coset from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c"
open Function MulOpposite Set
open scoped Pointwise
variable {Ξ± : Type*}
#align left_coset HSMul.hSMul
#align left_add_coset HVAdd.hVAdd
#noalign right_coset
#noalign right_add_coset
section CosetSemigroup
variable [Semigroup Ξ±]
@[to_additive leftAddCoset_assoc]
theorem leftCoset_assoc (s : Set Ξ±) (a b : Ξ±) : a β’ (b β’ s) = (a * b) β’ s := by
simp [β image_smul, (image_comp _ _ _).symm, Function.comp, mul_assoc]
#align left_coset_assoc leftCoset_assoc
#align left_add_coset_assoc leftAddCoset_assoc
@[to_additive rightAddCoset_assoc]
| Mathlib/GroupTheory/Coset.lean | 111 | 112 | theorem rightCoset_assoc (s : Set Ξ±) (a b : Ξ±) : op b β’ op a β’ s = op (a * b) β’ s := by |
simp [β image_smul, (image_comp _ _ _).symm, Function.comp, mul_assoc]
| 1,229 |
import Mathlib.Algebra.Quotient
import Mathlib.Algebra.Group.Subgroup.Actions
import Mathlib.Algebra.Group.Subgroup.MulOpposite
import Mathlib.GroupTheory.GroupAction.Basic
import Mathlib.SetTheory.Cardinal.Finite
#align_import group_theory.coset from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c"
open Function MulOpposite Set
open scoped Pointwise
variable {Ξ± : Type*}
#align left_coset HSMul.hSMul
#align left_add_coset HVAdd.hVAdd
#noalign right_coset
#noalign right_add_coset
section CosetSemigroup
variable [Semigroup Ξ±]
@[to_additive leftAddCoset_assoc]
theorem leftCoset_assoc (s : Set Ξ±) (a b : Ξ±) : a β’ (b β’ s) = (a * b) β’ s := by
simp [β image_smul, (image_comp _ _ _).symm, Function.comp, mul_assoc]
#align left_coset_assoc leftCoset_assoc
#align left_add_coset_assoc leftAddCoset_assoc
@[to_additive rightAddCoset_assoc]
theorem rightCoset_assoc (s : Set Ξ±) (a b : Ξ±) : op b β’ op a β’ s = op (a * b) β’ s := by
simp [β image_smul, (image_comp _ _ _).symm, Function.comp, mul_assoc]
#align right_coset_assoc rightCoset_assoc
#align right_add_coset_assoc rightAddCoset_assoc
@[to_additive leftAddCoset_rightAddCoset]
| Mathlib/GroupTheory/Coset.lean | 117 | 118 | theorem leftCoset_rightCoset (s : Set Ξ±) (a b : Ξ±) : op b β’ a β’ s = a β’ (op b β’ s) := by |
simp [β image_smul, (image_comp _ _ _).symm, Function.comp, mul_assoc]
| 1,229 |
import Mathlib.Algebra.Quotient
import Mathlib.Algebra.Group.Subgroup.Actions
import Mathlib.Algebra.Group.Subgroup.MulOpposite
import Mathlib.GroupTheory.GroupAction.Basic
import Mathlib.SetTheory.Cardinal.Finite
#align_import group_theory.coset from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c"
open Function MulOpposite Set
open scoped Pointwise
variable {Ξ± : Type*}
#align left_coset HSMul.hSMul
#align left_add_coset HVAdd.hVAdd
#noalign right_coset
#noalign right_add_coset
-- Porting note: see https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/.E2.9C.94.20to_additive.2Emap_namespace
run_cmd Lean.Elab.Command.liftCoreM <| ToAdditive.insertTranslation `QuotientGroup `QuotientAddGroup
namespace QuotientGroup
variable [Group Ξ±] (s : Subgroup Ξ±)
@[to_additive "The equivalence relation corresponding to the partition of a group by left cosets
of a subgroup."]
def leftRel : Setoid Ξ± :=
MulAction.orbitRel s.op Ξ±
#align quotient_group.left_rel QuotientGroup.leftRel
#align quotient_add_group.left_rel QuotientAddGroup.leftRel
variable {s}
@[to_additive]
| Mathlib/GroupTheory/Coset.lean | 302 | 308 | theorem leftRel_apply {x y : Ξ±} : @Setoid.r _ (leftRel s) x y β xβ»ΒΉ * y β s :=
calc
(β a : s.op, y * MulOpposite.unop a = x) β β a : s, y * a = x :=
s.equivOp.symm.exists_congr_left
_ β β a : s, xβ»ΒΉ * y = aβ»ΒΉ := by |
simp only [inv_mul_eq_iff_eq_mul, Subgroup.coe_inv, eq_mul_inv_iff_mul_eq]
_ β xβ»ΒΉ * y β s := by simp [exists_inv_mem_iff_exists_mem]
| 1,229 |
import Mathlib.Algebra.Field.Opposite
import Mathlib.Algebra.Group.Subgroup.ZPowers
import Mathlib.Algebra.Group.Submonoid.Membership
import Mathlib.Algebra.Ring.NegOnePow
import Mathlib.Algebra.Order.Archimedean
import Mathlib.GroupTheory.Coset
#align_import algebra.periodic from "leanprover-community/mathlib"@"30413fc89f202a090a54d78e540963ed3de0056e"
variable {Ξ± Ξ² Ξ³ : Type*} {f g : Ξ± β Ξ²} {c cβ cβ x : Ξ±}
open Set
namespace Function
@[simp]
def Periodic [Add Ξ±] (f : Ξ± β Ξ²) (c : Ξ±) : Prop :=
β x : Ξ±, f (x + c) = f x
#align function.periodic Function.Periodic
protected theorem Periodic.funext [Add Ξ±] (h : Periodic f c) : (fun x => f (x + c)) = f :=
funext h
#align function.periodic.funext Function.Periodic.funext
protected theorem Periodic.comp [Add Ξ±] (h : Periodic f c) (g : Ξ² β Ξ³) : Periodic (g β f) c := by
simp_all
#align function.periodic.comp Function.Periodic.comp
theorem Periodic.comp_addHom [Add Ξ±] [Add Ξ³] (h : Periodic f c) (g : AddHom Ξ³ Ξ±) (g_inv : Ξ± β Ξ³)
(hg : RightInverse g_inv g) : Periodic (f β g) (g_inv c) := fun x => by
simp only [hg c, h (g x), map_add, comp_apply]
#align function.periodic.comp_add_hom Function.Periodic.comp_addHom
@[to_additive]
protected theorem Periodic.mul [Add Ξ±] [Mul Ξ²] (hf : Periodic f c) (hg : Periodic g c) :
Periodic (f * g) c := by simp_all
#align function.periodic.mul Function.Periodic.mul
#align function.periodic.add Function.Periodic.add
@[to_additive]
protected theorem Periodic.div [Add Ξ±] [Div Ξ²] (hf : Periodic f c) (hg : Periodic g c) :
Periodic (f / g) c := by simp_all
#align function.periodic.div Function.Periodic.div
#align function.periodic.sub Function.Periodic.sub
@[to_additive]
| Mathlib/Algebra/Periodic.lean | 77 | 82 | theorem _root_.List.periodic_prod [Add Ξ±] [Monoid Ξ²] (l : List (Ξ± β Ξ²))
(hl : β f β l, Periodic f c) : Periodic l.prod c := by |
induction' l with g l ih hl
Β· simp
Β· rw [List.forall_mem_cons] at hl
simpa only [List.prod_cons] using hl.1.mul (ih hl.2)
| 1,230 |
import Mathlib.Algebra.Field.Opposite
import Mathlib.Algebra.Group.Subgroup.ZPowers
import Mathlib.Algebra.Group.Submonoid.Membership
import Mathlib.Algebra.Ring.NegOnePow
import Mathlib.Algebra.Order.Archimedean
import Mathlib.GroupTheory.Coset
#align_import algebra.periodic from "leanprover-community/mathlib"@"30413fc89f202a090a54d78e540963ed3de0056e"
variable {Ξ± Ξ² Ξ³ : Type*} {f g : Ξ± β Ξ²} {c cβ cβ x : Ξ±}
open Set
namespace Function
@[simp]
def Periodic [Add Ξ±] (f : Ξ± β Ξ²) (c : Ξ±) : Prop :=
β x : Ξ±, f (x + c) = f x
#align function.periodic Function.Periodic
protected theorem Periodic.funext [Add Ξ±] (h : Periodic f c) : (fun x => f (x + c)) = f :=
funext h
#align function.periodic.funext Function.Periodic.funext
protected theorem Periodic.comp [Add Ξ±] (h : Periodic f c) (g : Ξ² β Ξ³) : Periodic (g β f) c := by
simp_all
#align function.periodic.comp Function.Periodic.comp
theorem Periodic.comp_addHom [Add Ξ±] [Add Ξ³] (h : Periodic f c) (g : AddHom Ξ³ Ξ±) (g_inv : Ξ± β Ξ³)
(hg : RightInverse g_inv g) : Periodic (f β g) (g_inv c) := fun x => by
simp only [hg c, h (g x), map_add, comp_apply]
#align function.periodic.comp_add_hom Function.Periodic.comp_addHom
@[to_additive]
protected theorem Periodic.mul [Add Ξ±] [Mul Ξ²] (hf : Periodic f c) (hg : Periodic g c) :
Periodic (f * g) c := by simp_all
#align function.periodic.mul Function.Periodic.mul
#align function.periodic.add Function.Periodic.add
@[to_additive]
protected theorem Periodic.div [Add Ξ±] [Div Ξ²] (hf : Periodic f c) (hg : Periodic g c) :
Periodic (f / g) c := by simp_all
#align function.periodic.div Function.Periodic.div
#align function.periodic.sub Function.Periodic.sub
@[to_additive]
theorem _root_.List.periodic_prod [Add Ξ±] [Monoid Ξ²] (l : List (Ξ± β Ξ²))
(hl : β f β l, Periodic f c) : Periodic l.prod c := by
induction' l with g l ih hl
Β· simp
Β· rw [List.forall_mem_cons] at hl
simpa only [List.prod_cons] using hl.1.mul (ih hl.2)
#align list.periodic_prod List.periodic_prod
#align list.periodic_sum List.periodic_sum
@[to_additive]
theorem _root_.Multiset.periodic_prod [Add Ξ±] [CommMonoid Ξ²] (s : Multiset (Ξ± β Ξ²))
(hs : β f β s, Periodic f c) : Periodic s.prod c :=
(s.prod_toList βΈ s.toList.periodic_prod) fun f hf => hs f <| Multiset.mem_toList.mp hf
#align multiset.periodic_prod Multiset.periodic_prod
#align multiset.periodic_sum Multiset.periodic_sum
@[to_additive]
theorem _root_.Finset.periodic_prod [Add Ξ±] [CommMonoid Ξ²] {ΞΉ : Type*} {f : ΞΉ β Ξ± β Ξ²}
(s : Finset ΞΉ) (hs : β i β s, Periodic (f i) c) : Periodic (β i β s, f i) c :=
s.prod_to_list f βΈ (s.toList.map f).periodic_prod (by simpa [-Periodic] )
#align finset.periodic_prod Finset.periodic_prod
#align finset.periodic_sum Finset.periodic_sum
@[to_additive]
protected theorem Periodic.smul [Add Ξ±] [SMul Ξ³ Ξ²] (h : Periodic f c) (a : Ξ³) :
Periodic (a β’ f) c := by simp_all
#align function.periodic.smul Function.Periodic.smul
#align function.periodic.vadd Function.Periodic.vadd
protected theorem Periodic.const_smul [AddMonoid Ξ±] [Group Ξ³] [DistribMulAction Ξ³ Ξ±]
(h : Periodic f c) (a : Ξ³) : Periodic (fun x => f (a β’ x)) (aβ»ΒΉ β’ c) := fun x => by
simpa only [smul_add, smul_inv_smul] using h (a β’ x)
#align function.periodic.const_smul Function.Periodic.const_smul
protected theorem Periodic.const_smulβ [AddCommMonoid Ξ±] [DivisionSemiring Ξ³] [Module Ξ³ Ξ±]
(h : Periodic f c) (a : Ξ³) : Periodic (fun x => f (a β’ x)) (aβ»ΒΉ β’ c) := fun x => by
by_cases ha : a = 0
Β· simp only [ha, zero_smul]
Β· simpa only [smul_add, smul_inv_smulβ ha] using h (a β’ x)
#align function.periodic.const_smulβ Function.Periodic.const_smulβ
protected theorem Periodic.const_mul [DivisionSemiring Ξ±] (h : Periodic f c) (a : Ξ±) :
Periodic (fun x => f (a * x)) (aβ»ΒΉ * c) :=
Periodic.const_smulβ h a
#align function.periodic.const_mul Function.Periodic.const_mul
| Mathlib/Algebra/Periodic.lean | 123 | 125 | theorem Periodic.const_inv_smul [AddMonoid Ξ±] [Group Ξ³] [DistribMulAction Ξ³ Ξ±] (h : Periodic f c)
(a : Ξ³) : Periodic (fun x => f (aβ»ΒΉ β’ x)) (a β’ c) := by |
simpa only [inv_inv] using h.const_smul aβ»ΒΉ
| 1,230 |
import Mathlib.Algebra.Field.Opposite
import Mathlib.Algebra.Group.Subgroup.ZPowers
import Mathlib.Algebra.Group.Submonoid.Membership
import Mathlib.Algebra.Ring.NegOnePow
import Mathlib.Algebra.Order.Archimedean
import Mathlib.GroupTheory.Coset
#align_import algebra.periodic from "leanprover-community/mathlib"@"30413fc89f202a090a54d78e540963ed3de0056e"
variable {Ξ± Ξ² Ξ³ : Type*} {f g : Ξ± β Ξ²} {c cβ cβ x : Ξ±}
open Set
namespace Function
@[simp]
def Periodic [Add Ξ±] (f : Ξ± β Ξ²) (c : Ξ±) : Prop :=
β x : Ξ±, f (x + c) = f x
#align function.periodic Function.Periodic
protected theorem Periodic.funext [Add Ξ±] (h : Periodic f c) : (fun x => f (x + c)) = f :=
funext h
#align function.periodic.funext Function.Periodic.funext
protected theorem Periodic.comp [Add Ξ±] (h : Periodic f c) (g : Ξ² β Ξ³) : Periodic (g β f) c := by
simp_all
#align function.periodic.comp Function.Periodic.comp
theorem Periodic.comp_addHom [Add Ξ±] [Add Ξ³] (h : Periodic f c) (g : AddHom Ξ³ Ξ±) (g_inv : Ξ± β Ξ³)
(hg : RightInverse g_inv g) : Periodic (f β g) (g_inv c) := fun x => by
simp only [hg c, h (g x), map_add, comp_apply]
#align function.periodic.comp_add_hom Function.Periodic.comp_addHom
@[to_additive]
protected theorem Periodic.mul [Add Ξ±] [Mul Ξ²] (hf : Periodic f c) (hg : Periodic g c) :
Periodic (f * g) c := by simp_all
#align function.periodic.mul Function.Periodic.mul
#align function.periodic.add Function.Periodic.add
@[to_additive]
protected theorem Periodic.div [Add Ξ±] [Div Ξ²] (hf : Periodic f c) (hg : Periodic g c) :
Periodic (f / g) c := by simp_all
#align function.periodic.div Function.Periodic.div
#align function.periodic.sub Function.Periodic.sub
@[to_additive]
theorem _root_.List.periodic_prod [Add Ξ±] [Monoid Ξ²] (l : List (Ξ± β Ξ²))
(hl : β f β l, Periodic f c) : Periodic l.prod c := by
induction' l with g l ih hl
Β· simp
Β· rw [List.forall_mem_cons] at hl
simpa only [List.prod_cons] using hl.1.mul (ih hl.2)
#align list.periodic_prod List.periodic_prod
#align list.periodic_sum List.periodic_sum
@[to_additive]
theorem _root_.Multiset.periodic_prod [Add Ξ±] [CommMonoid Ξ²] (s : Multiset (Ξ± β Ξ²))
(hs : β f β s, Periodic f c) : Periodic s.prod c :=
(s.prod_toList βΈ s.toList.periodic_prod) fun f hf => hs f <| Multiset.mem_toList.mp hf
#align multiset.periodic_prod Multiset.periodic_prod
#align multiset.periodic_sum Multiset.periodic_sum
@[to_additive]
theorem _root_.Finset.periodic_prod [Add Ξ±] [CommMonoid Ξ²] {ΞΉ : Type*} {f : ΞΉ β Ξ± β Ξ²}
(s : Finset ΞΉ) (hs : β i β s, Periodic (f i) c) : Periodic (β i β s, f i) c :=
s.prod_to_list f βΈ (s.toList.map f).periodic_prod (by simpa [-Periodic] )
#align finset.periodic_prod Finset.periodic_prod
#align finset.periodic_sum Finset.periodic_sum
@[to_additive]
protected theorem Periodic.smul [Add Ξ±] [SMul Ξ³ Ξ²] (h : Periodic f c) (a : Ξ³) :
Periodic (a β’ f) c := by simp_all
#align function.periodic.smul Function.Periodic.smul
#align function.periodic.vadd Function.Periodic.vadd
protected theorem Periodic.const_smul [AddMonoid Ξ±] [Group Ξ³] [DistribMulAction Ξ³ Ξ±]
(h : Periodic f c) (a : Ξ³) : Periodic (fun x => f (a β’ x)) (aβ»ΒΉ β’ c) := fun x => by
simpa only [smul_add, smul_inv_smul] using h (a β’ x)
#align function.periodic.const_smul Function.Periodic.const_smul
protected theorem Periodic.const_smulβ [AddCommMonoid Ξ±] [DivisionSemiring Ξ³] [Module Ξ³ Ξ±]
(h : Periodic f c) (a : Ξ³) : Periodic (fun x => f (a β’ x)) (aβ»ΒΉ β’ c) := fun x => by
by_cases ha : a = 0
Β· simp only [ha, zero_smul]
Β· simpa only [smul_add, smul_inv_smulβ ha] using h (a β’ x)
#align function.periodic.const_smulβ Function.Periodic.const_smulβ
protected theorem Periodic.const_mul [DivisionSemiring Ξ±] (h : Periodic f c) (a : Ξ±) :
Periodic (fun x => f (a * x)) (aβ»ΒΉ * c) :=
Periodic.const_smulβ h a
#align function.periodic.const_mul Function.Periodic.const_mul
theorem Periodic.const_inv_smul [AddMonoid Ξ±] [Group Ξ³] [DistribMulAction Ξ³ Ξ±] (h : Periodic f c)
(a : Ξ³) : Periodic (fun x => f (aβ»ΒΉ β’ x)) (a β’ c) := by
simpa only [inv_inv] using h.const_smul aβ»ΒΉ
#align function.periodic.const_inv_smul Function.Periodic.const_inv_smul
| Mathlib/Algebra/Periodic.lean | 128 | 130 | theorem Periodic.const_inv_smulβ [AddCommMonoid Ξ±] [DivisionSemiring Ξ³] [Module Ξ³ Ξ±]
(h : Periodic f c) (a : Ξ³) : Periodic (fun x => f (aβ»ΒΉ β’ x)) (a β’ c) := by |
simpa only [inv_inv] using h.const_smulβ aβ»ΒΉ
| 1,230 |
import Mathlib.Algebra.Field.Opposite
import Mathlib.Algebra.Group.Subgroup.ZPowers
import Mathlib.Algebra.Group.Submonoid.Membership
import Mathlib.Algebra.Ring.NegOnePow
import Mathlib.Algebra.Order.Archimedean
import Mathlib.GroupTheory.Coset
#align_import algebra.periodic from "leanprover-community/mathlib"@"30413fc89f202a090a54d78e540963ed3de0056e"
variable {Ξ± Ξ² Ξ³ : Type*} {f g : Ξ± β Ξ²} {c cβ cβ x : Ξ±}
open Set
namespace Function
@[simp]
def Periodic [Add Ξ±] (f : Ξ± β Ξ²) (c : Ξ±) : Prop :=
β x : Ξ±, f (x + c) = f x
#align function.periodic Function.Periodic
protected theorem Periodic.funext [Add Ξ±] (h : Periodic f c) : (fun x => f (x + c)) = f :=
funext h
#align function.periodic.funext Function.Periodic.funext
protected theorem Periodic.comp [Add Ξ±] (h : Periodic f c) (g : Ξ² β Ξ³) : Periodic (g β f) c := by
simp_all
#align function.periodic.comp Function.Periodic.comp
theorem Periodic.comp_addHom [Add Ξ±] [Add Ξ³] (h : Periodic f c) (g : AddHom Ξ³ Ξ±) (g_inv : Ξ± β Ξ³)
(hg : RightInverse g_inv g) : Periodic (f β g) (g_inv c) := fun x => by
simp only [hg c, h (g x), map_add, comp_apply]
#align function.periodic.comp_add_hom Function.Periodic.comp_addHom
@[to_additive]
protected theorem Periodic.mul [Add Ξ±] [Mul Ξ²] (hf : Periodic f c) (hg : Periodic g c) :
Periodic (f * g) c := by simp_all
#align function.periodic.mul Function.Periodic.mul
#align function.periodic.add Function.Periodic.add
@[to_additive]
protected theorem Periodic.div [Add Ξ±] [Div Ξ²] (hf : Periodic f c) (hg : Periodic g c) :
Periodic (f / g) c := by simp_all
#align function.periodic.div Function.Periodic.div
#align function.periodic.sub Function.Periodic.sub
@[to_additive]
theorem _root_.List.periodic_prod [Add Ξ±] [Monoid Ξ²] (l : List (Ξ± β Ξ²))
(hl : β f β l, Periodic f c) : Periodic l.prod c := by
induction' l with g l ih hl
Β· simp
Β· rw [List.forall_mem_cons] at hl
simpa only [List.prod_cons] using hl.1.mul (ih hl.2)
#align list.periodic_prod List.periodic_prod
#align list.periodic_sum List.periodic_sum
@[to_additive]
theorem _root_.Multiset.periodic_prod [Add Ξ±] [CommMonoid Ξ²] (s : Multiset (Ξ± β Ξ²))
(hs : β f β s, Periodic f c) : Periodic s.prod c :=
(s.prod_toList βΈ s.toList.periodic_prod) fun f hf => hs f <| Multiset.mem_toList.mp hf
#align multiset.periodic_prod Multiset.periodic_prod
#align multiset.periodic_sum Multiset.periodic_sum
@[to_additive]
theorem _root_.Finset.periodic_prod [Add Ξ±] [CommMonoid Ξ²] {ΞΉ : Type*} {f : ΞΉ β Ξ± β Ξ²}
(s : Finset ΞΉ) (hs : β i β s, Periodic (f i) c) : Periodic (β i β s, f i) c :=
s.prod_to_list f βΈ (s.toList.map f).periodic_prod (by simpa [-Periodic] )
#align finset.periodic_prod Finset.periodic_prod
#align finset.periodic_sum Finset.periodic_sum
@[to_additive]
protected theorem Periodic.smul [Add Ξ±] [SMul Ξ³ Ξ²] (h : Periodic f c) (a : Ξ³) :
Periodic (a β’ f) c := by simp_all
#align function.periodic.smul Function.Periodic.smul
#align function.periodic.vadd Function.Periodic.vadd
protected theorem Periodic.const_smul [AddMonoid Ξ±] [Group Ξ³] [DistribMulAction Ξ³ Ξ±]
(h : Periodic f c) (a : Ξ³) : Periodic (fun x => f (a β’ x)) (aβ»ΒΉ β’ c) := fun x => by
simpa only [smul_add, smul_inv_smul] using h (a β’ x)
#align function.periodic.const_smul Function.Periodic.const_smul
protected theorem Periodic.const_smulβ [AddCommMonoid Ξ±] [DivisionSemiring Ξ³] [Module Ξ³ Ξ±]
(h : Periodic f c) (a : Ξ³) : Periodic (fun x => f (a β’ x)) (aβ»ΒΉ β’ c) := fun x => by
by_cases ha : a = 0
Β· simp only [ha, zero_smul]
Β· simpa only [smul_add, smul_inv_smulβ ha] using h (a β’ x)
#align function.periodic.const_smulβ Function.Periodic.const_smulβ
protected theorem Periodic.const_mul [DivisionSemiring Ξ±] (h : Periodic f c) (a : Ξ±) :
Periodic (fun x => f (a * x)) (aβ»ΒΉ * c) :=
Periodic.const_smulβ h a
#align function.periodic.const_mul Function.Periodic.const_mul
theorem Periodic.const_inv_smul [AddMonoid Ξ±] [Group Ξ³] [DistribMulAction Ξ³ Ξ±] (h : Periodic f c)
(a : Ξ³) : Periodic (fun x => f (aβ»ΒΉ β’ x)) (a β’ c) := by
simpa only [inv_inv] using h.const_smul aβ»ΒΉ
#align function.periodic.const_inv_smul Function.Periodic.const_inv_smul
theorem Periodic.const_inv_smulβ [AddCommMonoid Ξ±] [DivisionSemiring Ξ³] [Module Ξ³ Ξ±]
(h : Periodic f c) (a : Ξ³) : Periodic (fun x => f (aβ»ΒΉ β’ x)) (a β’ c) := by
simpa only [inv_inv] using h.const_smulβ aβ»ΒΉ
#align function.periodic.const_inv_smulβ Function.Periodic.const_inv_smulβ
theorem Periodic.const_inv_mul [DivisionSemiring Ξ±] (h : Periodic f c) (a : Ξ±) :
Periodic (fun x => f (aβ»ΒΉ * x)) (a * c) :=
h.const_inv_smulβ a
#align function.periodic.const_inv_mul Function.Periodic.const_inv_mul
theorem Periodic.mul_const [DivisionSemiring Ξ±] (h : Periodic f c) (a : Ξ±) :
Periodic (fun x => f (x * a)) (c * aβ»ΒΉ) :=
h.const_smulβ (MulOpposite.op a)
#align function.periodic.mul_const Function.Periodic.mul_const
| Mathlib/Algebra/Periodic.lean | 143 | 144 | theorem Periodic.mul_const' [DivisionSemiring Ξ±] (h : Periodic f c) (a : Ξ±) :
Periodic (fun x => f (x * a)) (c / a) := by | simpa only [div_eq_mul_inv] using h.mul_const a
| 1,230 |
import Mathlib.Algebra.Periodic
import Mathlib.Data.Nat.Count
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Interval.Finset.Nat
#align_import data.nat.periodic from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988"
namespace Nat
open Nat Function
| Mathlib/Data/Nat/Periodic.lean | 25 | 26 | theorem periodic_gcd (a : β) : Periodic (gcd a) a := by |
simp only [forall_const, gcd_add_self_right, eq_self_iff_true, Periodic]
| 1,231 |
import Mathlib.Algebra.Periodic
import Mathlib.Data.Nat.Count
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Interval.Finset.Nat
#align_import data.nat.periodic from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988"
namespace Nat
open Nat Function
theorem periodic_gcd (a : β) : Periodic (gcd a) a := by
simp only [forall_const, gcd_add_self_right, eq_self_iff_true, Periodic]
#align nat.periodic_gcd Nat.periodic_gcd
| Mathlib/Data/Nat/Periodic.lean | 29 | 30 | theorem periodic_coprime (a : β) : Periodic (Coprime a) a := by |
simp only [coprime_add_self_right, forall_const, iff_self_iff, eq_iff_iff, Periodic]
| 1,231 |
import Mathlib.Algebra.Periodic
import Mathlib.Data.Nat.Count
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Interval.Finset.Nat
#align_import data.nat.periodic from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988"
namespace Nat
open Nat Function
theorem periodic_gcd (a : β) : Periodic (gcd a) a := by
simp only [forall_const, gcd_add_self_right, eq_self_iff_true, Periodic]
#align nat.periodic_gcd Nat.periodic_gcd
theorem periodic_coprime (a : β) : Periodic (Coprime a) a := by
simp only [coprime_add_self_right, forall_const, iff_self_iff, eq_iff_iff, Periodic]
#align nat.periodic_coprime Nat.periodic_coprime
| Mathlib/Data/Nat/Periodic.lean | 33 | 34 | theorem periodic_mod (a : β) : Periodic (fun n => n % a) a := by |
simp only [forall_const, eq_self_iff_true, add_mod_right, Periodic]
| 1,231 |
import Mathlib.Algebra.Periodic
import Mathlib.Data.Nat.Count
import Mathlib.Data.Nat.GCD.Basic
import Mathlib.Order.Interval.Finset.Nat
#align_import data.nat.periodic from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988"
namespace Nat
open Nat Function
theorem periodic_gcd (a : β) : Periodic (gcd a) a := by
simp only [forall_const, gcd_add_self_right, eq_self_iff_true, Periodic]
#align nat.periodic_gcd Nat.periodic_gcd
theorem periodic_coprime (a : β) : Periodic (Coprime a) a := by
simp only [coprime_add_self_right, forall_const, iff_self_iff, eq_iff_iff, Periodic]
#align nat.periodic_coprime Nat.periodic_coprime
theorem periodic_mod (a : β) : Periodic (fun n => n % a) a := by
simp only [forall_const, eq_self_iff_true, add_mod_right, Periodic]
#align nat.periodic_mod Nat.periodic_mod
theorem _root_.Function.Periodic.map_mod_nat {Ξ± : Type*} {f : β β Ξ±} {a : β} (hf : Periodic f a) :
β n, f (n % a) = f n := fun n => by
conv_rhs => rw [β Nat.mod_add_div n a, mul_comm, β Nat.nsmul_eq_mul, hf.nsmul]
#align function.periodic.map_mod_nat Function.Periodic.map_mod_nat
section Multiset
open Multiset
| Mathlib/Data/Nat/Periodic.lean | 48 | 54 | theorem filter_multiset_Ico_card_eq_of_periodic (n a : β) (p : β β Prop) [DecidablePred p]
(pp : Periodic p a) : card (filter p (Ico n (n + a))) = a.count p := by |
rw [count_eq_card_filter_range, Finset.card, Finset.filter_val, Finset.range_val, β
multiset_Ico_map_mod n, β map_count_True_eq_filter_card, β map_count_True_eq_filter_card,
map_map]
congr; funext n
exact (Function.Periodic.map_mod_nat pp n).symm
| 1,231 |
import Mathlib.SetTheory.Cardinal.Finite
#align_import data.finite.card from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
noncomputable section
open scoped Classical
variable {Ξ± Ξ² Ξ³ : Type*}
def Finite.equivFin (Ξ± : Type*) [Finite Ξ±] : Ξ± β Fin (Nat.card Ξ±) := by
have := (Finite.exists_equiv_fin Ξ±).choose_spec.some
rwa [Nat.card_eq_of_equiv_fin this]
#align finite.equiv_fin Finite.equivFin
def Finite.equivFinOfCardEq [Finite Ξ±] {n : β} (h : Nat.card Ξ± = n) : Ξ± β Fin n := by
subst h
apply Finite.equivFin
#align finite.equiv_fin_of_card_eq Finite.equivFinOfCardEq
| Mathlib/Data/Finite/Card.lean | 49 | 54 | theorem Nat.card_eq (Ξ± : Type*) :
Nat.card Ξ± = if h : Finite Ξ± then @Fintype.card Ξ± (Fintype.ofFinite Ξ±) else 0 := by |
cases finite_or_infinite Ξ±
Β· letI := Fintype.ofFinite Ξ±
simp only [*, Nat.card_eq_fintype_card, dif_pos]
Β· simp only [*, card_eq_zero_of_infinite, not_finite_iff_infinite.mpr, dite_false]
| 1,232 |
import Mathlib.SetTheory.Cardinal.Finite
#align_import data.finite.card from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
noncomputable section
open scoped Classical
variable {Ξ± Ξ² Ξ³ : Type*}
def Finite.equivFin (Ξ± : Type*) [Finite Ξ±] : Ξ± β Fin (Nat.card Ξ±) := by
have := (Finite.exists_equiv_fin Ξ±).choose_spec.some
rwa [Nat.card_eq_of_equiv_fin this]
#align finite.equiv_fin Finite.equivFin
def Finite.equivFinOfCardEq [Finite Ξ±] {n : β} (h : Nat.card Ξ± = n) : Ξ± β Fin n := by
subst h
apply Finite.equivFin
#align finite.equiv_fin_of_card_eq Finite.equivFinOfCardEq
theorem Nat.card_eq (Ξ± : Type*) :
Nat.card Ξ± = if h : Finite Ξ± then @Fintype.card Ξ± (Fintype.ofFinite Ξ±) else 0 := by
cases finite_or_infinite Ξ±
Β· letI := Fintype.ofFinite Ξ±
simp only [*, Nat.card_eq_fintype_card, dif_pos]
Β· simp only [*, card_eq_zero_of_infinite, not_finite_iff_infinite.mpr, dite_false]
#align nat.card_eq Nat.card_eq
| Mathlib/Data/Finite/Card.lean | 57 | 59 | theorem Finite.card_pos_iff [Finite Ξ±] : 0 < Nat.card Ξ± β Nonempty Ξ± := by |
haveI := Fintype.ofFinite Ξ±
rw [Nat.card_eq_fintype_card, Fintype.card_pos_iff]
| 1,232 |
import Mathlib.SetTheory.Cardinal.Finite
#align_import data.finite.card from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
noncomputable section
open scoped Classical
variable {Ξ± Ξ² Ξ³ : Type*}
def Finite.equivFin (Ξ± : Type*) [Finite Ξ±] : Ξ± β Fin (Nat.card Ξ±) := by
have := (Finite.exists_equiv_fin Ξ±).choose_spec.some
rwa [Nat.card_eq_of_equiv_fin this]
#align finite.equiv_fin Finite.equivFin
def Finite.equivFinOfCardEq [Finite Ξ±] {n : β} (h : Nat.card Ξ± = n) : Ξ± β Fin n := by
subst h
apply Finite.equivFin
#align finite.equiv_fin_of_card_eq Finite.equivFinOfCardEq
theorem Nat.card_eq (Ξ± : Type*) :
Nat.card Ξ± = if h : Finite Ξ± then @Fintype.card Ξ± (Fintype.ofFinite Ξ±) else 0 := by
cases finite_or_infinite Ξ±
Β· letI := Fintype.ofFinite Ξ±
simp only [*, Nat.card_eq_fintype_card, dif_pos]
Β· simp only [*, card_eq_zero_of_infinite, not_finite_iff_infinite.mpr, dite_false]
#align nat.card_eq Nat.card_eq
theorem Finite.card_pos_iff [Finite Ξ±] : 0 < Nat.card Ξ± β Nonempty Ξ± := by
haveI := Fintype.ofFinite Ξ±
rw [Nat.card_eq_fintype_card, Fintype.card_pos_iff]
#align finite.card_pos_iff Finite.card_pos_iff
theorem Finite.card_pos [Finite Ξ±] [h : Nonempty Ξ±] : 0 < Nat.card Ξ± :=
Finite.card_pos_iff.mpr h
#align finite.card_pos Finite.card_pos
namespace Finite
theorem cast_card_eq_mk {Ξ± : Type*} [Finite Ξ±] : β(Nat.card Ξ±) = Cardinal.mk Ξ± :=
Cardinal.cast_toNat_of_lt_aleph0 (Cardinal.lt_aleph0_of_finite Ξ±)
#align finite.cast_card_eq_mk Finite.cast_card_eq_mk
| Mathlib/Data/Finite/Card.lean | 72 | 75 | theorem card_eq [Finite Ξ±] [Finite Ξ²] : Nat.card Ξ± = Nat.card Ξ² β Nonempty (Ξ± β Ξ²) := by |
haveI := Fintype.ofFinite Ξ±
haveI := Fintype.ofFinite Ξ²
simp only [Nat.card_eq_fintype_card, Fintype.card_eq]
| 1,232 |
import Mathlib.SetTheory.Cardinal.Finite
#align_import data.finite.card from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
noncomputable section
open scoped Classical
variable {Ξ± Ξ² Ξ³ : Type*}
def Finite.equivFin (Ξ± : Type*) [Finite Ξ±] : Ξ± β Fin (Nat.card Ξ±) := by
have := (Finite.exists_equiv_fin Ξ±).choose_spec.some
rwa [Nat.card_eq_of_equiv_fin this]
#align finite.equiv_fin Finite.equivFin
def Finite.equivFinOfCardEq [Finite Ξ±] {n : β} (h : Nat.card Ξ± = n) : Ξ± β Fin n := by
subst h
apply Finite.equivFin
#align finite.equiv_fin_of_card_eq Finite.equivFinOfCardEq
theorem Nat.card_eq (Ξ± : Type*) :
Nat.card Ξ± = if h : Finite Ξ± then @Fintype.card Ξ± (Fintype.ofFinite Ξ±) else 0 := by
cases finite_or_infinite Ξ±
Β· letI := Fintype.ofFinite Ξ±
simp only [*, Nat.card_eq_fintype_card, dif_pos]
Β· simp only [*, card_eq_zero_of_infinite, not_finite_iff_infinite.mpr, dite_false]
#align nat.card_eq Nat.card_eq
theorem Finite.card_pos_iff [Finite Ξ±] : 0 < Nat.card Ξ± β Nonempty Ξ± := by
haveI := Fintype.ofFinite Ξ±
rw [Nat.card_eq_fintype_card, Fintype.card_pos_iff]
#align finite.card_pos_iff Finite.card_pos_iff
theorem Finite.card_pos [Finite Ξ±] [h : Nonempty Ξ±] : 0 < Nat.card Ξ± :=
Finite.card_pos_iff.mpr h
#align finite.card_pos Finite.card_pos
namespace Finite
theorem cast_card_eq_mk {Ξ± : Type*} [Finite Ξ±] : β(Nat.card Ξ±) = Cardinal.mk Ξ± :=
Cardinal.cast_toNat_of_lt_aleph0 (Cardinal.lt_aleph0_of_finite Ξ±)
#align finite.cast_card_eq_mk Finite.cast_card_eq_mk
theorem card_eq [Finite Ξ±] [Finite Ξ²] : Nat.card Ξ± = Nat.card Ξ² β Nonempty (Ξ± β Ξ²) := by
haveI := Fintype.ofFinite Ξ±
haveI := Fintype.ofFinite Ξ²
simp only [Nat.card_eq_fintype_card, Fintype.card_eq]
#align finite.card_eq Finite.card_eq
| Mathlib/Data/Finite/Card.lean | 78 | 80 | theorem card_le_one_iff_subsingleton [Finite Ξ±] : Nat.card Ξ± β€ 1 β Subsingleton Ξ± := by |
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.card_le_one_iff_subsingleton]
| 1,232 |
import Mathlib.SetTheory.Cardinal.Finite
#align_import data.finite.card from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
noncomputable section
open scoped Classical
variable {Ξ± Ξ² Ξ³ : Type*}
def Finite.equivFin (Ξ± : Type*) [Finite Ξ±] : Ξ± β Fin (Nat.card Ξ±) := by
have := (Finite.exists_equiv_fin Ξ±).choose_spec.some
rwa [Nat.card_eq_of_equiv_fin this]
#align finite.equiv_fin Finite.equivFin
def Finite.equivFinOfCardEq [Finite Ξ±] {n : β} (h : Nat.card Ξ± = n) : Ξ± β Fin n := by
subst h
apply Finite.equivFin
#align finite.equiv_fin_of_card_eq Finite.equivFinOfCardEq
theorem Nat.card_eq (Ξ± : Type*) :
Nat.card Ξ± = if h : Finite Ξ± then @Fintype.card Ξ± (Fintype.ofFinite Ξ±) else 0 := by
cases finite_or_infinite Ξ±
Β· letI := Fintype.ofFinite Ξ±
simp only [*, Nat.card_eq_fintype_card, dif_pos]
Β· simp only [*, card_eq_zero_of_infinite, not_finite_iff_infinite.mpr, dite_false]
#align nat.card_eq Nat.card_eq
theorem Finite.card_pos_iff [Finite Ξ±] : 0 < Nat.card Ξ± β Nonempty Ξ± := by
haveI := Fintype.ofFinite Ξ±
rw [Nat.card_eq_fintype_card, Fintype.card_pos_iff]
#align finite.card_pos_iff Finite.card_pos_iff
theorem Finite.card_pos [Finite Ξ±] [h : Nonempty Ξ±] : 0 < Nat.card Ξ± :=
Finite.card_pos_iff.mpr h
#align finite.card_pos Finite.card_pos
namespace Finite
theorem cast_card_eq_mk {Ξ± : Type*} [Finite Ξ±] : β(Nat.card Ξ±) = Cardinal.mk Ξ± :=
Cardinal.cast_toNat_of_lt_aleph0 (Cardinal.lt_aleph0_of_finite Ξ±)
#align finite.cast_card_eq_mk Finite.cast_card_eq_mk
theorem card_eq [Finite Ξ±] [Finite Ξ²] : Nat.card Ξ± = Nat.card Ξ² β Nonempty (Ξ± β Ξ²) := by
haveI := Fintype.ofFinite Ξ±
haveI := Fintype.ofFinite Ξ²
simp only [Nat.card_eq_fintype_card, Fintype.card_eq]
#align finite.card_eq Finite.card_eq
theorem card_le_one_iff_subsingleton [Finite Ξ±] : Nat.card Ξ± β€ 1 β Subsingleton Ξ± := by
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.card_le_one_iff_subsingleton]
#align finite.card_le_one_iff_subsingleton Finite.card_le_one_iff_subsingleton
| Mathlib/Data/Finite/Card.lean | 83 | 85 | theorem one_lt_card_iff_nontrivial [Finite Ξ±] : 1 < Nat.card Ξ± β Nontrivial Ξ± := by |
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.one_lt_card_iff_nontrivial]
| 1,232 |
import Mathlib.SetTheory.Cardinal.Finite
#align_import data.finite.card from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
noncomputable section
open scoped Classical
variable {Ξ± Ξ² Ξ³ : Type*}
def Finite.equivFin (Ξ± : Type*) [Finite Ξ±] : Ξ± β Fin (Nat.card Ξ±) := by
have := (Finite.exists_equiv_fin Ξ±).choose_spec.some
rwa [Nat.card_eq_of_equiv_fin this]
#align finite.equiv_fin Finite.equivFin
def Finite.equivFinOfCardEq [Finite Ξ±] {n : β} (h : Nat.card Ξ± = n) : Ξ± β Fin n := by
subst h
apply Finite.equivFin
#align finite.equiv_fin_of_card_eq Finite.equivFinOfCardEq
theorem Nat.card_eq (Ξ± : Type*) :
Nat.card Ξ± = if h : Finite Ξ± then @Fintype.card Ξ± (Fintype.ofFinite Ξ±) else 0 := by
cases finite_or_infinite Ξ±
Β· letI := Fintype.ofFinite Ξ±
simp only [*, Nat.card_eq_fintype_card, dif_pos]
Β· simp only [*, card_eq_zero_of_infinite, not_finite_iff_infinite.mpr, dite_false]
#align nat.card_eq Nat.card_eq
theorem Finite.card_pos_iff [Finite Ξ±] : 0 < Nat.card Ξ± β Nonempty Ξ± := by
haveI := Fintype.ofFinite Ξ±
rw [Nat.card_eq_fintype_card, Fintype.card_pos_iff]
#align finite.card_pos_iff Finite.card_pos_iff
theorem Finite.card_pos [Finite Ξ±] [h : Nonempty Ξ±] : 0 < Nat.card Ξ± :=
Finite.card_pos_iff.mpr h
#align finite.card_pos Finite.card_pos
namespace Finite
theorem cast_card_eq_mk {Ξ± : Type*} [Finite Ξ±] : β(Nat.card Ξ±) = Cardinal.mk Ξ± :=
Cardinal.cast_toNat_of_lt_aleph0 (Cardinal.lt_aleph0_of_finite Ξ±)
#align finite.cast_card_eq_mk Finite.cast_card_eq_mk
theorem card_eq [Finite Ξ±] [Finite Ξ²] : Nat.card Ξ± = Nat.card Ξ² β Nonempty (Ξ± β Ξ²) := by
haveI := Fintype.ofFinite Ξ±
haveI := Fintype.ofFinite Ξ²
simp only [Nat.card_eq_fintype_card, Fintype.card_eq]
#align finite.card_eq Finite.card_eq
theorem card_le_one_iff_subsingleton [Finite Ξ±] : Nat.card Ξ± β€ 1 β Subsingleton Ξ± := by
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.card_le_one_iff_subsingleton]
#align finite.card_le_one_iff_subsingleton Finite.card_le_one_iff_subsingleton
theorem one_lt_card_iff_nontrivial [Finite Ξ±] : 1 < Nat.card Ξ± β Nontrivial Ξ± := by
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.one_lt_card_iff_nontrivial]
#align finite.one_lt_card_iff_nontrivial Finite.one_lt_card_iff_nontrivial
theorem one_lt_card [Finite Ξ±] [h : Nontrivial Ξ±] : 1 < Nat.card Ξ± :=
one_lt_card_iff_nontrivial.mpr h
#align finite.one_lt_card Finite.one_lt_card
@[simp]
| Mathlib/Data/Finite/Card.lean | 93 | 95 | theorem card_option [Finite Ξ±] : Nat.card (Option Ξ±) = Nat.card Ξ± + 1 := by |
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.card_option]
| 1,232 |
import Mathlib.SetTheory.Cardinal.Finite
#align_import data.finite.card from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
noncomputable section
open scoped Classical
variable {Ξ± Ξ² Ξ³ : Type*}
def Finite.equivFin (Ξ± : Type*) [Finite Ξ±] : Ξ± β Fin (Nat.card Ξ±) := by
have := (Finite.exists_equiv_fin Ξ±).choose_spec.some
rwa [Nat.card_eq_of_equiv_fin this]
#align finite.equiv_fin Finite.equivFin
def Finite.equivFinOfCardEq [Finite Ξ±] {n : β} (h : Nat.card Ξ± = n) : Ξ± β Fin n := by
subst h
apply Finite.equivFin
#align finite.equiv_fin_of_card_eq Finite.equivFinOfCardEq
theorem Nat.card_eq (Ξ± : Type*) :
Nat.card Ξ± = if h : Finite Ξ± then @Fintype.card Ξ± (Fintype.ofFinite Ξ±) else 0 := by
cases finite_or_infinite Ξ±
Β· letI := Fintype.ofFinite Ξ±
simp only [*, Nat.card_eq_fintype_card, dif_pos]
Β· simp only [*, card_eq_zero_of_infinite, not_finite_iff_infinite.mpr, dite_false]
#align nat.card_eq Nat.card_eq
theorem Finite.card_pos_iff [Finite Ξ±] : 0 < Nat.card Ξ± β Nonempty Ξ± := by
haveI := Fintype.ofFinite Ξ±
rw [Nat.card_eq_fintype_card, Fintype.card_pos_iff]
#align finite.card_pos_iff Finite.card_pos_iff
theorem Finite.card_pos [Finite Ξ±] [h : Nonempty Ξ±] : 0 < Nat.card Ξ± :=
Finite.card_pos_iff.mpr h
#align finite.card_pos Finite.card_pos
namespace Finite
theorem cast_card_eq_mk {Ξ± : Type*} [Finite Ξ±] : β(Nat.card Ξ±) = Cardinal.mk Ξ± :=
Cardinal.cast_toNat_of_lt_aleph0 (Cardinal.lt_aleph0_of_finite Ξ±)
#align finite.cast_card_eq_mk Finite.cast_card_eq_mk
theorem card_eq [Finite Ξ±] [Finite Ξ²] : Nat.card Ξ± = Nat.card Ξ² β Nonempty (Ξ± β Ξ²) := by
haveI := Fintype.ofFinite Ξ±
haveI := Fintype.ofFinite Ξ²
simp only [Nat.card_eq_fintype_card, Fintype.card_eq]
#align finite.card_eq Finite.card_eq
theorem card_le_one_iff_subsingleton [Finite Ξ±] : Nat.card Ξ± β€ 1 β Subsingleton Ξ± := by
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.card_le_one_iff_subsingleton]
#align finite.card_le_one_iff_subsingleton Finite.card_le_one_iff_subsingleton
theorem one_lt_card_iff_nontrivial [Finite Ξ±] : 1 < Nat.card Ξ± β Nontrivial Ξ± := by
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.one_lt_card_iff_nontrivial]
#align finite.one_lt_card_iff_nontrivial Finite.one_lt_card_iff_nontrivial
theorem one_lt_card [Finite Ξ±] [h : Nontrivial Ξ±] : 1 < Nat.card Ξ± :=
one_lt_card_iff_nontrivial.mpr h
#align finite.one_lt_card Finite.one_lt_card
@[simp]
theorem card_option [Finite Ξ±] : Nat.card (Option Ξ±) = Nat.card Ξ± + 1 := by
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.card_option]
#align finite.card_option Finite.card_option
| Mathlib/Data/Finite/Card.lean | 98 | 102 | theorem card_le_of_injective [Finite Ξ²] (f : Ξ± β Ξ²) (hf : Function.Injective f) :
Nat.card Ξ± β€ Nat.card Ξ² := by |
haveI := Fintype.ofFinite Ξ²
haveI := Fintype.ofInjective f hf
simpa only [Nat.card_eq_fintype_card, ge_iff_le] using Fintype.card_le_of_injective f hf
| 1,232 |
import Mathlib.SetTheory.Cardinal.Finite
#align_import data.finite.card from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
noncomputable section
open scoped Classical
variable {Ξ± Ξ² Ξ³ : Type*}
def Finite.equivFin (Ξ± : Type*) [Finite Ξ±] : Ξ± β Fin (Nat.card Ξ±) := by
have := (Finite.exists_equiv_fin Ξ±).choose_spec.some
rwa [Nat.card_eq_of_equiv_fin this]
#align finite.equiv_fin Finite.equivFin
def Finite.equivFinOfCardEq [Finite Ξ±] {n : β} (h : Nat.card Ξ± = n) : Ξ± β Fin n := by
subst h
apply Finite.equivFin
#align finite.equiv_fin_of_card_eq Finite.equivFinOfCardEq
theorem Nat.card_eq (Ξ± : Type*) :
Nat.card Ξ± = if h : Finite Ξ± then @Fintype.card Ξ± (Fintype.ofFinite Ξ±) else 0 := by
cases finite_or_infinite Ξ±
Β· letI := Fintype.ofFinite Ξ±
simp only [*, Nat.card_eq_fintype_card, dif_pos]
Β· simp only [*, card_eq_zero_of_infinite, not_finite_iff_infinite.mpr, dite_false]
#align nat.card_eq Nat.card_eq
theorem Finite.card_pos_iff [Finite Ξ±] : 0 < Nat.card Ξ± β Nonempty Ξ± := by
haveI := Fintype.ofFinite Ξ±
rw [Nat.card_eq_fintype_card, Fintype.card_pos_iff]
#align finite.card_pos_iff Finite.card_pos_iff
theorem Finite.card_pos [Finite Ξ±] [h : Nonempty Ξ±] : 0 < Nat.card Ξ± :=
Finite.card_pos_iff.mpr h
#align finite.card_pos Finite.card_pos
namespace Finite
theorem cast_card_eq_mk {Ξ± : Type*} [Finite Ξ±] : β(Nat.card Ξ±) = Cardinal.mk Ξ± :=
Cardinal.cast_toNat_of_lt_aleph0 (Cardinal.lt_aleph0_of_finite Ξ±)
#align finite.cast_card_eq_mk Finite.cast_card_eq_mk
theorem card_eq [Finite Ξ±] [Finite Ξ²] : Nat.card Ξ± = Nat.card Ξ² β Nonempty (Ξ± β Ξ²) := by
haveI := Fintype.ofFinite Ξ±
haveI := Fintype.ofFinite Ξ²
simp only [Nat.card_eq_fintype_card, Fintype.card_eq]
#align finite.card_eq Finite.card_eq
theorem card_le_one_iff_subsingleton [Finite Ξ±] : Nat.card Ξ± β€ 1 β Subsingleton Ξ± := by
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.card_le_one_iff_subsingleton]
#align finite.card_le_one_iff_subsingleton Finite.card_le_one_iff_subsingleton
theorem one_lt_card_iff_nontrivial [Finite Ξ±] : 1 < Nat.card Ξ± β Nontrivial Ξ± := by
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.one_lt_card_iff_nontrivial]
#align finite.one_lt_card_iff_nontrivial Finite.one_lt_card_iff_nontrivial
theorem one_lt_card [Finite Ξ±] [h : Nontrivial Ξ±] : 1 < Nat.card Ξ± :=
one_lt_card_iff_nontrivial.mpr h
#align finite.one_lt_card Finite.one_lt_card
@[simp]
theorem card_option [Finite Ξ±] : Nat.card (Option Ξ±) = Nat.card Ξ± + 1 := by
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.card_option]
#align finite.card_option Finite.card_option
theorem card_le_of_injective [Finite Ξ²] (f : Ξ± β Ξ²) (hf : Function.Injective f) :
Nat.card Ξ± β€ Nat.card Ξ² := by
haveI := Fintype.ofFinite Ξ²
haveI := Fintype.ofInjective f hf
simpa only [Nat.card_eq_fintype_card, ge_iff_le] using Fintype.card_le_of_injective f hf
#align finite.card_le_of_injective Finite.card_le_of_injective
theorem card_le_of_embedding [Finite Ξ²] (f : Ξ± βͺ Ξ²) : Nat.card Ξ± β€ Nat.card Ξ² :=
card_le_of_injective _ f.injective
#align finite.card_le_of_embedding Finite.card_le_of_embedding
| Mathlib/Data/Finite/Card.lean | 109 | 113 | theorem card_le_of_surjective [Finite Ξ±] (f : Ξ± β Ξ²) (hf : Function.Surjective f) :
Nat.card Ξ² β€ Nat.card Ξ± := by |
haveI := Fintype.ofFinite Ξ±
haveI := Fintype.ofSurjective f hf
simpa only [Nat.card_eq_fintype_card, ge_iff_le] using Fintype.card_le_of_surjective f hf
| 1,232 |
import Mathlib.SetTheory.Cardinal.Finite
#align_import data.finite.card from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
noncomputable section
open scoped Classical
variable {Ξ± Ξ² Ξ³ : Type*}
def Finite.equivFin (Ξ± : Type*) [Finite Ξ±] : Ξ± β Fin (Nat.card Ξ±) := by
have := (Finite.exists_equiv_fin Ξ±).choose_spec.some
rwa [Nat.card_eq_of_equiv_fin this]
#align finite.equiv_fin Finite.equivFin
def Finite.equivFinOfCardEq [Finite Ξ±] {n : β} (h : Nat.card Ξ± = n) : Ξ± β Fin n := by
subst h
apply Finite.equivFin
#align finite.equiv_fin_of_card_eq Finite.equivFinOfCardEq
theorem Nat.card_eq (Ξ± : Type*) :
Nat.card Ξ± = if h : Finite Ξ± then @Fintype.card Ξ± (Fintype.ofFinite Ξ±) else 0 := by
cases finite_or_infinite Ξ±
Β· letI := Fintype.ofFinite Ξ±
simp only [*, Nat.card_eq_fintype_card, dif_pos]
Β· simp only [*, card_eq_zero_of_infinite, not_finite_iff_infinite.mpr, dite_false]
#align nat.card_eq Nat.card_eq
theorem Finite.card_pos_iff [Finite Ξ±] : 0 < Nat.card Ξ± β Nonempty Ξ± := by
haveI := Fintype.ofFinite Ξ±
rw [Nat.card_eq_fintype_card, Fintype.card_pos_iff]
#align finite.card_pos_iff Finite.card_pos_iff
theorem Finite.card_pos [Finite Ξ±] [h : Nonempty Ξ±] : 0 < Nat.card Ξ± :=
Finite.card_pos_iff.mpr h
#align finite.card_pos Finite.card_pos
namespace Finite
theorem cast_card_eq_mk {Ξ± : Type*} [Finite Ξ±] : β(Nat.card Ξ±) = Cardinal.mk Ξ± :=
Cardinal.cast_toNat_of_lt_aleph0 (Cardinal.lt_aleph0_of_finite Ξ±)
#align finite.cast_card_eq_mk Finite.cast_card_eq_mk
theorem card_eq [Finite Ξ±] [Finite Ξ²] : Nat.card Ξ± = Nat.card Ξ² β Nonempty (Ξ± β Ξ²) := by
haveI := Fintype.ofFinite Ξ±
haveI := Fintype.ofFinite Ξ²
simp only [Nat.card_eq_fintype_card, Fintype.card_eq]
#align finite.card_eq Finite.card_eq
theorem card_le_one_iff_subsingleton [Finite Ξ±] : Nat.card Ξ± β€ 1 β Subsingleton Ξ± := by
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.card_le_one_iff_subsingleton]
#align finite.card_le_one_iff_subsingleton Finite.card_le_one_iff_subsingleton
theorem one_lt_card_iff_nontrivial [Finite Ξ±] : 1 < Nat.card Ξ± β Nontrivial Ξ± := by
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.one_lt_card_iff_nontrivial]
#align finite.one_lt_card_iff_nontrivial Finite.one_lt_card_iff_nontrivial
theorem one_lt_card [Finite Ξ±] [h : Nontrivial Ξ±] : 1 < Nat.card Ξ± :=
one_lt_card_iff_nontrivial.mpr h
#align finite.one_lt_card Finite.one_lt_card
@[simp]
theorem card_option [Finite Ξ±] : Nat.card (Option Ξ±) = Nat.card Ξ± + 1 := by
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.card_option]
#align finite.card_option Finite.card_option
theorem card_le_of_injective [Finite Ξ²] (f : Ξ± β Ξ²) (hf : Function.Injective f) :
Nat.card Ξ± β€ Nat.card Ξ² := by
haveI := Fintype.ofFinite Ξ²
haveI := Fintype.ofInjective f hf
simpa only [Nat.card_eq_fintype_card, ge_iff_le] using Fintype.card_le_of_injective f hf
#align finite.card_le_of_injective Finite.card_le_of_injective
theorem card_le_of_embedding [Finite Ξ²] (f : Ξ± βͺ Ξ²) : Nat.card Ξ± β€ Nat.card Ξ² :=
card_le_of_injective _ f.injective
#align finite.card_le_of_embedding Finite.card_le_of_embedding
theorem card_le_of_surjective [Finite Ξ±] (f : Ξ± β Ξ²) (hf : Function.Surjective f) :
Nat.card Ξ² β€ Nat.card Ξ± := by
haveI := Fintype.ofFinite Ξ±
haveI := Fintype.ofSurjective f hf
simpa only [Nat.card_eq_fintype_card, ge_iff_le] using Fintype.card_le_of_surjective f hf
#align finite.card_le_of_surjective Finite.card_le_of_surjective
| Mathlib/Data/Finite/Card.lean | 116 | 118 | theorem card_eq_zero_iff [Finite Ξ±] : Nat.card Ξ± = 0 β IsEmpty Ξ± := by |
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.card_eq_zero_iff]
| 1,232 |
import Mathlib.SetTheory.Cardinal.Finite
#align_import data.finite.card from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8"
noncomputable section
open scoped Classical
variable {Ξ± Ξ² Ξ³ : Type*}
def Finite.equivFin (Ξ± : Type*) [Finite Ξ±] : Ξ± β Fin (Nat.card Ξ±) := by
have := (Finite.exists_equiv_fin Ξ±).choose_spec.some
rwa [Nat.card_eq_of_equiv_fin this]
#align finite.equiv_fin Finite.equivFin
def Finite.equivFinOfCardEq [Finite Ξ±] {n : β} (h : Nat.card Ξ± = n) : Ξ± β Fin n := by
subst h
apply Finite.equivFin
#align finite.equiv_fin_of_card_eq Finite.equivFinOfCardEq
theorem Nat.card_eq (Ξ± : Type*) :
Nat.card Ξ± = if h : Finite Ξ± then @Fintype.card Ξ± (Fintype.ofFinite Ξ±) else 0 := by
cases finite_or_infinite Ξ±
Β· letI := Fintype.ofFinite Ξ±
simp only [*, Nat.card_eq_fintype_card, dif_pos]
Β· simp only [*, card_eq_zero_of_infinite, not_finite_iff_infinite.mpr, dite_false]
#align nat.card_eq Nat.card_eq
theorem Finite.card_pos_iff [Finite Ξ±] : 0 < Nat.card Ξ± β Nonempty Ξ± := by
haveI := Fintype.ofFinite Ξ±
rw [Nat.card_eq_fintype_card, Fintype.card_pos_iff]
#align finite.card_pos_iff Finite.card_pos_iff
theorem Finite.card_pos [Finite Ξ±] [h : Nonempty Ξ±] : 0 < Nat.card Ξ± :=
Finite.card_pos_iff.mpr h
#align finite.card_pos Finite.card_pos
namespace Finite
theorem cast_card_eq_mk {Ξ± : Type*} [Finite Ξ±] : β(Nat.card Ξ±) = Cardinal.mk Ξ± :=
Cardinal.cast_toNat_of_lt_aleph0 (Cardinal.lt_aleph0_of_finite Ξ±)
#align finite.cast_card_eq_mk Finite.cast_card_eq_mk
theorem card_eq [Finite Ξ±] [Finite Ξ²] : Nat.card Ξ± = Nat.card Ξ² β Nonempty (Ξ± β Ξ²) := by
haveI := Fintype.ofFinite Ξ±
haveI := Fintype.ofFinite Ξ²
simp only [Nat.card_eq_fintype_card, Fintype.card_eq]
#align finite.card_eq Finite.card_eq
theorem card_le_one_iff_subsingleton [Finite Ξ±] : Nat.card Ξ± β€ 1 β Subsingleton Ξ± := by
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.card_le_one_iff_subsingleton]
#align finite.card_le_one_iff_subsingleton Finite.card_le_one_iff_subsingleton
theorem one_lt_card_iff_nontrivial [Finite Ξ±] : 1 < Nat.card Ξ± β Nontrivial Ξ± := by
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.one_lt_card_iff_nontrivial]
#align finite.one_lt_card_iff_nontrivial Finite.one_lt_card_iff_nontrivial
theorem one_lt_card [Finite Ξ±] [h : Nontrivial Ξ±] : 1 < Nat.card Ξ± :=
one_lt_card_iff_nontrivial.mpr h
#align finite.one_lt_card Finite.one_lt_card
@[simp]
theorem card_option [Finite Ξ±] : Nat.card (Option Ξ±) = Nat.card Ξ± + 1 := by
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.card_option]
#align finite.card_option Finite.card_option
theorem card_le_of_injective [Finite Ξ²] (f : Ξ± β Ξ²) (hf : Function.Injective f) :
Nat.card Ξ± β€ Nat.card Ξ² := by
haveI := Fintype.ofFinite Ξ²
haveI := Fintype.ofInjective f hf
simpa only [Nat.card_eq_fintype_card, ge_iff_le] using Fintype.card_le_of_injective f hf
#align finite.card_le_of_injective Finite.card_le_of_injective
theorem card_le_of_embedding [Finite Ξ²] (f : Ξ± βͺ Ξ²) : Nat.card Ξ± β€ Nat.card Ξ² :=
card_le_of_injective _ f.injective
#align finite.card_le_of_embedding Finite.card_le_of_embedding
theorem card_le_of_surjective [Finite Ξ±] (f : Ξ± β Ξ²) (hf : Function.Surjective f) :
Nat.card Ξ² β€ Nat.card Ξ± := by
haveI := Fintype.ofFinite Ξ±
haveI := Fintype.ofSurjective f hf
simpa only [Nat.card_eq_fintype_card, ge_iff_le] using Fintype.card_le_of_surjective f hf
#align finite.card_le_of_surjective Finite.card_le_of_surjective
theorem card_eq_zero_iff [Finite Ξ±] : Nat.card Ξ± = 0 β IsEmpty Ξ± := by
haveI := Fintype.ofFinite Ξ±
simp only [Nat.card_eq_fintype_card, Fintype.card_eq_zero_iff]
#align finite.card_eq_zero_iff Finite.card_eq_zero_iff
theorem card_le_of_injective' {f : Ξ± β Ξ²} (hf : Function.Injective f)
(h : Nat.card Ξ² = 0 β Nat.card Ξ± = 0) : Nat.card Ξ± β€ Nat.card Ξ² :=
(or_not_of_imp h).casesOn (fun h => le_of_eq_of_le h zero_le') fun h =>
@card_le_of_injective Ξ± Ξ² (Nat.finite_of_card_ne_zero h) f hf
#align finite.card_le_of_injective' Finite.card_le_of_injective'
theorem card_le_of_embedding' (f : Ξ± βͺ Ξ²) (h : Nat.card Ξ² = 0 β Nat.card Ξ± = 0) :
Nat.card Ξ± β€ Nat.card Ξ² :=
card_le_of_injective' f.2 h
#align finite.card_le_of_embedding' Finite.card_le_of_embedding'
theorem card_le_of_surjective' {f : Ξ± β Ξ²} (hf : Function.Surjective f)
(h : Nat.card Ξ± = 0 β Nat.card Ξ² = 0) : Nat.card Ξ² β€ Nat.card Ξ± :=
(or_not_of_imp h).casesOn (fun h => le_of_eq_of_le h zero_le') fun h =>
@card_le_of_surjective Ξ± Ξ² (Nat.finite_of_card_ne_zero h) f hf
#align finite.card_le_of_surjective' Finite.card_le_of_surjective'
| Mathlib/Data/Finite/Card.lean | 145 | 152 | theorem card_eq_zero_of_surjective {f : Ξ± β Ξ²} (hf : Function.Surjective f) (h : Nat.card Ξ² = 0) :
Nat.card Ξ± = 0 := by |
cases finite_or_infinite Ξ²
Β· haveI := card_eq_zero_iff.mp h
haveI := Function.isEmpty f
exact Nat.card_of_isEmpty
Β· haveI := Infinite.of_surjective f hf
exact Nat.card_eq_zero_of_infinite
| 1,232 |
import Mathlib.Algebra.Group.Subgroup.Basic
import Mathlib.Algebra.Group.Submonoid.Membership
import Mathlib.Data.Finite.Card
#align_import group_theory.subgroup.finite from "leanprover-community/mathlib"@"f93c11933efbc3c2f0299e47b8ff83e9b539cbf6"
variable {G : Type*} [Group G]
variable {A : Type*} [AddGroup A]
namespace Subgroup
variable (H K : Subgroup G)
@[to_additive "Sum of a list of elements in an `AddSubgroup` is in the `AddSubgroup`."]
protected theorem list_prod_mem {l : List G} : (β x β l, x β K) β l.prod β K :=
list_prod_mem
#align subgroup.list_prod_mem Subgroup.list_prod_mem
#align add_subgroup.list_sum_mem AddSubgroup.list_sum_mem
@[to_additive "Sum of a multiset of elements in an `AddSubgroup` of an `AddCommGroup` is in
the `AddSubgroup`."]
protected theorem multiset_prod_mem {G} [CommGroup G] (K : Subgroup G) (g : Multiset G) :
(β a β g, a β K) β g.prod β K :=
multiset_prod_mem g
#align subgroup.multiset_prod_mem Subgroup.multiset_prod_mem
#align add_subgroup.multiset_sum_mem AddSubgroup.multiset_sum_mem
@[to_additive]
theorem multiset_noncommProd_mem (K : Subgroup G) (g : Multiset G) (comm) :
(β a β g, a β K) β g.noncommProd comm β K :=
K.toSubmonoid.multiset_noncommProd_mem g comm
#align subgroup.multiset_noncomm_prod_mem Subgroup.multiset_noncommProd_mem
#align add_subgroup.multiset_noncomm_sum_mem AddSubgroup.multiset_noncommSum_mem
@[to_additive "Sum of elements in an `AddSubgroup` of an `AddCommGroup` indexed by a `Finset`
is in the `AddSubgroup`."]
protected theorem prod_mem {G : Type*} [CommGroup G] (K : Subgroup G) {ΞΉ : Type*} {t : Finset ΞΉ}
{f : ΞΉ β G} (h : β c β t, f c β K) : (β c β t, f c) β K :=
prod_mem h
#align subgroup.prod_mem Subgroup.prod_mem
#align add_subgroup.sum_mem AddSubgroup.sum_mem
@[to_additive]
theorem noncommProd_mem (K : Subgroup G) {ΞΉ : Type*} {t : Finset ΞΉ} {f : ΞΉ β G} (comm) :
(β c β t, f c β K) β t.noncommProd f comm β K :=
K.toSubmonoid.noncommProd_mem t f comm
#align subgroup.noncomm_prod_mem Subgroup.noncommProd_mem
#align add_subgroup.noncomm_sum_mem AddSubgroup.noncommSum_mem
-- Porting note: increased priority to appease `simpNF`, otherwise left-hand side reduces
@[to_additive (attr := simp 1100, norm_cast)]
theorem val_list_prod (l : List H) : (l.prod : G) = (l.map Subtype.val).prod :=
SubmonoidClass.coe_list_prod l
#align subgroup.coe_list_prod Subgroup.val_list_prod
#align add_subgroup.coe_list_sum AddSubgroup.val_list_sum
-- Porting note: increased priority to appease `simpNF`, otherwise left-hand side reduces
@[to_additive (attr := simp 1100, norm_cast)]
theorem val_multiset_prod {G} [CommGroup G] (H : Subgroup G) (m : Multiset H) :
(m.prod : G) = (m.map Subtype.val).prod :=
SubmonoidClass.coe_multiset_prod m
#align subgroup.coe_multiset_prod Subgroup.val_multiset_prod
#align add_subgroup.coe_multiset_sum AddSubgroup.val_multiset_sum
-- Porting note: increased priority to appease `simpNF`, otherwise `simp` can prove it.
@[to_additive (attr := simp 1100, norm_cast)]
theorem val_finset_prod {ΞΉ G} [CommGroup G] (H : Subgroup G) (f : ΞΉ β H) (s : Finset ΞΉ) :
β(β i β s, f i) = (β i β s, f i : G) :=
SubmonoidClass.coe_finset_prod f s
#align subgroup.coe_finset_prod Subgroup.val_finset_prod
#align add_subgroup.coe_finset_sum AddSubgroup.val_finset_sum
@[to_additive]
instance fintypeBot : Fintype (β₯ : Subgroup G) :=
β¨{1}, by
rintro β¨x, β¨hxβ©β©
exact Finset.mem_singleton_self _β©
#align subgroup.fintype_bot Subgroup.fintypeBot
#align add_subgroup.fintype_bot AddSubgroup.fintypeBot
@[to_additive] -- Porting note: removed `simp` because `simpNF` says it can prove it.
theorem card_bot : Nat.card (β₯ : Subgroup G) = 1 :=
Nat.card_unique
#align subgroup.card_bot Subgroup.card_bot
#align add_subgroup.card_bot AddSubgroup.card_bot
@[to_additive]
theorem card_top : Nat.card (β€ : Subgroup G) = Nat.card G :=
Nat.card_congr Subgroup.topEquiv.toEquiv
@[to_additive]
| Mathlib/Algebra/Group/Subgroup/Finite.lean | 127 | 137 | theorem eq_top_of_card_eq [Finite H] (h : Nat.card H = Nat.card G) :
H = β€ := by |
have : Nonempty H := β¨1, one_mem Hβ©
have h' : Nat.card H β 0 := Nat.card_pos.ne'
have : Finite G := (Nat.finite_of_card_ne_zero (h βΈ h'))
have : Fintype G := Fintype.ofFinite G
have : Fintype H := Fintype.ofFinite H
rw [Nat.card_eq_fintype_card, Nat.card_eq_fintype_card] at h
rw [SetLike.ext'_iff, coe_top, β Finset.coe_univ, β (H : Set G).coe_toFinset, Finset.coe_inj, β
Finset.card_eq_iff_eq_univ, β h, Set.toFinset_card]
congr
| 1,233 |
import Mathlib.Algebra.Group.Subgroup.Basic
import Mathlib.Algebra.Group.Submonoid.Membership
import Mathlib.Data.Finite.Card
#align_import group_theory.subgroup.finite from "leanprover-community/mathlib"@"f93c11933efbc3c2f0299e47b8ff83e9b539cbf6"
variable {G : Type*} [Group G]
variable {A : Type*} [AddGroup A]
namespace Subgroup
section Pi
open Set
variable {Ξ· : Type*} {f : Ξ· β Type*} [β i, Group (f i)]
@[to_additive]
| Mathlib/Algebra/Group/Subgroup/Finite.lean | 195 | 226 | theorem pi_mem_of_mulSingle_mem_aux [DecidableEq Ξ·] (I : Finset Ξ·) {H : Subgroup (β i, f i)}
(x : β i, f i) (h1 : β i, i β I β x i = 1) (h2 : β i, i β I β Pi.mulSingle i (x i) β H) :
x β H := by |
induction' I using Finset.induction_on with i I hnmem ih generalizing x
Β· convert one_mem H
ext i
exact h1 i (Finset.not_mem_empty i)
Β· have : x = Function.update x i 1 * Pi.mulSingle i (x i) := by
ext j
by_cases heq : j = i
Β· subst heq
simp
Β· simp [heq]
rw [this]
clear this
apply mul_mem
Β· apply ih <;> clear ih
Β· intro j hj
by_cases heq : j = i
Β· subst heq
simp
Β· simp [heq]
apply h1 j
simpa [heq] using hj
Β· intro j hj
have : j β i := by
rintro rfl
contradiction
simp only [ne_eq, this, not_false_eq_true, Function.update_noteq]
exact h2 _ (Finset.mem_insert_of_mem hj)
Β· apply h2
simp
| 1,233 |
import Mathlib.Algebra.Group.Subgroup.Basic
import Mathlib.Algebra.Group.Submonoid.Membership
import Mathlib.Data.Finite.Card
#align_import group_theory.subgroup.finite from "leanprover-community/mathlib"@"f93c11933efbc3c2f0299e47b8ff83e9b539cbf6"
variable {G : Type*} [Group G]
variable {A : Type*} [AddGroup A]
namespace Subgroup
section Pi
open Set
variable {Ξ· : Type*} {f : Ξ· β Type*} [β i, Group (f i)]
@[to_additive]
theorem pi_mem_of_mulSingle_mem_aux [DecidableEq Ξ·] (I : Finset Ξ·) {H : Subgroup (β i, f i)}
(x : β i, f i) (h1 : β i, i β I β x i = 1) (h2 : β i, i β I β Pi.mulSingle i (x i) β H) :
x β H := by
induction' I using Finset.induction_on with i I hnmem ih generalizing x
Β· convert one_mem H
ext i
exact h1 i (Finset.not_mem_empty i)
Β· have : x = Function.update x i 1 * Pi.mulSingle i (x i) := by
ext j
by_cases heq : j = i
Β· subst heq
simp
Β· simp [heq]
rw [this]
clear this
apply mul_mem
Β· apply ih <;> clear ih
Β· intro j hj
by_cases heq : j = i
Β· subst heq
simp
Β· simp [heq]
apply h1 j
simpa [heq] using hj
Β· intro j hj
have : j β i := by
rintro rfl
contradiction
simp only [ne_eq, this, not_false_eq_true, Function.update_noteq]
exact h2 _ (Finset.mem_insert_of_mem hj)
Β· apply h2
simp
#align subgroup.pi_mem_of_mul_single_mem_aux Subgroup.pi_mem_of_mulSingle_mem_aux
#align add_subgroup.pi_mem_of_single_mem_aux AddSubgroup.pi_mem_of_single_mem_aux
@[to_additive]
| Mathlib/Algebra/Group/Subgroup/Finite.lean | 231 | 234 | theorem pi_mem_of_mulSingle_mem [Finite Ξ·] [DecidableEq Ξ·] {H : Subgroup (β i, f i)} (x : β i, f i)
(h : β i, Pi.mulSingle i (x i) β H) : x β H := by |
cases nonempty_fintype Ξ·
exact pi_mem_of_mulSingle_mem_aux Finset.univ x (by simp) fun i _ => h i
| 1,233 |
import Mathlib.Algebra.Group.Subgroup.Basic
import Mathlib.Algebra.Group.Submonoid.Membership
import Mathlib.Data.Finite.Card
#align_import group_theory.subgroup.finite from "leanprover-community/mathlib"@"f93c11933efbc3c2f0299e47b8ff83e9b539cbf6"
variable {G : Type*} [Group G]
variable {A : Type*} [AddGroup A]
namespace Subgroup
section Pi
open Set
variable {Ξ· : Type*} {f : Ξ· β Type*} [β i, Group (f i)]
@[to_additive]
theorem pi_mem_of_mulSingle_mem_aux [DecidableEq Ξ·] (I : Finset Ξ·) {H : Subgroup (β i, f i)}
(x : β i, f i) (h1 : β i, i β I β x i = 1) (h2 : β i, i β I β Pi.mulSingle i (x i) β H) :
x β H := by
induction' I using Finset.induction_on with i I hnmem ih generalizing x
Β· convert one_mem H
ext i
exact h1 i (Finset.not_mem_empty i)
Β· have : x = Function.update x i 1 * Pi.mulSingle i (x i) := by
ext j
by_cases heq : j = i
Β· subst heq
simp
Β· simp [heq]
rw [this]
clear this
apply mul_mem
Β· apply ih <;> clear ih
Β· intro j hj
by_cases heq : j = i
Β· subst heq
simp
Β· simp [heq]
apply h1 j
simpa [heq] using hj
Β· intro j hj
have : j β i := by
rintro rfl
contradiction
simp only [ne_eq, this, not_false_eq_true, Function.update_noteq]
exact h2 _ (Finset.mem_insert_of_mem hj)
Β· apply h2
simp
#align subgroup.pi_mem_of_mul_single_mem_aux Subgroup.pi_mem_of_mulSingle_mem_aux
#align add_subgroup.pi_mem_of_single_mem_aux AddSubgroup.pi_mem_of_single_mem_aux
@[to_additive]
theorem pi_mem_of_mulSingle_mem [Finite Ξ·] [DecidableEq Ξ·] {H : Subgroup (β i, f i)} (x : β i, f i)
(h : β i, Pi.mulSingle i (x i) β H) : x β H := by
cases nonempty_fintype Ξ·
exact pi_mem_of_mulSingle_mem_aux Finset.univ x (by simp) fun i _ => h i
#align subgroup.pi_mem_of_mul_single_mem Subgroup.pi_mem_of_mulSingle_mem
#align add_subgroup.pi_mem_of_single_mem AddSubgroup.pi_mem_of_single_mem
@[to_additive "For finite index types, the `Subgroup.pi` is generated by the embeddings of the
additive groups."]
| Mathlib/Algebra/Group/Subgroup/Finite.lean | 241 | 247 | theorem pi_le_iff [DecidableEq Ξ·] [Finite Ξ·] {H : β i, Subgroup (f i)} {J : Subgroup (β i, f i)} :
pi univ H β€ J β β i : Ξ·, map (MonoidHom.mulSingle f i) (H i) β€ J := by |
constructor
Β· rintro h i _ β¨x, hx, rflβ©
apply h
simpa using hx
Β· exact fun h x hx => pi_mem_of_mulSingle_mem x fun i => h i (mem_map_of_mem _ (hx i trivial))
| 1,233 |
import Mathlib.Algebra.Group.Subgroup.Basic
import Mathlib.Algebra.Group.Submonoid.Membership
import Mathlib.Data.Finite.Card
#align_import group_theory.subgroup.finite from "leanprover-community/mathlib"@"f93c11933efbc3c2f0299e47b8ff83e9b539cbf6"
variable {G : Type*} [Group G]
variable {A : Type*} [AddGroup A]
namespace Subgroup
namespace Subgroup
section Normalizer
| Mathlib/Algebra/Group/Subgroup/Finite.lean | 259 | 270 | theorem mem_normalizer_fintype {S : Set G} [Finite S] {x : G} (h : β n, n β S β x * n * xβ»ΒΉ β S) :
x β Subgroup.setNormalizer S := by |
haveI := Classical.propDecidable; cases nonempty_fintype S;
haveI := Set.fintypeImage S fun n => x * n * xβ»ΒΉ;
exact fun n =>
β¨h n, fun hβ =>
have heq : (fun n => x * n * xβ»ΒΉ) '' S = S :=
Set.eq_of_subset_of_card_le (fun n β¨y, hyβ© => hy.2 βΈ h y hy.1)
(by rw [Set.card_image_of_injective S conj_injective])
have : x * n * xβ»ΒΉ β (fun n => x * n * xβ»ΒΉ) '' S := heq.symm βΈ hβ
let β¨y, hyβ© := this
conj_injective hy.2 βΈ hy.1β©
| 1,233 |
import Mathlib.Algebra.Group.Subgroup.Finite
import Mathlib.Data.Finset.Fin
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Int.Order.Units
import Mathlib.GroupTheory.Perm.Support
import Mathlib.Logic.Equiv.Fin
import Mathlib.Tactic.NormNum.Ineq
#align_import group_theory.perm.sign from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
universe u v
open Equiv Function Fintype Finset
variable {Ξ± : Type u} [DecidableEq Ξ±] {Ξ² : Type v}
namespace Equiv.Perm
def modSwap (i j : Ξ±) : Setoid (Perm Ξ±) :=
β¨fun Ο Ο => Ο = Ο β¨ Ο = swap i j * Ο, fun Ο => Or.inl (refl Ο), fun {Ο Ο} h =>
Or.casesOn h (fun h => Or.inl h.symm) fun h => Or.inr (by rw [h, swap_mul_self_mul]),
fun {Ο Ο Ο
} hΟΟ hΟΟ
=> by
cases' hΟΟ with hΟΟ hΟΟ <;> cases' hΟΟ
with hΟΟ
hΟΟ
<;> try rw [hΟΟ, hΟΟ
, swap_mul_self_mul] <;>
simp [hΟΟ, hΟΟ
] -- Porting note: should close goals, but doesn't
Β· simp [hΟΟ, hΟΟ
]
Β· simp [hΟΟ, hΟΟ
]
Β· simp [hΟΟ, hΟΟ
]β©
#align equiv.perm.mod_swap Equiv.Perm.modSwap
noncomputable instance {Ξ± : Type*} [Fintype Ξ±] [DecidableEq Ξ±] (i j : Ξ±) :
DecidableRel (modSwap i j).r :=
fun _ _ => Or.decidable
def swapFactorsAux :
β (l : List Ξ±) (f : Perm Ξ±),
(β {x}, f x β x β x β l) β { l : List (Perm Ξ±) // l.prod = f β§ β g β l, IsSwap g }
| [] => fun f h =>
β¨[],
Equiv.ext fun x => by
rw [List.prod_nil]
exact (Classical.not_not.1 (mt h (List.not_mem_nil _))).symm,
by simpβ©
| x::l => fun f h =>
if hfx : x = f x then
swapFactorsAux l f fun {y} hy =>
List.mem_of_ne_of_mem (fun h : y = x => by simp [h, hfx.symm] at hy) (h hy)
else
let m :=
swapFactorsAux l (swap x (f x) * f) fun {y} hy =>
have : f y β y β§ y β x := ne_and_ne_of_swap_mul_apply_ne_self hy
List.mem_of_ne_of_mem this.2 (h this.1)
β¨swap x (f x)::m.1, by
rw [List.prod_cons, m.2.1, β mul_assoc, mul_def (swap x (f x)), swap_swap, β one_def,
one_mul],
fun {g} hg => ((List.mem_cons).1 hg).elim (fun h => β¨x, f x, hfx, hβ©) (m.2.2 _)β©
#align equiv.perm.swap_factors_aux Equiv.Perm.swapFactorsAux
def swapFactors [Fintype Ξ±] [LinearOrder Ξ±] (f : Perm Ξ±) :
{ l : List (Perm Ξ±) // l.prod = f β§ β g β l, IsSwap g } :=
swapFactorsAux ((@univ Ξ± _).sort (Β· β€ Β·)) f fun {_ _} => (mem_sort _).2 (mem_univ _)
#align equiv.perm.swap_factors Equiv.Perm.swapFactors
def truncSwapFactors [Fintype Ξ±] (f : Perm Ξ±) :
Trunc { l : List (Perm Ξ±) // l.prod = f β§ β g β l, IsSwap g } :=
Quotient.recOnSubsingleton (@univ Ξ± _).1 (fun l h => Trunc.mk (swapFactorsAux l f (h _)))
(show β x, f x β x β x β (@univ Ξ± _).1 from fun _ _ => mem_univ _)
#align equiv.perm.trunc_swap_factors Equiv.Perm.truncSwapFactors
@[elab_as_elim]
| Mathlib/GroupTheory/Perm/Sign.lean | 99 | 110 | theorem swap_induction_on [Finite Ξ±] {P : Perm Ξ± β Prop} (f : Perm Ξ±) :
P 1 β (β f x y, x β y β P f β P (swap x y * f)) β P f := by |
cases nonempty_fintype Ξ±
cases' (truncSwapFactors f).out with l hl
induction' l with g l ih generalizing f
Β· simp (config := { contextual := true }) only [hl.left.symm, List.prod_nil, forall_true_iff]
Β· intro h1 hmul_swap
rcases hl.2 g (by simp) with β¨x, y, hxyβ©
rw [β hl.1, List.prod_cons, hxy.2]
exact
hmul_swap _ _ _ hxy.1
(ih _ β¨rfl, fun v hv => hl.2 _ (List.mem_cons_of_mem _ hv)β© h1 hmul_swap)
| 1,234 |
import Mathlib.Algebra.Group.Subgroup.Finite
import Mathlib.Data.Finset.Fin
import Mathlib.Data.Finset.Sort
import Mathlib.Data.Int.Order.Units
import Mathlib.GroupTheory.Perm.Support
import Mathlib.Logic.Equiv.Fin
import Mathlib.Tactic.NormNum.Ineq
#align_import group_theory.perm.sign from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
universe u v
open Equiv Function Fintype Finset
variable {Ξ± : Type u} [DecidableEq Ξ±] {Ξ² : Type v}
namespace Equiv.Perm
def modSwap (i j : Ξ±) : Setoid (Perm Ξ±) :=
β¨fun Ο Ο => Ο = Ο β¨ Ο = swap i j * Ο, fun Ο => Or.inl (refl Ο), fun {Ο Ο} h =>
Or.casesOn h (fun h => Or.inl h.symm) fun h => Or.inr (by rw [h, swap_mul_self_mul]),
fun {Ο Ο Ο
} hΟΟ hΟΟ
=> by
cases' hΟΟ with hΟΟ hΟΟ <;> cases' hΟΟ
with hΟΟ
hΟΟ
<;> try rw [hΟΟ, hΟΟ
, swap_mul_self_mul] <;>
simp [hΟΟ, hΟΟ
] -- Porting note: should close goals, but doesn't
Β· simp [hΟΟ, hΟΟ
]
Β· simp [hΟΟ, hΟΟ
]
Β· simp [hΟΟ, hΟΟ
]β©
#align equiv.perm.mod_swap Equiv.Perm.modSwap
noncomputable instance {Ξ± : Type*} [Fintype Ξ±] [DecidableEq Ξ±] (i j : Ξ±) :
DecidableRel (modSwap i j).r :=
fun _ _ => Or.decidable
def swapFactorsAux :
β (l : List Ξ±) (f : Perm Ξ±),
(β {x}, f x β x β x β l) β { l : List (Perm Ξ±) // l.prod = f β§ β g β l, IsSwap g }
| [] => fun f h =>
β¨[],
Equiv.ext fun x => by
rw [List.prod_nil]
exact (Classical.not_not.1 (mt h (List.not_mem_nil _))).symm,
by simpβ©
| x::l => fun f h =>
if hfx : x = f x then
swapFactorsAux l f fun {y} hy =>
List.mem_of_ne_of_mem (fun h : y = x => by simp [h, hfx.symm] at hy) (h hy)
else
let m :=
swapFactorsAux l (swap x (f x) * f) fun {y} hy =>
have : f y β y β§ y β x := ne_and_ne_of_swap_mul_apply_ne_self hy
List.mem_of_ne_of_mem this.2 (h this.1)
β¨swap x (f x)::m.1, by
rw [List.prod_cons, m.2.1, β mul_assoc, mul_def (swap x (f x)), swap_swap, β one_def,
one_mul],
fun {g} hg => ((List.mem_cons).1 hg).elim (fun h => β¨x, f x, hfx, hβ©) (m.2.2 _)β©
#align equiv.perm.swap_factors_aux Equiv.Perm.swapFactorsAux
def swapFactors [Fintype Ξ±] [LinearOrder Ξ±] (f : Perm Ξ±) :
{ l : List (Perm Ξ±) // l.prod = f β§ β g β l, IsSwap g } :=
swapFactorsAux ((@univ Ξ± _).sort (Β· β€ Β·)) f fun {_ _} => (mem_sort _).2 (mem_univ _)
#align equiv.perm.swap_factors Equiv.Perm.swapFactors
def truncSwapFactors [Fintype Ξ±] (f : Perm Ξ±) :
Trunc { l : List (Perm Ξ±) // l.prod = f β§ β g β l, IsSwap g } :=
Quotient.recOnSubsingleton (@univ Ξ± _).1 (fun l h => Trunc.mk (swapFactorsAux l f (h _)))
(show β x, f x β x β x β (@univ Ξ± _).1 from fun _ _ => mem_univ _)
#align equiv.perm.trunc_swap_factors Equiv.Perm.truncSwapFactors
@[elab_as_elim]
theorem swap_induction_on [Finite Ξ±] {P : Perm Ξ± β Prop} (f : Perm Ξ±) :
P 1 β (β f x y, x β y β P f β P (swap x y * f)) β P f := by
cases nonempty_fintype Ξ±
cases' (truncSwapFactors f).out with l hl
induction' l with g l ih generalizing f
Β· simp (config := { contextual := true }) only [hl.left.symm, List.prod_nil, forall_true_iff]
Β· intro h1 hmul_swap
rcases hl.2 g (by simp) with β¨x, y, hxyβ©
rw [β hl.1, List.prod_cons, hxy.2]
exact
hmul_swap _ _ _ hxy.1
(ih _ β¨rfl, fun v hv => hl.2 _ (List.mem_cons_of_mem _ hv)β© h1 hmul_swap)
#align equiv.perm.swap_induction_on Equiv.Perm.swap_induction_on
| Mathlib/GroupTheory/Perm/Sign.lean | 113 | 118 | theorem closure_isSwap [Finite Ξ±] : Subgroup.closure { Ο : Perm Ξ± | IsSwap Ο } = β€ := by |
cases nonempty_fintype Ξ±
refine eq_top_iff.mpr fun x _ => ?_
obtain β¨h1, h2β© := Subtype.mem (truncSwapFactors x).out
rw [β h1]
exact Subgroup.list_prod_mem _ fun y hy => Subgroup.subset_closure (h2 y hy)
| 1,234 |
import Mathlib.Data.Fintype.Basic
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Defs
#align_import logic.equiv.fintype from "leanprover-community/mathlib"@"9407b03373c8cd201df99d6bc5514fc2db44054f"
section Fintype
variable {Ξ± Ξ² : Type*} [Fintype Ξ±] [DecidableEq Ξ²] (e : Equiv.Perm Ξ±) (f : Ξ± βͺ Ξ²)
def Function.Embedding.toEquivRange : Ξ± β Set.range f :=
β¨fun a => β¨f a, Set.mem_range_self aβ©, f.invOfMemRange, fun _ => by simp, fun _ => by simpβ©
#align function.embedding.to_equiv_range Function.Embedding.toEquivRange
@[simp]
theorem Function.Embedding.toEquivRange_apply (a : Ξ±) :
f.toEquivRange a = β¨f a, Set.mem_range_self aβ© :=
rfl
#align function.embedding.to_equiv_range_apply Function.Embedding.toEquivRange_apply
@[simp]
| Mathlib/Logic/Equiv/Fintype.lean | 50 | 51 | theorem Function.Embedding.toEquivRange_symm_apply_self (a : Ξ±) :
f.toEquivRange.symm β¨f a, Set.mem_range_self aβ© = a := by | simp [Equiv.symm_apply_eq]
| 1,235 |
import Mathlib.Data.Fintype.Basic
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Defs
#align_import logic.equiv.fintype from "leanprover-community/mathlib"@"9407b03373c8cd201df99d6bc5514fc2db44054f"
section Fintype
variable {Ξ± Ξ² : Type*} [Fintype Ξ±] [DecidableEq Ξ²] (e : Equiv.Perm Ξ±) (f : Ξ± βͺ Ξ²)
def Function.Embedding.toEquivRange : Ξ± β Set.range f :=
β¨fun a => β¨f a, Set.mem_range_self aβ©, f.invOfMemRange, fun _ => by simp, fun _ => by simpβ©
#align function.embedding.to_equiv_range Function.Embedding.toEquivRange
@[simp]
theorem Function.Embedding.toEquivRange_apply (a : Ξ±) :
f.toEquivRange a = β¨f a, Set.mem_range_self aβ© :=
rfl
#align function.embedding.to_equiv_range_apply Function.Embedding.toEquivRange_apply
@[simp]
theorem Function.Embedding.toEquivRange_symm_apply_self (a : Ξ±) :
f.toEquivRange.symm β¨f a, Set.mem_range_self aβ© = a := by simp [Equiv.symm_apply_eq]
#align function.embedding.to_equiv_range_symm_apply_self Function.Embedding.toEquivRange_symm_apply_self
| Mathlib/Logic/Equiv/Fintype.lean | 54 | 57 | theorem Function.Embedding.toEquivRange_eq_ofInjective :
f.toEquivRange = Equiv.ofInjective f f.injective := by |
ext
simp
| 1,235 |
import Mathlib.Data.Fintype.Basic
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Defs
#align_import logic.equiv.fintype from "leanprover-community/mathlib"@"9407b03373c8cd201df99d6bc5514fc2db44054f"
section Fintype
variable {Ξ± Ξ² : Type*} [Fintype Ξ±] [DecidableEq Ξ²] (e : Equiv.Perm Ξ±) (f : Ξ± βͺ Ξ²)
def Function.Embedding.toEquivRange : Ξ± β Set.range f :=
β¨fun a => β¨f a, Set.mem_range_self aβ©, f.invOfMemRange, fun _ => by simp, fun _ => by simpβ©
#align function.embedding.to_equiv_range Function.Embedding.toEquivRange
@[simp]
theorem Function.Embedding.toEquivRange_apply (a : Ξ±) :
f.toEquivRange a = β¨f a, Set.mem_range_self aβ© :=
rfl
#align function.embedding.to_equiv_range_apply Function.Embedding.toEquivRange_apply
@[simp]
theorem Function.Embedding.toEquivRange_symm_apply_self (a : Ξ±) :
f.toEquivRange.symm β¨f a, Set.mem_range_self aβ© = a := by simp [Equiv.symm_apply_eq]
#align function.embedding.to_equiv_range_symm_apply_self Function.Embedding.toEquivRange_symm_apply_self
theorem Function.Embedding.toEquivRange_eq_ofInjective :
f.toEquivRange = Equiv.ofInjective f f.injective := by
ext
simp
#align function.embedding.to_equiv_range_eq_of_injective Function.Embedding.toEquivRange_eq_ofInjective
def Equiv.Perm.viaFintypeEmbedding : Equiv.Perm Ξ² :=
e.extendDomain f.toEquivRange
#align equiv.perm.via_fintype_embedding Equiv.Perm.viaFintypeEmbedding
@[simp]
| Mathlib/Logic/Equiv/Fintype.lean | 72 | 75 | theorem Equiv.Perm.viaFintypeEmbedding_apply_image (a : Ξ±) :
e.viaFintypeEmbedding f (f a) = f (e a) := by |
rw [Equiv.Perm.viaFintypeEmbedding]
convert Equiv.Perm.extendDomain_apply_image e (Function.Embedding.toEquivRange f) a
| 1,235 |
import Mathlib.Data.Fintype.Basic
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Defs
#align_import logic.equiv.fintype from "leanprover-community/mathlib"@"9407b03373c8cd201df99d6bc5514fc2db44054f"
section Fintype
variable {Ξ± Ξ² : Type*} [Fintype Ξ±] [DecidableEq Ξ²] (e : Equiv.Perm Ξ±) (f : Ξ± βͺ Ξ²)
def Function.Embedding.toEquivRange : Ξ± β Set.range f :=
β¨fun a => β¨f a, Set.mem_range_self aβ©, f.invOfMemRange, fun _ => by simp, fun _ => by simpβ©
#align function.embedding.to_equiv_range Function.Embedding.toEquivRange
@[simp]
theorem Function.Embedding.toEquivRange_apply (a : Ξ±) :
f.toEquivRange a = β¨f a, Set.mem_range_self aβ© :=
rfl
#align function.embedding.to_equiv_range_apply Function.Embedding.toEquivRange_apply
@[simp]
theorem Function.Embedding.toEquivRange_symm_apply_self (a : Ξ±) :
f.toEquivRange.symm β¨f a, Set.mem_range_self aβ© = a := by simp [Equiv.symm_apply_eq]
#align function.embedding.to_equiv_range_symm_apply_self Function.Embedding.toEquivRange_symm_apply_self
theorem Function.Embedding.toEquivRange_eq_ofInjective :
f.toEquivRange = Equiv.ofInjective f f.injective := by
ext
simp
#align function.embedding.to_equiv_range_eq_of_injective Function.Embedding.toEquivRange_eq_ofInjective
def Equiv.Perm.viaFintypeEmbedding : Equiv.Perm Ξ² :=
e.extendDomain f.toEquivRange
#align equiv.perm.via_fintype_embedding Equiv.Perm.viaFintypeEmbedding
@[simp]
theorem Equiv.Perm.viaFintypeEmbedding_apply_image (a : Ξ±) :
e.viaFintypeEmbedding f (f a) = f (e a) := by
rw [Equiv.Perm.viaFintypeEmbedding]
convert Equiv.Perm.extendDomain_apply_image e (Function.Embedding.toEquivRange f) a
#align equiv.perm.via_fintype_embedding_apply_image Equiv.Perm.viaFintypeEmbedding_apply_image
| Mathlib/Logic/Equiv/Fintype.lean | 78 | 82 | theorem Equiv.Perm.viaFintypeEmbedding_apply_mem_range {b : Ξ²} (h : b β Set.range f) :
e.viaFintypeEmbedding f b = f (e (f.invOfMemRange β¨b, hβ©)) := by |
simp only [viaFintypeEmbedding, Function.Embedding.invOfMemRange]
rw [Equiv.Perm.extendDomain_apply_subtype]
congr
| 1,235 |
import Mathlib.Data.Fintype.Basic
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Defs
#align_import logic.equiv.fintype from "leanprover-community/mathlib"@"9407b03373c8cd201df99d6bc5514fc2db44054f"
section Fintype
variable {Ξ± Ξ² : Type*} [Fintype Ξ±] [DecidableEq Ξ²] (e : Equiv.Perm Ξ±) (f : Ξ± βͺ Ξ²)
def Function.Embedding.toEquivRange : Ξ± β Set.range f :=
β¨fun a => β¨f a, Set.mem_range_self aβ©, f.invOfMemRange, fun _ => by simp, fun _ => by simpβ©
#align function.embedding.to_equiv_range Function.Embedding.toEquivRange
@[simp]
theorem Function.Embedding.toEquivRange_apply (a : Ξ±) :
f.toEquivRange a = β¨f a, Set.mem_range_self aβ© :=
rfl
#align function.embedding.to_equiv_range_apply Function.Embedding.toEquivRange_apply
@[simp]
theorem Function.Embedding.toEquivRange_symm_apply_self (a : Ξ±) :
f.toEquivRange.symm β¨f a, Set.mem_range_self aβ© = a := by simp [Equiv.symm_apply_eq]
#align function.embedding.to_equiv_range_symm_apply_self Function.Embedding.toEquivRange_symm_apply_self
theorem Function.Embedding.toEquivRange_eq_ofInjective :
f.toEquivRange = Equiv.ofInjective f f.injective := by
ext
simp
#align function.embedding.to_equiv_range_eq_of_injective Function.Embedding.toEquivRange_eq_ofInjective
def Equiv.Perm.viaFintypeEmbedding : Equiv.Perm Ξ² :=
e.extendDomain f.toEquivRange
#align equiv.perm.via_fintype_embedding Equiv.Perm.viaFintypeEmbedding
@[simp]
theorem Equiv.Perm.viaFintypeEmbedding_apply_image (a : Ξ±) :
e.viaFintypeEmbedding f (f a) = f (e a) := by
rw [Equiv.Perm.viaFintypeEmbedding]
convert Equiv.Perm.extendDomain_apply_image e (Function.Embedding.toEquivRange f) a
#align equiv.perm.via_fintype_embedding_apply_image Equiv.Perm.viaFintypeEmbedding_apply_image
theorem Equiv.Perm.viaFintypeEmbedding_apply_mem_range {b : Ξ²} (h : b β Set.range f) :
e.viaFintypeEmbedding f b = f (e (f.invOfMemRange β¨b, hβ©)) := by
simp only [viaFintypeEmbedding, Function.Embedding.invOfMemRange]
rw [Equiv.Perm.extendDomain_apply_subtype]
congr
#align equiv.perm.via_fintype_embedding_apply_mem_range Equiv.Perm.viaFintypeEmbedding_apply_mem_range
| Mathlib/Logic/Equiv/Fintype.lean | 85 | 87 | theorem Equiv.Perm.viaFintypeEmbedding_apply_not_mem_range {b : Ξ²} (h : b β Set.range f) :
e.viaFintypeEmbedding f b = b := by |
rwa [Equiv.Perm.viaFintypeEmbedding, Equiv.Perm.extendDomain_apply_not_subtype]
| 1,235 |
import Mathlib.Data.Fintype.Basic
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Defs
#align_import logic.equiv.fintype from "leanprover-community/mathlib"@"9407b03373c8cd201df99d6bc5514fc2db44054f"
section Fintype
variable {Ξ± Ξ² : Type*} [Fintype Ξ±] [DecidableEq Ξ²] (e : Equiv.Perm Ξ±) (f : Ξ± βͺ Ξ²)
def Function.Embedding.toEquivRange : Ξ± β Set.range f :=
β¨fun a => β¨f a, Set.mem_range_self aβ©, f.invOfMemRange, fun _ => by simp, fun _ => by simpβ©
#align function.embedding.to_equiv_range Function.Embedding.toEquivRange
@[simp]
theorem Function.Embedding.toEquivRange_apply (a : Ξ±) :
f.toEquivRange a = β¨f a, Set.mem_range_self aβ© :=
rfl
#align function.embedding.to_equiv_range_apply Function.Embedding.toEquivRange_apply
@[simp]
theorem Function.Embedding.toEquivRange_symm_apply_self (a : Ξ±) :
f.toEquivRange.symm β¨f a, Set.mem_range_self aβ© = a := by simp [Equiv.symm_apply_eq]
#align function.embedding.to_equiv_range_symm_apply_self Function.Embedding.toEquivRange_symm_apply_self
theorem Function.Embedding.toEquivRange_eq_ofInjective :
f.toEquivRange = Equiv.ofInjective f f.injective := by
ext
simp
#align function.embedding.to_equiv_range_eq_of_injective Function.Embedding.toEquivRange_eq_ofInjective
def Equiv.Perm.viaFintypeEmbedding : Equiv.Perm Ξ² :=
e.extendDomain f.toEquivRange
#align equiv.perm.via_fintype_embedding Equiv.Perm.viaFintypeEmbedding
@[simp]
theorem Equiv.Perm.viaFintypeEmbedding_apply_image (a : Ξ±) :
e.viaFintypeEmbedding f (f a) = f (e a) := by
rw [Equiv.Perm.viaFintypeEmbedding]
convert Equiv.Perm.extendDomain_apply_image e (Function.Embedding.toEquivRange f) a
#align equiv.perm.via_fintype_embedding_apply_image Equiv.Perm.viaFintypeEmbedding_apply_image
theorem Equiv.Perm.viaFintypeEmbedding_apply_mem_range {b : Ξ²} (h : b β Set.range f) :
e.viaFintypeEmbedding f b = f (e (f.invOfMemRange β¨b, hβ©)) := by
simp only [viaFintypeEmbedding, Function.Embedding.invOfMemRange]
rw [Equiv.Perm.extendDomain_apply_subtype]
congr
#align equiv.perm.via_fintype_embedding_apply_mem_range Equiv.Perm.viaFintypeEmbedding_apply_mem_range
theorem Equiv.Perm.viaFintypeEmbedding_apply_not_mem_range {b : Ξ²} (h : b β Set.range f) :
e.viaFintypeEmbedding f b = b := by
rwa [Equiv.Perm.viaFintypeEmbedding, Equiv.Perm.extendDomain_apply_not_subtype]
#align equiv.perm.via_fintype_embedding_apply_not_mem_range Equiv.Perm.viaFintypeEmbedding_apply_not_mem_range
@[simp]
| Mathlib/Logic/Equiv/Fintype.lean | 91 | 93 | theorem Equiv.Perm.viaFintypeEmbedding_sign [DecidableEq Ξ±] [Fintype Ξ²] :
Equiv.Perm.sign (e.viaFintypeEmbedding f) = Equiv.Perm.sign e := by |
simp [Equiv.Perm.viaFintypeEmbedding]
| 1,235 |
import Mathlib.Data.Fintype.Basic
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Defs
#align_import logic.equiv.fintype from "leanprover-community/mathlib"@"9407b03373c8cd201df99d6bc5514fc2db44054f"
namespace Equiv
variable {Ξ± Ξ² : Type*} [Finite Ξ±]
noncomputable def toCompl {p q : Ξ± β Prop} (e : { x // p x } β { x // q x }) :
{ x // Β¬p x } β { x // Β¬q x } := by
apply Classical.choice
cases nonempty_fintype Ξ±
classical
exact Fintype.card_eq.mp <| Fintype.card_compl_eq_card_compl _ _ <| Fintype.card_congr e
#align equiv.to_compl Equiv.toCompl
variable {p q : Ξ± β Prop} [DecidablePred p] [DecidablePred q]
noncomputable abbrev extendSubtype (e : { x // p x } β { x // q x }) : Perm Ξ± :=
subtypeCongr e e.toCompl
#align equiv.extend_subtype Equiv.extendSubtype
| Mathlib/Logic/Equiv/Fintype.lean | 125 | 129 | theorem extendSubtype_apply_of_mem (e : { x // p x } β { x // q x }) (x) (hx : p x) :
e.extendSubtype x = e β¨x, hxβ© := by |
dsimp only [extendSubtype]
simp only [subtypeCongr, Equiv.trans_apply, Equiv.sumCongr_apply]
rw [sumCompl_apply_symm_of_pos _ _ hx, Sum.map_inl, sumCompl_apply_inl]
| 1,235 |
import Mathlib.Data.Fintype.Basic
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Defs
#align_import logic.equiv.fintype from "leanprover-community/mathlib"@"9407b03373c8cd201df99d6bc5514fc2db44054f"
namespace Equiv
variable {Ξ± Ξ² : Type*} [Finite Ξ±]
noncomputable def toCompl {p q : Ξ± β Prop} (e : { x // p x } β { x // q x }) :
{ x // Β¬p x } β { x // Β¬q x } := by
apply Classical.choice
cases nonempty_fintype Ξ±
classical
exact Fintype.card_eq.mp <| Fintype.card_compl_eq_card_compl _ _ <| Fintype.card_congr e
#align equiv.to_compl Equiv.toCompl
variable {p q : Ξ± β Prop} [DecidablePred p] [DecidablePred q]
noncomputable abbrev extendSubtype (e : { x // p x } β { x // q x }) : Perm Ξ± :=
subtypeCongr e e.toCompl
#align equiv.extend_subtype Equiv.extendSubtype
theorem extendSubtype_apply_of_mem (e : { x // p x } β { x // q x }) (x) (hx : p x) :
e.extendSubtype x = e β¨x, hxβ© := by
dsimp only [extendSubtype]
simp only [subtypeCongr, Equiv.trans_apply, Equiv.sumCongr_apply]
rw [sumCompl_apply_symm_of_pos _ _ hx, Sum.map_inl, sumCompl_apply_inl]
#align equiv.extend_subtype_apply_of_mem Equiv.extendSubtype_apply_of_mem
| Mathlib/Logic/Equiv/Fintype.lean | 132 | 135 | theorem extendSubtype_mem (e : { x // p x } β { x // q x }) (x) (hx : p x) :
q (e.extendSubtype x) := by |
convert (e β¨x, hxβ©).2
rw [e.extendSubtype_apply_of_mem _ hx]
| 1,235 |
import Mathlib.Data.Fintype.Basic
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Defs
#align_import logic.equiv.fintype from "leanprover-community/mathlib"@"9407b03373c8cd201df99d6bc5514fc2db44054f"
namespace Equiv
variable {Ξ± Ξ² : Type*} [Finite Ξ±]
noncomputable def toCompl {p q : Ξ± β Prop} (e : { x // p x } β { x // q x }) :
{ x // Β¬p x } β { x // Β¬q x } := by
apply Classical.choice
cases nonempty_fintype Ξ±
classical
exact Fintype.card_eq.mp <| Fintype.card_compl_eq_card_compl _ _ <| Fintype.card_congr e
#align equiv.to_compl Equiv.toCompl
variable {p q : Ξ± β Prop} [DecidablePred p] [DecidablePred q]
noncomputable abbrev extendSubtype (e : { x // p x } β { x // q x }) : Perm Ξ± :=
subtypeCongr e e.toCompl
#align equiv.extend_subtype Equiv.extendSubtype
theorem extendSubtype_apply_of_mem (e : { x // p x } β { x // q x }) (x) (hx : p x) :
e.extendSubtype x = e β¨x, hxβ© := by
dsimp only [extendSubtype]
simp only [subtypeCongr, Equiv.trans_apply, Equiv.sumCongr_apply]
rw [sumCompl_apply_symm_of_pos _ _ hx, Sum.map_inl, sumCompl_apply_inl]
#align equiv.extend_subtype_apply_of_mem Equiv.extendSubtype_apply_of_mem
theorem extendSubtype_mem (e : { x // p x } β { x // q x }) (x) (hx : p x) :
q (e.extendSubtype x) := by
convert (e β¨x, hxβ©).2
rw [e.extendSubtype_apply_of_mem _ hx]
#align equiv.extend_subtype_mem Equiv.extendSubtype_mem
| Mathlib/Logic/Equiv/Fintype.lean | 138 | 142 | theorem extendSubtype_apply_of_not_mem (e : { x // p x } β { x // q x }) (x) (hx : Β¬p x) :
e.extendSubtype x = e.toCompl β¨x, hxβ© := by |
dsimp only [extendSubtype]
simp only [subtypeCongr, Equiv.trans_apply, Equiv.sumCongr_apply]
rw [sumCompl_apply_symm_of_neg _ _ hx, Sum.map_inr, sumCompl_apply_inr]
| 1,235 |
import Mathlib.Data.Fintype.Basic
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Defs
#align_import logic.equiv.fintype from "leanprover-community/mathlib"@"9407b03373c8cd201df99d6bc5514fc2db44054f"
namespace Equiv
variable {Ξ± Ξ² : Type*} [Finite Ξ±]
noncomputable def toCompl {p q : Ξ± β Prop} (e : { x // p x } β { x // q x }) :
{ x // Β¬p x } β { x // Β¬q x } := by
apply Classical.choice
cases nonempty_fintype Ξ±
classical
exact Fintype.card_eq.mp <| Fintype.card_compl_eq_card_compl _ _ <| Fintype.card_congr e
#align equiv.to_compl Equiv.toCompl
variable {p q : Ξ± β Prop} [DecidablePred p] [DecidablePred q]
noncomputable abbrev extendSubtype (e : { x // p x } β { x // q x }) : Perm Ξ± :=
subtypeCongr e e.toCompl
#align equiv.extend_subtype Equiv.extendSubtype
theorem extendSubtype_apply_of_mem (e : { x // p x } β { x // q x }) (x) (hx : p x) :
e.extendSubtype x = e β¨x, hxβ© := by
dsimp only [extendSubtype]
simp only [subtypeCongr, Equiv.trans_apply, Equiv.sumCongr_apply]
rw [sumCompl_apply_symm_of_pos _ _ hx, Sum.map_inl, sumCompl_apply_inl]
#align equiv.extend_subtype_apply_of_mem Equiv.extendSubtype_apply_of_mem
theorem extendSubtype_mem (e : { x // p x } β { x // q x }) (x) (hx : p x) :
q (e.extendSubtype x) := by
convert (e β¨x, hxβ©).2
rw [e.extendSubtype_apply_of_mem _ hx]
#align equiv.extend_subtype_mem Equiv.extendSubtype_mem
theorem extendSubtype_apply_of_not_mem (e : { x // p x } β { x // q x }) (x) (hx : Β¬p x) :
e.extendSubtype x = e.toCompl β¨x, hxβ© := by
dsimp only [extendSubtype]
simp only [subtypeCongr, Equiv.trans_apply, Equiv.sumCongr_apply]
rw [sumCompl_apply_symm_of_neg _ _ hx, Sum.map_inr, sumCompl_apply_inr]
#align equiv.extend_subtype_apply_of_not_mem Equiv.extendSubtype_apply_of_not_mem
| Mathlib/Logic/Equiv/Fintype.lean | 145 | 148 | theorem extendSubtype_not_mem (e : { x // p x } β { x // q x }) (x) (hx : Β¬p x) :
Β¬q (e.extendSubtype x) := by |
convert (e.toCompl β¨x, hxβ©).2
rw [e.extendSubtype_apply_of_not_mem _ hx]
| 1,235 |
import Mathlib.Algebra.Algebra.Defs
import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.Fintype.Sort
import Mathlib.Data.List.FinRange
import Mathlib.LinearAlgebra.Pi
import Mathlib.Logic.Equiv.Fintype
#align_import linear_algebra.multilinear.basic from "leanprover-community/mathlib"@"78fdf68dcd2fdb3fe64c0dd6f88926a49418a6ea"
open Function Fin Set
universe uR uS uΞΉ v v' vβ vβ vβ
variable {R : Type uR} {S : Type uS} {ΞΉ : Type uΞΉ} {n : β}
{M : Fin n.succ β Type v} {Mβ : ΞΉ β Type vβ} {Mβ : Type vβ} {Mβ : Type vβ} {M' : Type v'}
structure MultilinearMap (R : Type uR) {ΞΉ : Type uΞΉ} (Mβ : ΞΉ β Type vβ) (Mβ : Type vβ) [Semiring R]
[β i, AddCommMonoid (Mβ i)] [AddCommMonoid Mβ] [β i, Module R (Mβ i)] [Module R Mβ] where
toFun : (β i, Mβ i) β Mβ
map_add' :
β [DecidableEq ΞΉ] (m : β i, Mβ i) (i : ΞΉ) (x y : Mβ i),
toFun (update m i (x + y)) = toFun (update m i x) + toFun (update m i y)
map_smul' :
β [DecidableEq ΞΉ] (m : β i, Mβ i) (i : ΞΉ) (c : R) (x : Mβ i),
toFun (update m i (c β’ x)) = c β’ toFun (update m i x)
#align multilinear_map MultilinearMap
-- Porting note: added to avoid a linter timeout.
attribute [nolint simpNF] MultilinearMap.mk.injEq
namespace MultilinearMap
section Semiring
variable [Semiring R] [β i, AddCommMonoid (M i)] [β i, AddCommMonoid (Mβ i)] [AddCommMonoid Mβ]
[AddCommMonoid Mβ] [AddCommMonoid M'] [β i, Module R (M i)] [β i, Module R (Mβ i)] [Module R Mβ]
[Module R Mβ] [Module R M'] (f f' : MultilinearMap R Mβ Mβ)
-- Porting note: Replaced CoeFun with FunLike instance
instance : FunLike (MultilinearMap R Mβ Mβ) (β i, Mβ i) Mβ where
coe f := f.toFun
coe_injective' := fun f g h β¦ by cases f; cases g; cases h; rfl
initialize_simps_projections MultilinearMap (toFun β apply)
@[simp]
theorem toFun_eq_coe : f.toFun = βf :=
rfl
#align multilinear_map.to_fun_eq_coe MultilinearMap.toFun_eq_coe
@[simp]
theorem coe_mk (f : (β i, Mβ i) β Mβ) (hβ hβ) : β(β¨f, hβ, hββ© : MultilinearMap R Mβ Mβ) = f :=
rfl
#align multilinear_map.coe_mk MultilinearMap.coe_mk
theorem congr_fun {f g : MultilinearMap R Mβ Mβ} (h : f = g) (x : β i, Mβ i) : f x = g x :=
DFunLike.congr_fun h x
#align multilinear_map.congr_fun MultilinearMap.congr_fun
nonrec theorem congr_arg (f : MultilinearMap R Mβ Mβ) {x y : β i, Mβ i} (h : x = y) : f x = f y :=
DFunLike.congr_arg f h
#align multilinear_map.congr_arg MultilinearMap.congr_arg
theorem coe_injective : Injective ((β) : MultilinearMap R Mβ Mβ β (β i, Mβ i) β Mβ) :=
DFunLike.coe_injective
#align multilinear_map.coe_injective MultilinearMap.coe_injective
@[norm_cast] -- Porting note (#10618): Removed simp attribute, simp can prove this
theorem coe_inj {f g : MultilinearMap R Mβ Mβ} : (f : (β i, Mβ i) β Mβ) = g β f = g :=
DFunLike.coe_fn_eq
#align multilinear_map.coe_inj MultilinearMap.coe_inj
@[ext]
theorem ext {f f' : MultilinearMap R Mβ Mβ} (H : β x, f x = f' x) : f = f' :=
DFunLike.ext _ _ H
#align multilinear_map.ext MultilinearMap.ext
theorem ext_iff {f g : MultilinearMap R Mβ Mβ} : f = g β β x, f x = g x :=
DFunLike.ext_iff
#align multilinear_map.ext_iff MultilinearMap.ext_iff
@[simp]
theorem mk_coe (f : MultilinearMap R Mβ Mβ) (hβ hβ) :
(β¨f, hβ, hββ© : MultilinearMap R Mβ Mβ) = f := rfl
#align multilinear_map.mk_coe MultilinearMap.mk_coe
@[simp]
protected theorem map_add [DecidableEq ΞΉ] (m : β i, Mβ i) (i : ΞΉ) (x y : Mβ i) :
f (update m i (x + y)) = f (update m i x) + f (update m i y) :=
f.map_add' m i x y
#align multilinear_map.map_add MultilinearMap.map_add
@[simp]
protected theorem map_smul [DecidableEq ΞΉ] (m : β i, Mβ i) (i : ΞΉ) (c : R) (x : Mβ i) :
f (update m i (c β’ x)) = c β’ f (update m i x) :=
f.map_smul' m i c x
#align multilinear_map.map_smul MultilinearMap.map_smul
| Mathlib/LinearAlgebra/Multilinear/Basic.lean | 171 | 174 | theorem map_coord_zero {m : β i, Mβ i} (i : ΞΉ) (h : m i = 0) : f m = 0 := by |
classical
have : (0 : R) β’ (0 : Mβ i) = 0 := by simp
rw [β update_eq_self i m, h, β this, f.map_smul, zero_smul R (M := Mβ)]
| 1,236 |
import Mathlib.Algebra.Algebra.Defs
import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.Fintype.Sort
import Mathlib.Data.List.FinRange
import Mathlib.LinearAlgebra.Pi
import Mathlib.Logic.Equiv.Fintype
#align_import linear_algebra.multilinear.basic from "leanprover-community/mathlib"@"78fdf68dcd2fdb3fe64c0dd6f88926a49418a6ea"
open Function Fin Set
universe uR uS uΞΉ v v' vβ vβ vβ
variable {R : Type uR} {S : Type uS} {ΞΉ : Type uΞΉ} {n : β}
{M : Fin n.succ β Type v} {Mβ : ΞΉ β Type vβ} {Mβ : Type vβ} {Mβ : Type vβ} {M' : Type v'}
structure MultilinearMap (R : Type uR) {ΞΉ : Type uΞΉ} (Mβ : ΞΉ β Type vβ) (Mβ : Type vβ) [Semiring R]
[β i, AddCommMonoid (Mβ i)] [AddCommMonoid Mβ] [β i, Module R (Mβ i)] [Module R Mβ] where
toFun : (β i, Mβ i) β Mβ
map_add' :
β [DecidableEq ΞΉ] (m : β i, Mβ i) (i : ΞΉ) (x y : Mβ i),
toFun (update m i (x + y)) = toFun (update m i x) + toFun (update m i y)
map_smul' :
β [DecidableEq ΞΉ] (m : β i, Mβ i) (i : ΞΉ) (c : R) (x : Mβ i),
toFun (update m i (c β’ x)) = c β’ toFun (update m i x)
#align multilinear_map MultilinearMap
-- Porting note: added to avoid a linter timeout.
attribute [nolint simpNF] MultilinearMap.mk.injEq
namespace MultilinearMap
section Semiring
variable [Semiring R] [β i, AddCommMonoid (M i)] [β i, AddCommMonoid (Mβ i)] [AddCommMonoid Mβ]
[AddCommMonoid Mβ] [AddCommMonoid M'] [β i, Module R (M i)] [β i, Module R (Mβ i)] [Module R Mβ]
[Module R Mβ] [Module R M'] (f f' : MultilinearMap R Mβ Mβ)
-- Porting note: Replaced CoeFun with FunLike instance
instance : FunLike (MultilinearMap R Mβ Mβ) (β i, Mβ i) Mβ where
coe f := f.toFun
coe_injective' := fun f g h β¦ by cases f; cases g; cases h; rfl
initialize_simps_projections MultilinearMap (toFun β apply)
@[simp]
theorem toFun_eq_coe : f.toFun = βf :=
rfl
#align multilinear_map.to_fun_eq_coe MultilinearMap.toFun_eq_coe
@[simp]
theorem coe_mk (f : (β i, Mβ i) β Mβ) (hβ hβ) : β(β¨f, hβ, hββ© : MultilinearMap R Mβ Mβ) = f :=
rfl
#align multilinear_map.coe_mk MultilinearMap.coe_mk
theorem congr_fun {f g : MultilinearMap R Mβ Mβ} (h : f = g) (x : β i, Mβ i) : f x = g x :=
DFunLike.congr_fun h x
#align multilinear_map.congr_fun MultilinearMap.congr_fun
nonrec theorem congr_arg (f : MultilinearMap R Mβ Mβ) {x y : β i, Mβ i} (h : x = y) : f x = f y :=
DFunLike.congr_arg f h
#align multilinear_map.congr_arg MultilinearMap.congr_arg
theorem coe_injective : Injective ((β) : MultilinearMap R Mβ Mβ β (β i, Mβ i) β Mβ) :=
DFunLike.coe_injective
#align multilinear_map.coe_injective MultilinearMap.coe_injective
@[norm_cast] -- Porting note (#10618): Removed simp attribute, simp can prove this
theorem coe_inj {f g : MultilinearMap R Mβ Mβ} : (f : (β i, Mβ i) β Mβ) = g β f = g :=
DFunLike.coe_fn_eq
#align multilinear_map.coe_inj MultilinearMap.coe_inj
@[ext]
theorem ext {f f' : MultilinearMap R Mβ Mβ} (H : β x, f x = f' x) : f = f' :=
DFunLike.ext _ _ H
#align multilinear_map.ext MultilinearMap.ext
theorem ext_iff {f g : MultilinearMap R Mβ Mβ} : f = g β β x, f x = g x :=
DFunLike.ext_iff
#align multilinear_map.ext_iff MultilinearMap.ext_iff
@[simp]
theorem mk_coe (f : MultilinearMap R Mβ Mβ) (hβ hβ) :
(β¨f, hβ, hββ© : MultilinearMap R Mβ Mβ) = f := rfl
#align multilinear_map.mk_coe MultilinearMap.mk_coe
@[simp]
protected theorem map_add [DecidableEq ΞΉ] (m : β i, Mβ i) (i : ΞΉ) (x y : Mβ i) :
f (update m i (x + y)) = f (update m i x) + f (update m i y) :=
f.map_add' m i x y
#align multilinear_map.map_add MultilinearMap.map_add
@[simp]
protected theorem map_smul [DecidableEq ΞΉ] (m : β i, Mβ i) (i : ΞΉ) (c : R) (x : Mβ i) :
f (update m i (c β’ x)) = c β’ f (update m i x) :=
f.map_smul' m i c x
#align multilinear_map.map_smul MultilinearMap.map_smul
theorem map_coord_zero {m : β i, Mβ i} (i : ΞΉ) (h : m i = 0) : f m = 0 := by
classical
have : (0 : R) β’ (0 : Mβ i) = 0 := by simp
rw [β update_eq_self i m, h, β this, f.map_smul, zero_smul R (M := Mβ)]
#align multilinear_map.map_coord_zero MultilinearMap.map_coord_zero
@[simp]
theorem map_update_zero [DecidableEq ΞΉ] (m : β i, Mβ i) (i : ΞΉ) : f (update m i 0) = 0 :=
f.map_coord_zero i (update_same i 0 m)
#align multilinear_map.map_update_zero MultilinearMap.map_update_zero
@[simp]
| Mathlib/LinearAlgebra/Multilinear/Basic.lean | 183 | 185 | theorem map_zero [Nonempty ΞΉ] : f 0 = 0 := by |
obtain β¨i, _β© : β i : ΞΉ, i β Set.univ := Set.exists_mem_of_nonempty ΞΉ
exact map_coord_zero f i rfl
| 1,236 |
import Mathlib.Topology.Algebra.Module.Basic
import Mathlib.LinearAlgebra.Multilinear.Basic
#align_import topology.algebra.module.multilinear from "leanprover-community/mathlib"@"f40476639bac089693a489c9e354ebd75dc0f886"
open Function Fin Set
universe u v w wβ wβ' wβ wβ wβ
variable {R : Type u} {ΞΉ : Type v} {n : β} {M : Fin n.succ β Type w} {Mβ : ΞΉ β Type wβ}
{Mβ' : ΞΉ β Type wβ'} {Mβ : Type wβ} {Mβ : Type wβ} {Mβ : Type wβ}
structure ContinuousMultilinearMap (R : Type u) {ΞΉ : Type v} (Mβ : ΞΉ β Type wβ) (Mβ : Type wβ)
[Semiring R] [β i, AddCommMonoid (Mβ i)] [AddCommMonoid Mβ] [β i, Module R (Mβ i)] [Module R Mβ]
[β i, TopologicalSpace (Mβ i)] [TopologicalSpace Mβ] extends MultilinearMap R Mβ Mβ where
cont : Continuous toFun
#align continuous_multilinear_map ContinuousMultilinearMap
attribute [inherit_doc ContinuousMultilinearMap] ContinuousMultilinearMap.cont
@[inherit_doc]
notation:25 M "[Γ" n "]βL[" R "] " M' => ContinuousMultilinearMap R (fun i : Fin n => M) M'
namespace ContinuousMultilinearMap
section Semiring
variable [Semiring R] [β i, AddCommMonoid (M i)] [β i, AddCommMonoid (Mβ i)]
[β i, AddCommMonoid (Mβ' i)] [AddCommMonoid Mβ] [AddCommMonoid Mβ] [AddCommMonoid Mβ]
[β i, Module R (M i)] [β i, Module R (Mβ i)] [β i, Module R (Mβ' i)] [Module R Mβ] [Module R Mβ]
[Module R Mβ] [β i, TopologicalSpace (M i)] [β i, TopologicalSpace (Mβ i)]
[β i, TopologicalSpace (Mβ' i)] [TopologicalSpace Mβ] [TopologicalSpace Mβ] [TopologicalSpace Mβ]
(f f' : ContinuousMultilinearMap R Mβ Mβ)
theorem toMultilinearMap_injective :
Function.Injective
(ContinuousMultilinearMap.toMultilinearMap :
ContinuousMultilinearMap R Mβ Mβ β MultilinearMap R Mβ Mβ)
| β¨f, hfβ©, β¨g, hgβ©, h => by subst h; rfl
#align continuous_multilinear_map.to_multilinear_map_injective ContinuousMultilinearMap.toMultilinearMap_injective
instance funLike : FunLike (ContinuousMultilinearMap R Mβ Mβ) (β i, Mβ i) Mβ where
coe f := f.toFun
coe_injective' _ _ h := toMultilinearMap_injective <| MultilinearMap.coe_injective h
instance continuousMapClass :
ContinuousMapClass (ContinuousMultilinearMap R Mβ Mβ) (β i, Mβ i) Mβ where
map_continuous := ContinuousMultilinearMap.cont
#align continuous_multilinear_map.continuous_map_class ContinuousMultilinearMap.continuousMapClass
instance : CoeFun (ContinuousMultilinearMap R Mβ Mβ) fun _ => (β i, Mβ i) β Mβ :=
β¨fun f => fβ©
def Simps.apply (Lβ : ContinuousMultilinearMap R Mβ Mβ) (v : β i, Mβ i) : Mβ :=
Lβ v
#align continuous_multilinear_map.simps.apply ContinuousMultilinearMap.Simps.apply
initialize_simps_projections ContinuousMultilinearMap (-toMultilinearMap,
toMultilinearMap_toFun β apply)
@[continuity]
theorem coe_continuous : Continuous (f : (β i, Mβ i) β Mβ) :=
f.cont
#align continuous_multilinear_map.coe_continuous ContinuousMultilinearMap.coe_continuous
@[simp]
theorem coe_coe : (f.toMultilinearMap : (β i, Mβ i) β Mβ) = f :=
rfl
#align continuous_multilinear_map.coe_coe ContinuousMultilinearMap.coe_coe
@[ext]
theorem ext {f f' : ContinuousMultilinearMap R Mβ Mβ} (H : β x, f x = f' x) : f = f' :=
DFunLike.ext _ _ H
#align continuous_multilinear_map.ext ContinuousMultilinearMap.ext
| Mathlib/Topology/Algebra/Module/Multilinear/Basic.lean | 113 | 114 | theorem ext_iff {f f' : ContinuousMultilinearMap R Mβ Mβ} : f = f' β β x, f x = f' x := by |
rw [β toMultilinearMap_injective.eq_iff, MultilinearMap.ext_iff]; rfl
| 1,237 |
import Mathlib.Data.Finset.Fin
import Mathlib.Data.Int.Order.Units
import Mathlib.GroupTheory.OrderOfElement
import Mathlib.GroupTheory.Perm.Support
import Mathlib.Logic.Equiv.Fintype
#align_import group_theory.perm.sign from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
universe u v
open Equiv Function Fintype Finset
variable {Ξ± : Type u} {Ξ² : Type v}
-- An example on how to determine the order of an element of a finite group.
example : orderOf (-1 : β€Λ£) = 2 :=
orderOf_eq_prime (Int.units_sq _) (by decide)
namespace Equiv.Perm
section Conjugation
variable [DecidableEq Ξ±] [Fintype Ξ±] {Ο Ο : Perm Ξ±}
| Mathlib/GroupTheory/Perm/Finite.lean | 37 | 50 | theorem isConj_of_support_equiv
(f : { x // x β (Ο.support : Set Ξ±) } β { x // x β (Ο.support : Set Ξ±) })
(hf : β (x : Ξ±) (hx : x β (Ο.support : Set Ξ±)),
(f β¨Ο x, apply_mem_support.2 hxβ© : Ξ±) = Ο β(f β¨x, hxβ©)) :
IsConj Ο Ο := by |
refine isConj_iff.2 β¨Equiv.extendSubtype f, ?_β©
rw [mul_inv_eq_iff_eq_mul]
ext x
simp only [Perm.mul_apply]
by_cases hx : x β Ο.support
Β· rw [Equiv.extendSubtype_apply_of_mem, Equiv.extendSubtype_apply_of_mem]
Β· exact hf x (Finset.mem_coe.2 hx)
Β· rwa [Classical.not_not.1 ((not_congr mem_support).1 (Equiv.extendSubtype_not_mem f _ _)),
Classical.not_not.1 ((not_congr mem_support).mp hx)]
| 1,238 |
import Mathlib.Data.Finset.Fin
import Mathlib.Data.Int.Order.Units
import Mathlib.GroupTheory.OrderOfElement
import Mathlib.GroupTheory.Perm.Support
import Mathlib.Logic.Equiv.Fintype
#align_import group_theory.perm.sign from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
universe u v
open Equiv Function Fintype Finset
variable {Ξ± : Type u} {Ξ² : Type v}
-- An example on how to determine the order of an element of a finite group.
example : orderOf (-1 : β€Λ£) = 2 :=
orderOf_eq_prime (Int.units_sq _) (by decide)
namespace Equiv.Perm
| Mathlib/GroupTheory/Perm/Finite.lean | 57 | 65 | theorem perm_inv_on_of_perm_on_finset {s : Finset Ξ±} {f : Perm Ξ±} (h : β x β s, f x β s) {y : Ξ±}
(hy : y β s) : fβ»ΒΉ y β s := by |
have h0 : β y β s, β (x : _) (hx : x β s), y = (fun i (_ : i β s) => f i) x hx :=
Finset.surj_on_of_inj_on_of_card_le (fun x hx => (fun i _ => f i) x hx) (fun a ha => h a ha)
(fun aβ aβ haβ haβ heq => (Equiv.apply_eq_iff_eq f).mp heq) rfl.ge
obtain β¨y2, hy2, heqβ© := h0 y hy
convert hy2
rw [heq]
simp only [inv_apply_self]
| 1,238 |
import Mathlib.Data.Finset.Fin
import Mathlib.Data.Int.Order.Units
import Mathlib.GroupTheory.OrderOfElement
import Mathlib.GroupTheory.Perm.Support
import Mathlib.Logic.Equiv.Fintype
#align_import group_theory.perm.sign from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
universe u v
open Equiv Function Fintype Finset
variable {Ξ± : Type u} {Ξ² : Type v}
-- An example on how to determine the order of an element of a finite group.
example : orderOf (-1 : β€Λ£) = 2 :=
orderOf_eq_prime (Int.units_sq _) (by decide)
namespace Equiv.Perm
theorem perm_inv_on_of_perm_on_finset {s : Finset Ξ±} {f : Perm Ξ±} (h : β x β s, f x β s) {y : Ξ±}
(hy : y β s) : fβ»ΒΉ y β s := by
have h0 : β y β s, β (x : _) (hx : x β s), y = (fun i (_ : i β s) => f i) x hx :=
Finset.surj_on_of_inj_on_of_card_le (fun x hx => (fun i _ => f i) x hx) (fun a ha => h a ha)
(fun aβ aβ haβ haβ heq => (Equiv.apply_eq_iff_eq f).mp heq) rfl.ge
obtain β¨y2, hy2, heqβ© := h0 y hy
convert hy2
rw [heq]
simp only [inv_apply_self]
#align equiv.perm.perm_inv_on_of_perm_on_finset Equiv.Perm.perm_inv_on_of_perm_on_finset
| Mathlib/GroupTheory/Perm/Finite.lean | 68 | 75 | theorem perm_inv_mapsTo_of_mapsTo (f : Perm Ξ±) {s : Set Ξ±} [Finite s] (h : Set.MapsTo f s s) :
Set.MapsTo (fβ»ΒΉ : _) s s := by |
cases nonempty_fintype s
exact fun x hx =>
Set.mem_toFinset.mp <|
perm_inv_on_of_perm_on_finset
(fun a ha => Set.mem_toFinset.mpr (h (Set.mem_toFinset.mp ha)))
(Set.mem_toFinset.mpr hx)
| 1,238 |
import Mathlib.Data.Finset.Fin
import Mathlib.Data.Int.Order.Units
import Mathlib.GroupTheory.OrderOfElement
import Mathlib.GroupTheory.Perm.Support
import Mathlib.Logic.Equiv.Fintype
#align_import group_theory.perm.sign from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
universe u v
open Equiv Function Fintype Finset
variable {Ξ± : Type u} {Ξ² : Type v}
-- An example on how to determine the order of an element of a finite group.
example : orderOf (-1 : β€Λ£) = 2 :=
orderOf_eq_prime (Int.units_sq _) (by decide)
namespace Equiv.Perm
theorem perm_inv_on_of_perm_on_finset {s : Finset Ξ±} {f : Perm Ξ±} (h : β x β s, f x β s) {y : Ξ±}
(hy : y β s) : fβ»ΒΉ y β s := by
have h0 : β y β s, β (x : _) (hx : x β s), y = (fun i (_ : i β s) => f i) x hx :=
Finset.surj_on_of_inj_on_of_card_le (fun x hx => (fun i _ => f i) x hx) (fun a ha => h a ha)
(fun aβ aβ haβ haβ heq => (Equiv.apply_eq_iff_eq f).mp heq) rfl.ge
obtain β¨y2, hy2, heqβ© := h0 y hy
convert hy2
rw [heq]
simp only [inv_apply_self]
#align equiv.perm.perm_inv_on_of_perm_on_finset Equiv.Perm.perm_inv_on_of_perm_on_finset
theorem perm_inv_mapsTo_of_mapsTo (f : Perm Ξ±) {s : Set Ξ±} [Finite s] (h : Set.MapsTo f s s) :
Set.MapsTo (fβ»ΒΉ : _) s s := by
cases nonempty_fintype s
exact fun x hx =>
Set.mem_toFinset.mp <|
perm_inv_on_of_perm_on_finset
(fun a ha => Set.mem_toFinset.mpr (h (Set.mem_toFinset.mp ha)))
(Set.mem_toFinset.mpr hx)
#align equiv.perm.perm_inv_maps_to_of_maps_to Equiv.Perm.perm_inv_mapsTo_of_mapsTo
@[simp]
theorem perm_inv_mapsTo_iff_mapsTo {f : Perm Ξ±} {s : Set Ξ±} [Finite s] :
Set.MapsTo (fβ»ΒΉ : _) s s β Set.MapsTo f s s :=
β¨perm_inv_mapsTo_of_mapsTo fβ»ΒΉ, perm_inv_mapsTo_of_mapsTo fβ©
#align equiv.perm.perm_inv_maps_to_iff_maps_to Equiv.Perm.perm_inv_mapsTo_iff_mapsTo
theorem perm_inv_on_of_perm_on_finite {f : Perm Ξ±} {p : Ξ± β Prop} [Finite { x // p x }]
(h : β x, p x β p (f x)) {x : Ξ±} (hx : p x) : p (fβ»ΒΉ x) :=
-- Porting note: relies heavily on the definitions of `Subtype` and `setOf` unfolding to their
-- underlying predicate.
have : Finite { x | p x } := βΉ_βΊ
perm_inv_mapsTo_of_mapsTo (s := {x | p x}) f h hx
#align equiv.perm.perm_inv_on_of_perm_on_finite Equiv.Perm.perm_inv_on_of_perm_on_finite
abbrev subtypePermOfFintype (f : Perm Ξ±) {p : Ξ± β Prop} [Finite { x // p x }]
(h : β x, p x β p (f x)) : Perm { x // p x } :=
f.subtypePerm fun x => β¨h x, fun hβ => f.inv_apply_self x βΈ perm_inv_on_of_perm_on_finite h hββ©
#align equiv.perm.subtype_perm_of_fintype Equiv.Perm.subtypePermOfFintype
@[simp]
theorem subtypePermOfFintype_apply (f : Perm Ξ±) {p : Ξ± β Prop} [Finite { x // p x }]
(h : β x, p x β p (f x)) (x : { x // p x }) : subtypePermOfFintype f h x = β¨f x, h x x.2β© :=
rfl
#align equiv.perm.subtype_perm_of_fintype_apply Equiv.Perm.subtypePermOfFintype_apply
theorem subtypePermOfFintype_one (p : Ξ± β Prop) [Finite { x // p x }]
(h : β x, p x β p ((1 : Perm Ξ±) x)) : @subtypePermOfFintype Ξ± 1 p _ h = 1 :=
rfl
#align equiv.perm.subtype_perm_of_fintype_one Equiv.Perm.subtypePermOfFintype_one
| Mathlib/GroupTheory/Perm/Finite.lean | 111 | 129 | theorem perm_mapsTo_inl_iff_mapsTo_inr {m n : Type*} [Finite m] [Finite n] (Ο : Perm (Sum m n)) :
Set.MapsTo Ο (Set.range Sum.inl) (Set.range Sum.inl) β
Set.MapsTo Ο (Set.range Sum.inr) (Set.range Sum.inr) := by |
constructor <;>
( intro h
classical
rw [β perm_inv_mapsTo_iff_mapsTo] at h
intro x
cases' hx : Ο x with l r)
Β· rintro β¨a, rflβ©
obtain β¨y, hyβ© := h β¨l, rflβ©
rw [β hx, Ο.inv_apply_self] at hy
exact absurd hy Sum.inl_ne_inr
Β· rintro _; exact β¨r, rflβ©
Β· rintro _; exact β¨l, rflβ©
Β· rintro β¨a, rflβ©
obtain β¨y, hyβ© := h β¨r, rflβ©
rw [β hx, Ο.inv_apply_self] at hy
exact absurd hy Sum.inr_ne_inl
| 1,238 |
import Mathlib.Data.Finset.Fin
import Mathlib.Data.Int.Order.Units
import Mathlib.GroupTheory.OrderOfElement
import Mathlib.GroupTheory.Perm.Support
import Mathlib.Logic.Equiv.Fintype
#align_import group_theory.perm.sign from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e"
universe u v
open Equiv Function Fintype Finset
variable {Ξ± : Type u} {Ξ² : Type v}
-- An example on how to determine the order of an element of a finite group.
example : orderOf (-1 : β€Λ£) = 2 :=
orderOf_eq_prime (Int.units_sq _) (by decide)
namespace Equiv.Perm
theorem perm_inv_on_of_perm_on_finset {s : Finset Ξ±} {f : Perm Ξ±} (h : β x β s, f x β s) {y : Ξ±}
(hy : y β s) : fβ»ΒΉ y β s := by
have h0 : β y β s, β (x : _) (hx : x β s), y = (fun i (_ : i β s) => f i) x hx :=
Finset.surj_on_of_inj_on_of_card_le (fun x hx => (fun i _ => f i) x hx) (fun a ha => h a ha)
(fun aβ aβ haβ haβ heq => (Equiv.apply_eq_iff_eq f).mp heq) rfl.ge
obtain β¨y2, hy2, heqβ© := h0 y hy
convert hy2
rw [heq]
simp only [inv_apply_self]
#align equiv.perm.perm_inv_on_of_perm_on_finset Equiv.Perm.perm_inv_on_of_perm_on_finset
theorem perm_inv_mapsTo_of_mapsTo (f : Perm Ξ±) {s : Set Ξ±} [Finite s] (h : Set.MapsTo f s s) :
Set.MapsTo (fβ»ΒΉ : _) s s := by
cases nonempty_fintype s
exact fun x hx =>
Set.mem_toFinset.mp <|
perm_inv_on_of_perm_on_finset
(fun a ha => Set.mem_toFinset.mpr (h (Set.mem_toFinset.mp ha)))
(Set.mem_toFinset.mpr hx)
#align equiv.perm.perm_inv_maps_to_of_maps_to Equiv.Perm.perm_inv_mapsTo_of_mapsTo
@[simp]
theorem perm_inv_mapsTo_iff_mapsTo {f : Perm Ξ±} {s : Set Ξ±} [Finite s] :
Set.MapsTo (fβ»ΒΉ : _) s s β Set.MapsTo f s s :=
β¨perm_inv_mapsTo_of_mapsTo fβ»ΒΉ, perm_inv_mapsTo_of_mapsTo fβ©
#align equiv.perm.perm_inv_maps_to_iff_maps_to Equiv.Perm.perm_inv_mapsTo_iff_mapsTo
theorem perm_inv_on_of_perm_on_finite {f : Perm Ξ±} {p : Ξ± β Prop} [Finite { x // p x }]
(h : β x, p x β p (f x)) {x : Ξ±} (hx : p x) : p (fβ»ΒΉ x) :=
-- Porting note: relies heavily on the definitions of `Subtype` and `setOf` unfolding to their
-- underlying predicate.
have : Finite { x | p x } := βΉ_βΊ
perm_inv_mapsTo_of_mapsTo (s := {x | p x}) f h hx
#align equiv.perm.perm_inv_on_of_perm_on_finite Equiv.Perm.perm_inv_on_of_perm_on_finite
abbrev subtypePermOfFintype (f : Perm Ξ±) {p : Ξ± β Prop} [Finite { x // p x }]
(h : β x, p x β p (f x)) : Perm { x // p x } :=
f.subtypePerm fun x => β¨h x, fun hβ => f.inv_apply_self x βΈ perm_inv_on_of_perm_on_finite h hββ©
#align equiv.perm.subtype_perm_of_fintype Equiv.Perm.subtypePermOfFintype
@[simp]
theorem subtypePermOfFintype_apply (f : Perm Ξ±) {p : Ξ± β Prop} [Finite { x // p x }]
(h : β x, p x β p (f x)) (x : { x // p x }) : subtypePermOfFintype f h x = β¨f x, h x x.2β© :=
rfl
#align equiv.perm.subtype_perm_of_fintype_apply Equiv.Perm.subtypePermOfFintype_apply
theorem subtypePermOfFintype_one (p : Ξ± β Prop) [Finite { x // p x }]
(h : β x, p x β p ((1 : Perm Ξ±) x)) : @subtypePermOfFintype Ξ± 1 p _ h = 1 :=
rfl
#align equiv.perm.subtype_perm_of_fintype_one Equiv.Perm.subtypePermOfFintype_one
theorem perm_mapsTo_inl_iff_mapsTo_inr {m n : Type*} [Finite m] [Finite n] (Ο : Perm (Sum m n)) :
Set.MapsTo Ο (Set.range Sum.inl) (Set.range Sum.inl) β
Set.MapsTo Ο (Set.range Sum.inr) (Set.range Sum.inr) := by
constructor <;>
( intro h
classical
rw [β perm_inv_mapsTo_iff_mapsTo] at h
intro x
cases' hx : Ο x with l r)
Β· rintro β¨a, rflβ©
obtain β¨y, hyβ© := h β¨l, rflβ©
rw [β hx, Ο.inv_apply_self] at hy
exact absurd hy Sum.inl_ne_inr
Β· rintro _; exact β¨r, rflβ©
Β· rintro _; exact β¨l, rflβ©
Β· rintro β¨a, rflβ©
obtain β¨y, hyβ© := h β¨r, rflβ©
rw [β hx, Ο.inv_apply_self] at hy
exact absurd hy Sum.inr_ne_inl
#align equiv.perm.perm_maps_to_inl_iff_maps_to_inr Equiv.Perm.perm_mapsTo_inl_iff_mapsTo_inr
| Mathlib/GroupTheory/Perm/Finite.lean | 132 | 163 | theorem mem_sumCongrHom_range_of_perm_mapsTo_inl {m n : Type*} [Finite m] [Finite n]
{Ο : Perm (Sum m n)} (h : Set.MapsTo Ο (Set.range Sum.inl) (Set.range Sum.inl)) :
Ο β (sumCongrHom m n).range := by |
classical
have h1 : β x : Sum m n, (β a : m, Sum.inl a = x) β β a : m, Sum.inl a = Ο x := by
rintro x β¨a, haβ©
apply h
rw [β ha]
exact β¨a, rflβ©
have h3 : β x : Sum m n, (β b : n, Sum.inr b = x) β β b : n, Sum.inr b = Ο x := by
rintro x β¨b, hbβ©
apply (perm_mapsTo_inl_iff_mapsTo_inr Ο).mp h
rw [β hb]
exact β¨b, rflβ©
let Οβ' := subtypePermOfFintype Ο h1
let Οβ' := subtypePermOfFintype Ο h3
let Οβ := permCongr (Equiv.ofInjective _ Sum.inl_injective).symm Οβ'
let Οβ := permCongr (Equiv.ofInjective _ Sum.inr_injective).symm Οβ'
rw [MonoidHom.mem_range, Prod.exists]
use Οβ, Οβ
rw [Perm.sumCongrHom_apply]
ext x
cases' x with a b
Β· rw [Equiv.sumCongr_apply, Sum.map_inl, permCongr_apply, Equiv.symm_symm,
apply_ofInjective_symm Sum.inl_injective]
rw [ofInjective_apply, Subtype.coe_mk, Subtype.coe_mk]
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
erw [subtypePerm_apply]
Β· rw [Equiv.sumCongr_apply, Sum.map_inr, permCongr_apply, Equiv.symm_symm,
apply_ofInjective_symm Sum.inr_injective]
erw [subtypePerm_apply]
rw [ofInjective_apply, Subtype.coe_mk, Subtype.coe_mk]
| 1,238 |
import Mathlib.Algebra.Module.BigOperators
import Mathlib.Data.Fintype.Perm
import Mathlib.GroupTheory.Perm.Finite
import Mathlib.GroupTheory.Perm.List
#align_import group_theory.perm.cycle.basic from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
open Equiv Function Finset
variable {ΞΉ Ξ± Ξ² : Type*}
namespace Equiv.Perm
section SameCycle
variable {f g : Perm Ξ±} {p : Ξ± β Prop} {x y z : Ξ±}
def SameCycle (f : Perm Ξ±) (x y : Ξ±) : Prop :=
β i : β€, (f ^ i) x = y
#align equiv.perm.same_cycle Equiv.Perm.SameCycle
@[refl]
theorem SameCycle.refl (f : Perm Ξ±) (x : Ξ±) : SameCycle f x x :=
β¨0, rflβ©
#align equiv.perm.same_cycle.refl Equiv.Perm.SameCycle.refl
theorem SameCycle.rfl : SameCycle f x x :=
SameCycle.refl _ _
#align equiv.perm.same_cycle.rfl Equiv.Perm.SameCycle.rfl
protected theorem _root_.Eq.sameCycle (h : x = y) (f : Perm Ξ±) : f.SameCycle x y := by rw [h]
#align eq.same_cycle Eq.sameCycle
@[symm]
theorem SameCycle.symm : SameCycle f x y β SameCycle f y x := fun β¨i, hiβ© =>
β¨-i, by rw [zpow_neg, β hi, inv_apply_self]β©
#align equiv.perm.same_cycle.symm Equiv.Perm.SameCycle.symm
theorem sameCycle_comm : SameCycle f x y β SameCycle f y x :=
β¨SameCycle.symm, SameCycle.symmβ©
#align equiv.perm.same_cycle_comm Equiv.Perm.sameCycle_comm
@[trans]
theorem SameCycle.trans : SameCycle f x y β SameCycle f y z β SameCycle f x z :=
fun β¨i, hiβ© β¨j, hjβ© => β¨j + i, by rw [zpow_add, mul_apply, hi, hj]β©
#align equiv.perm.same_cycle.trans Equiv.Perm.SameCycle.trans
variable (f) in
theorem SameCycle.equivalence : Equivalence (SameCycle f) :=
β¨SameCycle.refl f, SameCycle.symm, SameCycle.transβ©
def SameCycle.setoid (f : Perm Ξ±) : Setoid Ξ± where
iseqv := SameCycle.equivalence f
@[simp]
| Mathlib/GroupTheory/Perm/Cycle/Basic.lean | 90 | 90 | theorem sameCycle_one : SameCycle 1 x y β x = y := by | simp [SameCycle]
| 1,239 |
import Mathlib.Algebra.Module.BigOperators
import Mathlib.Data.Fintype.Perm
import Mathlib.GroupTheory.Perm.Finite
import Mathlib.GroupTheory.Perm.List
#align_import group_theory.perm.cycle.basic from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
open Equiv Function Finset
variable {ΞΉ Ξ± Ξ² : Type*}
namespace Equiv.Perm
section SameCycle
variable {f g : Perm Ξ±} {p : Ξ± β Prop} {x y z : Ξ±}
def SameCycle (f : Perm Ξ±) (x y : Ξ±) : Prop :=
β i : β€, (f ^ i) x = y
#align equiv.perm.same_cycle Equiv.Perm.SameCycle
@[refl]
theorem SameCycle.refl (f : Perm Ξ±) (x : Ξ±) : SameCycle f x x :=
β¨0, rflβ©
#align equiv.perm.same_cycle.refl Equiv.Perm.SameCycle.refl
theorem SameCycle.rfl : SameCycle f x x :=
SameCycle.refl _ _
#align equiv.perm.same_cycle.rfl Equiv.Perm.SameCycle.rfl
protected theorem _root_.Eq.sameCycle (h : x = y) (f : Perm Ξ±) : f.SameCycle x y := by rw [h]
#align eq.same_cycle Eq.sameCycle
@[symm]
theorem SameCycle.symm : SameCycle f x y β SameCycle f y x := fun β¨i, hiβ© =>
β¨-i, by rw [zpow_neg, β hi, inv_apply_self]β©
#align equiv.perm.same_cycle.symm Equiv.Perm.SameCycle.symm
theorem sameCycle_comm : SameCycle f x y β SameCycle f y x :=
β¨SameCycle.symm, SameCycle.symmβ©
#align equiv.perm.same_cycle_comm Equiv.Perm.sameCycle_comm
@[trans]
theorem SameCycle.trans : SameCycle f x y β SameCycle f y z β SameCycle f x z :=
fun β¨i, hiβ© β¨j, hjβ© => β¨j + i, by rw [zpow_add, mul_apply, hi, hj]β©
#align equiv.perm.same_cycle.trans Equiv.Perm.SameCycle.trans
variable (f) in
theorem SameCycle.equivalence : Equivalence (SameCycle f) :=
β¨SameCycle.refl f, SameCycle.symm, SameCycle.transβ©
def SameCycle.setoid (f : Perm Ξ±) : Setoid Ξ± where
iseqv := SameCycle.equivalence f
@[simp]
theorem sameCycle_one : SameCycle 1 x y β x = y := by simp [SameCycle]
#align equiv.perm.same_cycle_one Equiv.Perm.sameCycle_one
@[simp]
theorem sameCycle_inv : SameCycle fβ»ΒΉ x y β SameCycle f x y :=
(Equiv.neg _).exists_congr_left.trans <| by simp [SameCycle]
#align equiv.perm.same_cycle_inv Equiv.Perm.sameCycle_inv
alias β¨SameCycle.of_inv, SameCycle.invβ© := sameCycle_inv
#align equiv.perm.same_cycle.of_inv Equiv.Perm.SameCycle.of_inv
#align equiv.perm.same_cycle.inv Equiv.Perm.SameCycle.inv
@[simp]
theorem sameCycle_conj : SameCycle (g * f * gβ»ΒΉ) x y β SameCycle f (gβ»ΒΉ x) (gβ»ΒΉ y) :=
exists_congr fun i => by simp [conj_zpow, eq_inv_iff_eq]
#align equiv.perm.same_cycle_conj Equiv.Perm.sameCycle_conj
| Mathlib/GroupTheory/Perm/Cycle/Basic.lean | 107 | 108 | theorem SameCycle.conj : SameCycle f x y β SameCycle (g * f * gβ»ΒΉ) (g x) (g y) := by |
simp [sameCycle_conj]
| 1,239 |
import Mathlib.Algebra.Module.BigOperators
import Mathlib.Data.Fintype.Perm
import Mathlib.GroupTheory.Perm.Finite
import Mathlib.GroupTheory.Perm.List
#align_import group_theory.perm.cycle.basic from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
open Equiv Function Finset
variable {ΞΉ Ξ± Ξ² : Type*}
namespace Equiv.Perm
section SameCycle
variable {f g : Perm Ξ±} {p : Ξ± β Prop} {x y z : Ξ±}
def SameCycle (f : Perm Ξ±) (x y : Ξ±) : Prop :=
β i : β€, (f ^ i) x = y
#align equiv.perm.same_cycle Equiv.Perm.SameCycle
@[refl]
theorem SameCycle.refl (f : Perm Ξ±) (x : Ξ±) : SameCycle f x x :=
β¨0, rflβ©
#align equiv.perm.same_cycle.refl Equiv.Perm.SameCycle.refl
theorem SameCycle.rfl : SameCycle f x x :=
SameCycle.refl _ _
#align equiv.perm.same_cycle.rfl Equiv.Perm.SameCycle.rfl
protected theorem _root_.Eq.sameCycle (h : x = y) (f : Perm Ξ±) : f.SameCycle x y := by rw [h]
#align eq.same_cycle Eq.sameCycle
@[symm]
theorem SameCycle.symm : SameCycle f x y β SameCycle f y x := fun β¨i, hiβ© =>
β¨-i, by rw [zpow_neg, β hi, inv_apply_self]β©
#align equiv.perm.same_cycle.symm Equiv.Perm.SameCycle.symm
theorem sameCycle_comm : SameCycle f x y β SameCycle f y x :=
β¨SameCycle.symm, SameCycle.symmβ©
#align equiv.perm.same_cycle_comm Equiv.Perm.sameCycle_comm
@[trans]
theorem SameCycle.trans : SameCycle f x y β SameCycle f y z β SameCycle f x z :=
fun β¨i, hiβ© β¨j, hjβ© => β¨j + i, by rw [zpow_add, mul_apply, hi, hj]β©
#align equiv.perm.same_cycle.trans Equiv.Perm.SameCycle.trans
variable (f) in
theorem SameCycle.equivalence : Equivalence (SameCycle f) :=
β¨SameCycle.refl f, SameCycle.symm, SameCycle.transβ©
def SameCycle.setoid (f : Perm Ξ±) : Setoid Ξ± where
iseqv := SameCycle.equivalence f
@[simp]
theorem sameCycle_one : SameCycle 1 x y β x = y := by simp [SameCycle]
#align equiv.perm.same_cycle_one Equiv.Perm.sameCycle_one
@[simp]
theorem sameCycle_inv : SameCycle fβ»ΒΉ x y β SameCycle f x y :=
(Equiv.neg _).exists_congr_left.trans <| by simp [SameCycle]
#align equiv.perm.same_cycle_inv Equiv.Perm.sameCycle_inv
alias β¨SameCycle.of_inv, SameCycle.invβ© := sameCycle_inv
#align equiv.perm.same_cycle.of_inv Equiv.Perm.SameCycle.of_inv
#align equiv.perm.same_cycle.inv Equiv.Perm.SameCycle.inv
@[simp]
theorem sameCycle_conj : SameCycle (g * f * gβ»ΒΉ) x y β SameCycle f (gβ»ΒΉ x) (gβ»ΒΉ y) :=
exists_congr fun i => by simp [conj_zpow, eq_inv_iff_eq]
#align equiv.perm.same_cycle_conj Equiv.Perm.sameCycle_conj
theorem SameCycle.conj : SameCycle f x y β SameCycle (g * f * gβ»ΒΉ) (g x) (g y) := by
simp [sameCycle_conj]
#align equiv.perm.same_cycle.conj Equiv.Perm.SameCycle.conj
theorem SameCycle.apply_eq_self_iff : SameCycle f x y β (f x = x β f y = y) := fun β¨i, hiβ© => by
rw [β hi, β mul_apply, β zpow_one_add, add_comm, zpow_add_one, mul_apply,
(f ^ i).injective.eq_iff]
#align equiv.perm.same_cycle.apply_eq_self_iff Equiv.Perm.SameCycle.apply_eq_self_iff
theorem SameCycle.eq_of_left (h : SameCycle f x y) (hx : IsFixedPt f x) : x = y :=
let β¨_, hnβ© := h
(hx.perm_zpow _).eq.symm.trans hn
#align equiv.perm.same_cycle.eq_of_left Equiv.Perm.SameCycle.eq_of_left
theorem SameCycle.eq_of_right (h : SameCycle f x y) (hy : IsFixedPt f y) : x = y :=
h.eq_of_left <| h.apply_eq_self_iff.2 hy
#align equiv.perm.same_cycle.eq_of_right Equiv.Perm.SameCycle.eq_of_right
@[simp]
theorem sameCycle_apply_left : SameCycle f (f x) y β SameCycle f x y :=
(Equiv.addRight 1).exists_congr_left.trans <| by
simp [zpow_sub, SameCycle, Int.add_neg_one, Function.comp]
#align equiv.perm.same_cycle_apply_left Equiv.Perm.sameCycle_apply_left
@[simp]
| Mathlib/GroupTheory/Perm/Cycle/Basic.lean | 132 | 133 | theorem sameCycle_apply_right : SameCycle f x (f y) β SameCycle f x y := by |
rw [sameCycle_comm, sameCycle_apply_left, sameCycle_comm]
| 1,239 |
import Mathlib.Algebra.Module.BigOperators
import Mathlib.Data.Fintype.Perm
import Mathlib.GroupTheory.Perm.Finite
import Mathlib.GroupTheory.Perm.List
#align_import group_theory.perm.cycle.basic from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
open Equiv Function Finset
variable {ΞΉ Ξ± Ξ² : Type*}
namespace Equiv.Perm
section SameCycle
variable {f g : Perm Ξ±} {p : Ξ± β Prop} {x y z : Ξ±}
def SameCycle (f : Perm Ξ±) (x y : Ξ±) : Prop :=
β i : β€, (f ^ i) x = y
#align equiv.perm.same_cycle Equiv.Perm.SameCycle
@[refl]
theorem SameCycle.refl (f : Perm Ξ±) (x : Ξ±) : SameCycle f x x :=
β¨0, rflβ©
#align equiv.perm.same_cycle.refl Equiv.Perm.SameCycle.refl
theorem SameCycle.rfl : SameCycle f x x :=
SameCycle.refl _ _
#align equiv.perm.same_cycle.rfl Equiv.Perm.SameCycle.rfl
protected theorem _root_.Eq.sameCycle (h : x = y) (f : Perm Ξ±) : f.SameCycle x y := by rw [h]
#align eq.same_cycle Eq.sameCycle
@[symm]
theorem SameCycle.symm : SameCycle f x y β SameCycle f y x := fun β¨i, hiβ© =>
β¨-i, by rw [zpow_neg, β hi, inv_apply_self]β©
#align equiv.perm.same_cycle.symm Equiv.Perm.SameCycle.symm
theorem sameCycle_comm : SameCycle f x y β SameCycle f y x :=
β¨SameCycle.symm, SameCycle.symmβ©
#align equiv.perm.same_cycle_comm Equiv.Perm.sameCycle_comm
@[trans]
theorem SameCycle.trans : SameCycle f x y β SameCycle f y z β SameCycle f x z :=
fun β¨i, hiβ© β¨j, hjβ© => β¨j + i, by rw [zpow_add, mul_apply, hi, hj]β©
#align equiv.perm.same_cycle.trans Equiv.Perm.SameCycle.trans
variable (f) in
theorem SameCycle.equivalence : Equivalence (SameCycle f) :=
β¨SameCycle.refl f, SameCycle.symm, SameCycle.transβ©
def SameCycle.setoid (f : Perm Ξ±) : Setoid Ξ± where
iseqv := SameCycle.equivalence f
@[simp]
theorem sameCycle_one : SameCycle 1 x y β x = y := by simp [SameCycle]
#align equiv.perm.same_cycle_one Equiv.Perm.sameCycle_one
@[simp]
theorem sameCycle_inv : SameCycle fβ»ΒΉ x y β SameCycle f x y :=
(Equiv.neg _).exists_congr_left.trans <| by simp [SameCycle]
#align equiv.perm.same_cycle_inv Equiv.Perm.sameCycle_inv
alias β¨SameCycle.of_inv, SameCycle.invβ© := sameCycle_inv
#align equiv.perm.same_cycle.of_inv Equiv.Perm.SameCycle.of_inv
#align equiv.perm.same_cycle.inv Equiv.Perm.SameCycle.inv
@[simp]
theorem sameCycle_conj : SameCycle (g * f * gβ»ΒΉ) x y β SameCycle f (gβ»ΒΉ x) (gβ»ΒΉ y) :=
exists_congr fun i => by simp [conj_zpow, eq_inv_iff_eq]
#align equiv.perm.same_cycle_conj Equiv.Perm.sameCycle_conj
theorem SameCycle.conj : SameCycle f x y β SameCycle (g * f * gβ»ΒΉ) (g x) (g y) := by
simp [sameCycle_conj]
#align equiv.perm.same_cycle.conj Equiv.Perm.SameCycle.conj
theorem SameCycle.apply_eq_self_iff : SameCycle f x y β (f x = x β f y = y) := fun β¨i, hiβ© => by
rw [β hi, β mul_apply, β zpow_one_add, add_comm, zpow_add_one, mul_apply,
(f ^ i).injective.eq_iff]
#align equiv.perm.same_cycle.apply_eq_self_iff Equiv.Perm.SameCycle.apply_eq_self_iff
theorem SameCycle.eq_of_left (h : SameCycle f x y) (hx : IsFixedPt f x) : x = y :=
let β¨_, hnβ© := h
(hx.perm_zpow _).eq.symm.trans hn
#align equiv.perm.same_cycle.eq_of_left Equiv.Perm.SameCycle.eq_of_left
theorem SameCycle.eq_of_right (h : SameCycle f x y) (hy : IsFixedPt f y) : x = y :=
h.eq_of_left <| h.apply_eq_self_iff.2 hy
#align equiv.perm.same_cycle.eq_of_right Equiv.Perm.SameCycle.eq_of_right
@[simp]
theorem sameCycle_apply_left : SameCycle f (f x) y β SameCycle f x y :=
(Equiv.addRight 1).exists_congr_left.trans <| by
simp [zpow_sub, SameCycle, Int.add_neg_one, Function.comp]
#align equiv.perm.same_cycle_apply_left Equiv.Perm.sameCycle_apply_left
@[simp]
theorem sameCycle_apply_right : SameCycle f x (f y) β SameCycle f x y := by
rw [sameCycle_comm, sameCycle_apply_left, sameCycle_comm]
#align equiv.perm.same_cycle_apply_right Equiv.Perm.sameCycle_apply_right
@[simp]
| Mathlib/GroupTheory/Perm/Cycle/Basic.lean | 137 | 138 | theorem sameCycle_inv_apply_left : SameCycle f (fβ»ΒΉ x) y β SameCycle f x y := by |
rw [β sameCycle_apply_left, apply_inv_self]
| 1,239 |
import Mathlib.Algebra.Module.BigOperators
import Mathlib.Data.Fintype.Perm
import Mathlib.GroupTheory.Perm.Finite
import Mathlib.GroupTheory.Perm.List
#align_import group_theory.perm.cycle.basic from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
open Equiv Function Finset
variable {ΞΉ Ξ± Ξ² : Type*}
namespace Equiv.Perm
section SameCycle
variable {f g : Perm Ξ±} {p : Ξ± β Prop} {x y z : Ξ±}
def SameCycle (f : Perm Ξ±) (x y : Ξ±) : Prop :=
β i : β€, (f ^ i) x = y
#align equiv.perm.same_cycle Equiv.Perm.SameCycle
@[refl]
theorem SameCycle.refl (f : Perm Ξ±) (x : Ξ±) : SameCycle f x x :=
β¨0, rflβ©
#align equiv.perm.same_cycle.refl Equiv.Perm.SameCycle.refl
theorem SameCycle.rfl : SameCycle f x x :=
SameCycle.refl _ _
#align equiv.perm.same_cycle.rfl Equiv.Perm.SameCycle.rfl
protected theorem _root_.Eq.sameCycle (h : x = y) (f : Perm Ξ±) : f.SameCycle x y := by rw [h]
#align eq.same_cycle Eq.sameCycle
@[symm]
theorem SameCycle.symm : SameCycle f x y β SameCycle f y x := fun β¨i, hiβ© =>
β¨-i, by rw [zpow_neg, β hi, inv_apply_self]β©
#align equiv.perm.same_cycle.symm Equiv.Perm.SameCycle.symm
theorem sameCycle_comm : SameCycle f x y β SameCycle f y x :=
β¨SameCycle.symm, SameCycle.symmβ©
#align equiv.perm.same_cycle_comm Equiv.Perm.sameCycle_comm
@[trans]
theorem SameCycle.trans : SameCycle f x y β SameCycle f y z β SameCycle f x z :=
fun β¨i, hiβ© β¨j, hjβ© => β¨j + i, by rw [zpow_add, mul_apply, hi, hj]β©
#align equiv.perm.same_cycle.trans Equiv.Perm.SameCycle.trans
variable (f) in
theorem SameCycle.equivalence : Equivalence (SameCycle f) :=
β¨SameCycle.refl f, SameCycle.symm, SameCycle.transβ©
def SameCycle.setoid (f : Perm Ξ±) : Setoid Ξ± where
iseqv := SameCycle.equivalence f
@[simp]
theorem sameCycle_one : SameCycle 1 x y β x = y := by simp [SameCycle]
#align equiv.perm.same_cycle_one Equiv.Perm.sameCycle_one
@[simp]
theorem sameCycle_inv : SameCycle fβ»ΒΉ x y β SameCycle f x y :=
(Equiv.neg _).exists_congr_left.trans <| by simp [SameCycle]
#align equiv.perm.same_cycle_inv Equiv.Perm.sameCycle_inv
alias β¨SameCycle.of_inv, SameCycle.invβ© := sameCycle_inv
#align equiv.perm.same_cycle.of_inv Equiv.Perm.SameCycle.of_inv
#align equiv.perm.same_cycle.inv Equiv.Perm.SameCycle.inv
@[simp]
theorem sameCycle_conj : SameCycle (g * f * gβ»ΒΉ) x y β SameCycle f (gβ»ΒΉ x) (gβ»ΒΉ y) :=
exists_congr fun i => by simp [conj_zpow, eq_inv_iff_eq]
#align equiv.perm.same_cycle_conj Equiv.Perm.sameCycle_conj
theorem SameCycle.conj : SameCycle f x y β SameCycle (g * f * gβ»ΒΉ) (g x) (g y) := by
simp [sameCycle_conj]
#align equiv.perm.same_cycle.conj Equiv.Perm.SameCycle.conj
theorem SameCycle.apply_eq_self_iff : SameCycle f x y β (f x = x β f y = y) := fun β¨i, hiβ© => by
rw [β hi, β mul_apply, β zpow_one_add, add_comm, zpow_add_one, mul_apply,
(f ^ i).injective.eq_iff]
#align equiv.perm.same_cycle.apply_eq_self_iff Equiv.Perm.SameCycle.apply_eq_self_iff
theorem SameCycle.eq_of_left (h : SameCycle f x y) (hx : IsFixedPt f x) : x = y :=
let β¨_, hnβ© := h
(hx.perm_zpow _).eq.symm.trans hn
#align equiv.perm.same_cycle.eq_of_left Equiv.Perm.SameCycle.eq_of_left
theorem SameCycle.eq_of_right (h : SameCycle f x y) (hy : IsFixedPt f y) : x = y :=
h.eq_of_left <| h.apply_eq_self_iff.2 hy
#align equiv.perm.same_cycle.eq_of_right Equiv.Perm.SameCycle.eq_of_right
@[simp]
theorem sameCycle_apply_left : SameCycle f (f x) y β SameCycle f x y :=
(Equiv.addRight 1).exists_congr_left.trans <| by
simp [zpow_sub, SameCycle, Int.add_neg_one, Function.comp]
#align equiv.perm.same_cycle_apply_left Equiv.Perm.sameCycle_apply_left
@[simp]
theorem sameCycle_apply_right : SameCycle f x (f y) β SameCycle f x y := by
rw [sameCycle_comm, sameCycle_apply_left, sameCycle_comm]
#align equiv.perm.same_cycle_apply_right Equiv.Perm.sameCycle_apply_right
@[simp]
theorem sameCycle_inv_apply_left : SameCycle f (fβ»ΒΉ x) y β SameCycle f x y := by
rw [β sameCycle_apply_left, apply_inv_self]
#align equiv.perm.same_cycle_inv_apply_left Equiv.Perm.sameCycle_inv_apply_left
@[simp]
| Mathlib/GroupTheory/Perm/Cycle/Basic.lean | 142 | 143 | theorem sameCycle_inv_apply_right : SameCycle f x (fβ»ΒΉ y) β SameCycle f x y := by |
rw [β sameCycle_apply_right, apply_inv_self]
| 1,239 |
import Mathlib.Algebra.Module.BigOperators
import Mathlib.Data.Fintype.Perm
import Mathlib.GroupTheory.Perm.Finite
import Mathlib.GroupTheory.Perm.List
#align_import group_theory.perm.cycle.basic from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
open Equiv Function Finset
variable {ΞΉ Ξ± Ξ² : Type*}
namespace Equiv.Perm
section SameCycle
variable {f g : Perm Ξ±} {p : Ξ± β Prop} {x y z : Ξ±}
def SameCycle (f : Perm Ξ±) (x y : Ξ±) : Prop :=
β i : β€, (f ^ i) x = y
#align equiv.perm.same_cycle Equiv.Perm.SameCycle
@[refl]
theorem SameCycle.refl (f : Perm Ξ±) (x : Ξ±) : SameCycle f x x :=
β¨0, rflβ©
#align equiv.perm.same_cycle.refl Equiv.Perm.SameCycle.refl
theorem SameCycle.rfl : SameCycle f x x :=
SameCycle.refl _ _
#align equiv.perm.same_cycle.rfl Equiv.Perm.SameCycle.rfl
protected theorem _root_.Eq.sameCycle (h : x = y) (f : Perm Ξ±) : f.SameCycle x y := by rw [h]
#align eq.same_cycle Eq.sameCycle
@[symm]
theorem SameCycle.symm : SameCycle f x y β SameCycle f y x := fun β¨i, hiβ© =>
β¨-i, by rw [zpow_neg, β hi, inv_apply_self]β©
#align equiv.perm.same_cycle.symm Equiv.Perm.SameCycle.symm
theorem sameCycle_comm : SameCycle f x y β SameCycle f y x :=
β¨SameCycle.symm, SameCycle.symmβ©
#align equiv.perm.same_cycle_comm Equiv.Perm.sameCycle_comm
@[trans]
theorem SameCycle.trans : SameCycle f x y β SameCycle f y z β SameCycle f x z :=
fun β¨i, hiβ© β¨j, hjβ© => β¨j + i, by rw [zpow_add, mul_apply, hi, hj]β©
#align equiv.perm.same_cycle.trans Equiv.Perm.SameCycle.trans
variable (f) in
theorem SameCycle.equivalence : Equivalence (SameCycle f) :=
β¨SameCycle.refl f, SameCycle.symm, SameCycle.transβ©
def SameCycle.setoid (f : Perm Ξ±) : Setoid Ξ± where
iseqv := SameCycle.equivalence f
@[simp]
theorem sameCycle_one : SameCycle 1 x y β x = y := by simp [SameCycle]
#align equiv.perm.same_cycle_one Equiv.Perm.sameCycle_one
@[simp]
theorem sameCycle_inv : SameCycle fβ»ΒΉ x y β SameCycle f x y :=
(Equiv.neg _).exists_congr_left.trans <| by simp [SameCycle]
#align equiv.perm.same_cycle_inv Equiv.Perm.sameCycle_inv
alias β¨SameCycle.of_inv, SameCycle.invβ© := sameCycle_inv
#align equiv.perm.same_cycle.of_inv Equiv.Perm.SameCycle.of_inv
#align equiv.perm.same_cycle.inv Equiv.Perm.SameCycle.inv
@[simp]
theorem sameCycle_conj : SameCycle (g * f * gβ»ΒΉ) x y β SameCycle f (gβ»ΒΉ x) (gβ»ΒΉ y) :=
exists_congr fun i => by simp [conj_zpow, eq_inv_iff_eq]
#align equiv.perm.same_cycle_conj Equiv.Perm.sameCycle_conj
theorem SameCycle.conj : SameCycle f x y β SameCycle (g * f * gβ»ΒΉ) (g x) (g y) := by
simp [sameCycle_conj]
#align equiv.perm.same_cycle.conj Equiv.Perm.SameCycle.conj
theorem SameCycle.apply_eq_self_iff : SameCycle f x y β (f x = x β f y = y) := fun β¨i, hiβ© => by
rw [β hi, β mul_apply, β zpow_one_add, add_comm, zpow_add_one, mul_apply,
(f ^ i).injective.eq_iff]
#align equiv.perm.same_cycle.apply_eq_self_iff Equiv.Perm.SameCycle.apply_eq_self_iff
theorem SameCycle.eq_of_left (h : SameCycle f x y) (hx : IsFixedPt f x) : x = y :=
let β¨_, hnβ© := h
(hx.perm_zpow _).eq.symm.trans hn
#align equiv.perm.same_cycle.eq_of_left Equiv.Perm.SameCycle.eq_of_left
theorem SameCycle.eq_of_right (h : SameCycle f x y) (hy : IsFixedPt f y) : x = y :=
h.eq_of_left <| h.apply_eq_self_iff.2 hy
#align equiv.perm.same_cycle.eq_of_right Equiv.Perm.SameCycle.eq_of_right
@[simp]
theorem sameCycle_apply_left : SameCycle f (f x) y β SameCycle f x y :=
(Equiv.addRight 1).exists_congr_left.trans <| by
simp [zpow_sub, SameCycle, Int.add_neg_one, Function.comp]
#align equiv.perm.same_cycle_apply_left Equiv.Perm.sameCycle_apply_left
@[simp]
theorem sameCycle_apply_right : SameCycle f x (f y) β SameCycle f x y := by
rw [sameCycle_comm, sameCycle_apply_left, sameCycle_comm]
#align equiv.perm.same_cycle_apply_right Equiv.Perm.sameCycle_apply_right
@[simp]
theorem sameCycle_inv_apply_left : SameCycle f (fβ»ΒΉ x) y β SameCycle f x y := by
rw [β sameCycle_apply_left, apply_inv_self]
#align equiv.perm.same_cycle_inv_apply_left Equiv.Perm.sameCycle_inv_apply_left
@[simp]
theorem sameCycle_inv_apply_right : SameCycle f x (fβ»ΒΉ y) β SameCycle f x y := by
rw [β sameCycle_apply_right, apply_inv_self]
#align equiv.perm.same_cycle_inv_apply_right Equiv.Perm.sameCycle_inv_apply_right
@[simp]
theorem sameCycle_zpow_left {n : β€} : SameCycle f ((f ^ n) x) y β SameCycle f x y :=
(Equiv.addRight (n : β€)).exists_congr_left.trans <| by simp [SameCycle, zpow_add]
#align equiv.perm.same_cycle_zpow_left Equiv.Perm.sameCycle_zpow_left
@[simp]
| Mathlib/GroupTheory/Perm/Cycle/Basic.lean | 152 | 153 | theorem sameCycle_zpow_right {n : β€} : SameCycle f x ((f ^ n) y) β SameCycle f x y := by |
rw [sameCycle_comm, sameCycle_zpow_left, sameCycle_comm]
| 1,239 |
import Mathlib.Algebra.Module.BigOperators
import Mathlib.Data.Fintype.Perm
import Mathlib.GroupTheory.Perm.Finite
import Mathlib.GroupTheory.Perm.List
#align_import group_theory.perm.cycle.basic from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
open Equiv Function Finset
variable {ΞΉ Ξ± Ξ² : Type*}
namespace Equiv.Perm
section SameCycle
variable {f g : Perm Ξ±} {p : Ξ± β Prop} {x y z : Ξ±}
def SameCycle (f : Perm Ξ±) (x y : Ξ±) : Prop :=
β i : β€, (f ^ i) x = y
#align equiv.perm.same_cycle Equiv.Perm.SameCycle
@[refl]
theorem SameCycle.refl (f : Perm Ξ±) (x : Ξ±) : SameCycle f x x :=
β¨0, rflβ©
#align equiv.perm.same_cycle.refl Equiv.Perm.SameCycle.refl
theorem SameCycle.rfl : SameCycle f x x :=
SameCycle.refl _ _
#align equiv.perm.same_cycle.rfl Equiv.Perm.SameCycle.rfl
protected theorem _root_.Eq.sameCycle (h : x = y) (f : Perm Ξ±) : f.SameCycle x y := by rw [h]
#align eq.same_cycle Eq.sameCycle
@[symm]
theorem SameCycle.symm : SameCycle f x y β SameCycle f y x := fun β¨i, hiβ© =>
β¨-i, by rw [zpow_neg, β hi, inv_apply_self]β©
#align equiv.perm.same_cycle.symm Equiv.Perm.SameCycle.symm
theorem sameCycle_comm : SameCycle f x y β SameCycle f y x :=
β¨SameCycle.symm, SameCycle.symmβ©
#align equiv.perm.same_cycle_comm Equiv.Perm.sameCycle_comm
@[trans]
theorem SameCycle.trans : SameCycle f x y β SameCycle f y z β SameCycle f x z :=
fun β¨i, hiβ© β¨j, hjβ© => β¨j + i, by rw [zpow_add, mul_apply, hi, hj]β©
#align equiv.perm.same_cycle.trans Equiv.Perm.SameCycle.trans
variable (f) in
theorem SameCycle.equivalence : Equivalence (SameCycle f) :=
β¨SameCycle.refl f, SameCycle.symm, SameCycle.transβ©
def SameCycle.setoid (f : Perm Ξ±) : Setoid Ξ± where
iseqv := SameCycle.equivalence f
@[simp]
theorem sameCycle_one : SameCycle 1 x y β x = y := by simp [SameCycle]
#align equiv.perm.same_cycle_one Equiv.Perm.sameCycle_one
@[simp]
theorem sameCycle_inv : SameCycle fβ»ΒΉ x y β SameCycle f x y :=
(Equiv.neg _).exists_congr_left.trans <| by simp [SameCycle]
#align equiv.perm.same_cycle_inv Equiv.Perm.sameCycle_inv
alias β¨SameCycle.of_inv, SameCycle.invβ© := sameCycle_inv
#align equiv.perm.same_cycle.of_inv Equiv.Perm.SameCycle.of_inv
#align equiv.perm.same_cycle.inv Equiv.Perm.SameCycle.inv
@[simp]
theorem sameCycle_conj : SameCycle (g * f * gβ»ΒΉ) x y β SameCycle f (gβ»ΒΉ x) (gβ»ΒΉ y) :=
exists_congr fun i => by simp [conj_zpow, eq_inv_iff_eq]
#align equiv.perm.same_cycle_conj Equiv.Perm.sameCycle_conj
theorem SameCycle.conj : SameCycle f x y β SameCycle (g * f * gβ»ΒΉ) (g x) (g y) := by
simp [sameCycle_conj]
#align equiv.perm.same_cycle.conj Equiv.Perm.SameCycle.conj
theorem SameCycle.apply_eq_self_iff : SameCycle f x y β (f x = x β f y = y) := fun β¨i, hiβ© => by
rw [β hi, β mul_apply, β zpow_one_add, add_comm, zpow_add_one, mul_apply,
(f ^ i).injective.eq_iff]
#align equiv.perm.same_cycle.apply_eq_self_iff Equiv.Perm.SameCycle.apply_eq_self_iff
theorem SameCycle.eq_of_left (h : SameCycle f x y) (hx : IsFixedPt f x) : x = y :=
let β¨_, hnβ© := h
(hx.perm_zpow _).eq.symm.trans hn
#align equiv.perm.same_cycle.eq_of_left Equiv.Perm.SameCycle.eq_of_left
theorem SameCycle.eq_of_right (h : SameCycle f x y) (hy : IsFixedPt f y) : x = y :=
h.eq_of_left <| h.apply_eq_self_iff.2 hy
#align equiv.perm.same_cycle.eq_of_right Equiv.Perm.SameCycle.eq_of_right
@[simp]
theorem sameCycle_apply_left : SameCycle f (f x) y β SameCycle f x y :=
(Equiv.addRight 1).exists_congr_left.trans <| by
simp [zpow_sub, SameCycle, Int.add_neg_one, Function.comp]
#align equiv.perm.same_cycle_apply_left Equiv.Perm.sameCycle_apply_left
@[simp]
theorem sameCycle_apply_right : SameCycle f x (f y) β SameCycle f x y := by
rw [sameCycle_comm, sameCycle_apply_left, sameCycle_comm]
#align equiv.perm.same_cycle_apply_right Equiv.Perm.sameCycle_apply_right
@[simp]
theorem sameCycle_inv_apply_left : SameCycle f (fβ»ΒΉ x) y β SameCycle f x y := by
rw [β sameCycle_apply_left, apply_inv_self]
#align equiv.perm.same_cycle_inv_apply_left Equiv.Perm.sameCycle_inv_apply_left
@[simp]
theorem sameCycle_inv_apply_right : SameCycle f x (fβ»ΒΉ y) β SameCycle f x y := by
rw [β sameCycle_apply_right, apply_inv_self]
#align equiv.perm.same_cycle_inv_apply_right Equiv.Perm.sameCycle_inv_apply_right
@[simp]
theorem sameCycle_zpow_left {n : β€} : SameCycle f ((f ^ n) x) y β SameCycle f x y :=
(Equiv.addRight (n : β€)).exists_congr_left.trans <| by simp [SameCycle, zpow_add]
#align equiv.perm.same_cycle_zpow_left Equiv.Perm.sameCycle_zpow_left
@[simp]
theorem sameCycle_zpow_right {n : β€} : SameCycle f x ((f ^ n) y) β SameCycle f x y := by
rw [sameCycle_comm, sameCycle_zpow_left, sameCycle_comm]
#align equiv.perm.same_cycle_zpow_right Equiv.Perm.sameCycle_zpow_right
@[simp]
| Mathlib/GroupTheory/Perm/Cycle/Basic.lean | 157 | 158 | theorem sameCycle_pow_left {n : β} : SameCycle f ((f ^ n) x) y β SameCycle f x y := by |
rw [β zpow_natCast, sameCycle_zpow_left]
| 1,239 |
import Mathlib.GroupTheory.Perm.Cycle.Basic
#align_import group_theory.perm.cycle.basic from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
open Equiv Function Finset
variable {ΞΉ Ξ± Ξ² : Type*}
namespace Equiv.Perm
section Generation
variable [Finite Ξ²]
open Subgroup
| Mathlib/GroupTheory/Perm/Closure.lean | 37 | 41 | theorem closure_isCycle : closure { Ο : Perm Ξ² | IsCycle Ο } = β€ := by |
classical
cases nonempty_fintype Ξ²
exact
top_le_iff.mp (le_trans (ge_of_eq closure_isSwap) (closure_mono fun _ => IsSwap.isCycle))
| 1,240 |
import Mathlib.GroupTheory.Perm.Cycle.Basic
#align_import group_theory.perm.cycle.basic from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
open Equiv Function Finset
variable {ΞΉ Ξ± Ξ² : Type*}
namespace Equiv.Perm
section Generation
variable [Finite Ξ²]
open Subgroup
theorem closure_isCycle : closure { Ο : Perm Ξ² | IsCycle Ο } = β€ := by
classical
cases nonempty_fintype Ξ²
exact
top_le_iff.mp (le_trans (ge_of_eq closure_isSwap) (closure_mono fun _ => IsSwap.isCycle))
#align equiv.perm.closure_is_cycle Equiv.Perm.closure_isCycle
variable [DecidableEq Ξ±] [Fintype Ξ±]
| Mathlib/GroupTheory/Perm/Closure.lean | 46 | 93 | theorem closure_cycle_adjacent_swap {Ο : Perm Ξ±} (h1 : IsCycle Ο) (h2 : Ο.support = β€) (x : Ξ±) :
closure ({Ο, swap x (Ο x)} : Set (Perm Ξ±)) = β€ := by |
let H := closure ({Ο, swap x (Ο x)} : Set (Perm Ξ±))
have h3 : Ο β H := subset_closure (Set.mem_insert Ο _)
have h4 : swap x (Ο x) β H := subset_closure (Set.mem_insert_of_mem _ (Set.mem_singleton _))
have step1 : β n : β, swap ((Ο ^ n) x) ((Ο ^ (n + 1) : Perm Ξ±) x) β H := by
intro n
induction' n with n ih
Β· exact subset_closure (Set.mem_insert_of_mem _ (Set.mem_singleton _))
Β· convert H.mul_mem (H.mul_mem h3 ih) (H.inv_mem h3)
simp_rw [mul_swap_eq_swap_mul, mul_inv_cancel_right, pow_succ']
rfl
have step2 : β n : β, swap x ((Ο ^ n) x) β H := by
intro n
induction' n with n ih
Β· simp only [Nat.zero_eq, pow_zero, coe_one, id_eq, swap_self, Set.mem_singleton_iff]
convert H.one_mem
Β· by_cases h5 : x = (Ο ^ n) x
Β· rw [pow_succ', mul_apply, β h5]
exact h4
by_cases h6 : x = (Ο ^ (n + 1) : Perm Ξ±) x
Β· rw [β h6, swap_self]
exact H.one_mem
rw [swap_comm, β swap_mul_swap_mul_swap h5 h6]
exact H.mul_mem (H.mul_mem (step1 n) ih) (step1 n)
have step3 : β y : Ξ±, swap x y β H := by
intro y
have hx : x β (β€ : Finset Ξ±) := Finset.mem_univ x
rw [β h2, mem_support] at hx
have hy : y β (β€ : Finset Ξ±) := Finset.mem_univ y
rw [β h2, mem_support] at hy
cases' IsCycle.exists_pow_eq h1 hx hy with n hn
rw [β hn]
exact step2 n
have step4 : β y z : Ξ±, swap y z β H := by
intro y z
by_cases h5 : z = x
Β· rw [h5, swap_comm]
exact step3 y
by_cases h6 : z = y
Β· rw [h6, swap_self]
exact H.one_mem
rw [β swap_mul_swap_mul_swap h5 h6, swap_comm z x]
exact H.mul_mem (H.mul_mem (step3 y) (step3 z)) (step3 y)
rw [eq_top_iff, β closure_isSwap, closure_le]
rintro Ο β¨y, z, _, h6β©
rw [h6]
exact step4 y z
| 1,240 |
import Mathlib.GroupTheory.Perm.Cycle.Basic
#align_import group_theory.perm.cycle.basic from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
open Equiv Function Finset
variable {ΞΉ Ξ± Ξ² : Type*}
namespace Equiv.Perm
section Generation
variable [Finite Ξ²]
open Subgroup
theorem closure_isCycle : closure { Ο : Perm Ξ² | IsCycle Ο } = β€ := by
classical
cases nonempty_fintype Ξ²
exact
top_le_iff.mp (le_trans (ge_of_eq closure_isSwap) (closure_mono fun _ => IsSwap.isCycle))
#align equiv.perm.closure_is_cycle Equiv.Perm.closure_isCycle
variable [DecidableEq Ξ±] [Fintype Ξ±]
theorem closure_cycle_adjacent_swap {Ο : Perm Ξ±} (h1 : IsCycle Ο) (h2 : Ο.support = β€) (x : Ξ±) :
closure ({Ο, swap x (Ο x)} : Set (Perm Ξ±)) = β€ := by
let H := closure ({Ο, swap x (Ο x)} : Set (Perm Ξ±))
have h3 : Ο β H := subset_closure (Set.mem_insert Ο _)
have h4 : swap x (Ο x) β H := subset_closure (Set.mem_insert_of_mem _ (Set.mem_singleton _))
have step1 : β n : β, swap ((Ο ^ n) x) ((Ο ^ (n + 1) : Perm Ξ±) x) β H := by
intro n
induction' n with n ih
Β· exact subset_closure (Set.mem_insert_of_mem _ (Set.mem_singleton _))
Β· convert H.mul_mem (H.mul_mem h3 ih) (H.inv_mem h3)
simp_rw [mul_swap_eq_swap_mul, mul_inv_cancel_right, pow_succ']
rfl
have step2 : β n : β, swap x ((Ο ^ n) x) β H := by
intro n
induction' n with n ih
Β· simp only [Nat.zero_eq, pow_zero, coe_one, id_eq, swap_self, Set.mem_singleton_iff]
convert H.one_mem
Β· by_cases h5 : x = (Ο ^ n) x
Β· rw [pow_succ', mul_apply, β h5]
exact h4
by_cases h6 : x = (Ο ^ (n + 1) : Perm Ξ±) x
Β· rw [β h6, swap_self]
exact H.one_mem
rw [swap_comm, β swap_mul_swap_mul_swap h5 h6]
exact H.mul_mem (H.mul_mem (step1 n) ih) (step1 n)
have step3 : β y : Ξ±, swap x y β H := by
intro y
have hx : x β (β€ : Finset Ξ±) := Finset.mem_univ x
rw [β h2, mem_support] at hx
have hy : y β (β€ : Finset Ξ±) := Finset.mem_univ y
rw [β h2, mem_support] at hy
cases' IsCycle.exists_pow_eq h1 hx hy with n hn
rw [β hn]
exact step2 n
have step4 : β y z : Ξ±, swap y z β H := by
intro y z
by_cases h5 : z = x
Β· rw [h5, swap_comm]
exact step3 y
by_cases h6 : z = y
Β· rw [h6, swap_self]
exact H.one_mem
rw [β swap_mul_swap_mul_swap h5 h6, swap_comm z x]
exact H.mul_mem (H.mul_mem (step3 y) (step3 z)) (step3 y)
rw [eq_top_iff, β closure_isSwap, closure_le]
rintro Ο β¨y, z, _, h6β©
rw [h6]
exact step4 y z
#align equiv.perm.closure_cycle_adjacent_swap Equiv.Perm.closure_cycle_adjacent_swap
| Mathlib/GroupTheory/Perm/Closure.lean | 96 | 108 | theorem closure_cycle_coprime_swap {n : β} {Ο : Perm Ξ±} (h0 : Nat.Coprime n (Fintype.card Ξ±))
(h1 : IsCycle Ο) (h2 : Ο.support = Finset.univ) (x : Ξ±) :
closure ({Ο, swap x ((Ο ^ n) x)} : Set (Perm Ξ±)) = β€ := by |
rw [β Finset.card_univ, β h2, β h1.orderOf] at h0
cases' exists_pow_eq_self_of_coprime h0 with m hm
have h2' : (Ο ^ n).support = β€ := Eq.trans (support_pow_coprime h0) h2
have h1' : IsCycle ((Ο ^ n) ^ (m : β€)) := by rwa [β hm] at h1
replace h1' : IsCycle (Ο ^ n) :=
h1'.of_pow (le_trans (support_pow_le Ο n) (ge_of_eq (congr_arg support hm)))
rw [eq_top_iff, β closure_cycle_adjacent_swap h1' h2' x, closure_le, Set.insert_subset_iff]
exact
β¨Subgroup.pow_mem (closure _) (subset_closure (Set.mem_insert Ο _)) n,
Set.singleton_subset_iff.mpr (subset_closure (Set.mem_insert_of_mem _ (Set.mem_singleton _)))β©
| 1,240 |
import Mathlib.GroupTheory.Perm.Cycle.Basic
#align_import group_theory.perm.cycle.basic from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3"
open Equiv Function Finset
variable {ΞΉ Ξ± Ξ² : Type*}
namespace Equiv.Perm
section Generation
variable [Finite Ξ²]
open Subgroup
theorem closure_isCycle : closure { Ο : Perm Ξ² | IsCycle Ο } = β€ := by
classical
cases nonempty_fintype Ξ²
exact
top_le_iff.mp (le_trans (ge_of_eq closure_isSwap) (closure_mono fun _ => IsSwap.isCycle))
#align equiv.perm.closure_is_cycle Equiv.Perm.closure_isCycle
variable [DecidableEq Ξ±] [Fintype Ξ±]
theorem closure_cycle_adjacent_swap {Ο : Perm Ξ±} (h1 : IsCycle Ο) (h2 : Ο.support = β€) (x : Ξ±) :
closure ({Ο, swap x (Ο x)} : Set (Perm Ξ±)) = β€ := by
let H := closure ({Ο, swap x (Ο x)} : Set (Perm Ξ±))
have h3 : Ο β H := subset_closure (Set.mem_insert Ο _)
have h4 : swap x (Ο x) β H := subset_closure (Set.mem_insert_of_mem _ (Set.mem_singleton _))
have step1 : β n : β, swap ((Ο ^ n) x) ((Ο ^ (n + 1) : Perm Ξ±) x) β H := by
intro n
induction' n with n ih
Β· exact subset_closure (Set.mem_insert_of_mem _ (Set.mem_singleton _))
Β· convert H.mul_mem (H.mul_mem h3 ih) (H.inv_mem h3)
simp_rw [mul_swap_eq_swap_mul, mul_inv_cancel_right, pow_succ']
rfl
have step2 : β n : β, swap x ((Ο ^ n) x) β H := by
intro n
induction' n with n ih
Β· simp only [Nat.zero_eq, pow_zero, coe_one, id_eq, swap_self, Set.mem_singleton_iff]
convert H.one_mem
Β· by_cases h5 : x = (Ο ^ n) x
Β· rw [pow_succ', mul_apply, β h5]
exact h4
by_cases h6 : x = (Ο ^ (n + 1) : Perm Ξ±) x
Β· rw [β h6, swap_self]
exact H.one_mem
rw [swap_comm, β swap_mul_swap_mul_swap h5 h6]
exact H.mul_mem (H.mul_mem (step1 n) ih) (step1 n)
have step3 : β y : Ξ±, swap x y β H := by
intro y
have hx : x β (β€ : Finset Ξ±) := Finset.mem_univ x
rw [β h2, mem_support] at hx
have hy : y β (β€ : Finset Ξ±) := Finset.mem_univ y
rw [β h2, mem_support] at hy
cases' IsCycle.exists_pow_eq h1 hx hy with n hn
rw [β hn]
exact step2 n
have step4 : β y z : Ξ±, swap y z β H := by
intro y z
by_cases h5 : z = x
Β· rw [h5, swap_comm]
exact step3 y
by_cases h6 : z = y
Β· rw [h6, swap_self]
exact H.one_mem
rw [β swap_mul_swap_mul_swap h5 h6, swap_comm z x]
exact H.mul_mem (H.mul_mem (step3 y) (step3 z)) (step3 y)
rw [eq_top_iff, β closure_isSwap, closure_le]
rintro Ο β¨y, z, _, h6β©
rw [h6]
exact step4 y z
#align equiv.perm.closure_cycle_adjacent_swap Equiv.Perm.closure_cycle_adjacent_swap
theorem closure_cycle_coprime_swap {n : β} {Ο : Perm Ξ±} (h0 : Nat.Coprime n (Fintype.card Ξ±))
(h1 : IsCycle Ο) (h2 : Ο.support = Finset.univ) (x : Ξ±) :
closure ({Ο, swap x ((Ο ^ n) x)} : Set (Perm Ξ±)) = β€ := by
rw [β Finset.card_univ, β h2, β h1.orderOf] at h0
cases' exists_pow_eq_self_of_coprime h0 with m hm
have h2' : (Ο ^ n).support = β€ := Eq.trans (support_pow_coprime h0) h2
have h1' : IsCycle ((Ο ^ n) ^ (m : β€)) := by rwa [β hm] at h1
replace h1' : IsCycle (Ο ^ n) :=
h1'.of_pow (le_trans (support_pow_le Ο n) (ge_of_eq (congr_arg support hm)))
rw [eq_top_iff, β closure_cycle_adjacent_swap h1' h2' x, closure_le, Set.insert_subset_iff]
exact
β¨Subgroup.pow_mem (closure _) (subset_closure (Set.mem_insert Ο _)) n,
Set.singleton_subset_iff.mpr (subset_closure (Set.mem_insert_of_mem _ (Set.mem_singleton _)))β©
#align equiv.perm.closure_cycle_coprime_swap Equiv.Perm.closure_cycle_coprime_swap
| Mathlib/GroupTheory/Perm/Closure.lean | 111 | 122 | theorem closure_prime_cycle_swap {Ο Ο : Perm Ξ±} (h0 : (Fintype.card Ξ±).Prime) (h1 : IsCycle Ο)
(h2 : Ο.support = Finset.univ) (h3 : IsSwap Ο) : closure ({Ο, Ο} : Set (Perm Ξ±)) = β€ := by |
obtain β¨x, y, h4, h5β© := h3
obtain β¨i, hiβ© :=
h1.exists_pow_eq (mem_support.mp ((Finset.ext_iff.mp h2 x).mpr (Finset.mem_univ x)))
(mem_support.mp ((Finset.ext_iff.mp h2 y).mpr (Finset.mem_univ y)))
rw [h5, β hi]
refine closure_cycle_coprime_swap
(Nat.Coprime.symm (h0.coprime_iff_not_dvd.mpr fun h => h4 ?_)) h1 h2 x
cases' h with m hm
rwa [hm, pow_mul, β Finset.card_univ, β h2, β h1.orderOf, pow_orderOf_eq_one, one_pow,
one_apply] at hi
| 1,240 |
import Mathlib.Data.Fintype.Option
import Mathlib.Data.Fintype.Perm
import Mathlib.Data.Fintype.Prod
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Option
#align_import group_theory.perm.option from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open Equiv
@[simp]
theorem Equiv.optionCongr_one {Ξ± : Type*} : (1 : Perm Ξ±).optionCongr = 1 :=
Equiv.optionCongr_refl
#align equiv.option_congr_one Equiv.optionCongr_one
@[simp]
| Mathlib/GroupTheory/Perm/Option.lean | 27 | 34 | theorem Equiv.optionCongr_swap {Ξ± : Type*} [DecidableEq Ξ±] (x y : Ξ±) :
optionCongr (swap x y) = swap (some x) (some y) := by |
ext (_ | i)
Β· simp [swap_apply_of_ne_of_ne]
Β· by_cases hx : i = x
Β· simp only [hx, optionCongr_apply, Option.map_some', swap_apply_left, Option.mem_def,
Option.some.injEq]
by_cases hy : i = y <;> simp [hx, hy, swap_apply_of_ne_of_ne]
| 1,241 |
import Mathlib.Data.Fintype.Option
import Mathlib.Data.Fintype.Perm
import Mathlib.Data.Fintype.Prod
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Option
#align_import group_theory.perm.option from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open Equiv
@[simp]
theorem Equiv.optionCongr_one {Ξ± : Type*} : (1 : Perm Ξ±).optionCongr = 1 :=
Equiv.optionCongr_refl
#align equiv.option_congr_one Equiv.optionCongr_one
@[simp]
theorem Equiv.optionCongr_swap {Ξ± : Type*} [DecidableEq Ξ±] (x y : Ξ±) :
optionCongr (swap x y) = swap (some x) (some y) := by
ext (_ | i)
Β· simp [swap_apply_of_ne_of_ne]
Β· by_cases hx : i = x
Β· simp only [hx, optionCongr_apply, Option.map_some', swap_apply_left, Option.mem_def,
Option.some.injEq]
by_cases hy : i = y <;> simp [hx, hy, swap_apply_of_ne_of_ne]
#align equiv.option_congr_swap Equiv.optionCongr_swap
@[simp]
| Mathlib/GroupTheory/Perm/Option.lean | 38 | 43 | theorem Equiv.optionCongr_sign {Ξ± : Type*} [DecidableEq Ξ±] [Fintype Ξ±] (e : Perm Ξ±) :
Perm.sign e.optionCongr = Perm.sign e := by |
refine Perm.swap_induction_on e ?_ ?_
Β· simp [Perm.one_def]
Β· intro f x y hne h
simp [h, hne, Perm.mul_def, β Equiv.optionCongr_trans]
| 1,241 |
import Mathlib.Data.Fintype.Option
import Mathlib.Data.Fintype.Perm
import Mathlib.Data.Fintype.Prod
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Option
#align_import group_theory.perm.option from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open Equiv
@[simp]
theorem Equiv.optionCongr_one {Ξ± : Type*} : (1 : Perm Ξ±).optionCongr = 1 :=
Equiv.optionCongr_refl
#align equiv.option_congr_one Equiv.optionCongr_one
@[simp]
theorem Equiv.optionCongr_swap {Ξ± : Type*} [DecidableEq Ξ±] (x y : Ξ±) :
optionCongr (swap x y) = swap (some x) (some y) := by
ext (_ | i)
Β· simp [swap_apply_of_ne_of_ne]
Β· by_cases hx : i = x
Β· simp only [hx, optionCongr_apply, Option.map_some', swap_apply_left, Option.mem_def,
Option.some.injEq]
by_cases hy : i = y <;> simp [hx, hy, swap_apply_of_ne_of_ne]
#align equiv.option_congr_swap Equiv.optionCongr_swap
@[simp]
theorem Equiv.optionCongr_sign {Ξ± : Type*} [DecidableEq Ξ±] [Fintype Ξ±] (e : Perm Ξ±) :
Perm.sign e.optionCongr = Perm.sign e := by
refine Perm.swap_induction_on e ?_ ?_
Β· simp [Perm.one_def]
Β· intro f x y hne h
simp [h, hne, Perm.mul_def, β Equiv.optionCongr_trans]
#align equiv.option_congr_sign Equiv.optionCongr_sign
@[simp]
| Mathlib/GroupTheory/Perm/Option.lean | 47 | 58 | theorem map_equiv_removeNone {Ξ± : Type*} [DecidableEq Ξ±] (Ο : Perm (Option Ξ±)) :
(removeNone Ο).optionCongr = swap none (Ο none) * Ο := by |
ext1 x
have : Option.map (β(removeNone Ο)) x = (swap none (Ο none)) (Ο x) := by
cases' x with x
Β· simp
Β· cases h : Ο (some _)
Β· simp [removeNone_none _ h]
Β· have hn : Ο (some x) β none := by simp [h]
have hΟn : Ο (some x) β Ο none := Ο.injective.ne (by simp)
simp [removeNone_some _ β¨_, hβ©, β h, swap_apply_of_ne_of_ne hn hΟn]
simpa using this
| 1,241 |
import Mathlib.Data.Fintype.Option
import Mathlib.Data.Fintype.Perm
import Mathlib.Data.Fintype.Prod
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Option
#align_import group_theory.perm.option from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open Equiv
@[simp]
theorem Equiv.optionCongr_one {Ξ± : Type*} : (1 : Perm Ξ±).optionCongr = 1 :=
Equiv.optionCongr_refl
#align equiv.option_congr_one Equiv.optionCongr_one
@[simp]
theorem Equiv.optionCongr_swap {Ξ± : Type*} [DecidableEq Ξ±] (x y : Ξ±) :
optionCongr (swap x y) = swap (some x) (some y) := by
ext (_ | i)
Β· simp [swap_apply_of_ne_of_ne]
Β· by_cases hx : i = x
Β· simp only [hx, optionCongr_apply, Option.map_some', swap_apply_left, Option.mem_def,
Option.some.injEq]
by_cases hy : i = y <;> simp [hx, hy, swap_apply_of_ne_of_ne]
#align equiv.option_congr_swap Equiv.optionCongr_swap
@[simp]
theorem Equiv.optionCongr_sign {Ξ± : Type*} [DecidableEq Ξ±] [Fintype Ξ±] (e : Perm Ξ±) :
Perm.sign e.optionCongr = Perm.sign e := by
refine Perm.swap_induction_on e ?_ ?_
Β· simp [Perm.one_def]
Β· intro f x y hne h
simp [h, hne, Perm.mul_def, β Equiv.optionCongr_trans]
#align equiv.option_congr_sign Equiv.optionCongr_sign
@[simp]
theorem map_equiv_removeNone {Ξ± : Type*} [DecidableEq Ξ±] (Ο : Perm (Option Ξ±)) :
(removeNone Ο).optionCongr = swap none (Ο none) * Ο := by
ext1 x
have : Option.map (β(removeNone Ο)) x = (swap none (Ο none)) (Ο x) := by
cases' x with x
Β· simp
Β· cases h : Ο (some _)
Β· simp [removeNone_none _ h]
Β· have hn : Ο (some x) β none := by simp [h]
have hΟn : Ο (some x) β Ο none := Ο.injective.ne (by simp)
simp [removeNone_some _ β¨_, hβ©, β h, swap_apply_of_ne_of_ne hn hΟn]
simpa using this
#align map_equiv_remove_none map_equiv_removeNone
@[simps]
def Equiv.Perm.decomposeOption {Ξ± : Type*} [DecidableEq Ξ±] :
Perm (Option Ξ±) β Option Ξ± Γ Perm Ξ± where
toFun Ο := (Ο none, removeNone Ο)
invFun i := swap none i.1 * i.2.optionCongr
left_inv Ο := by simp
right_inv := fun β¨x, Οβ© => by
have : removeNone (swap none x * Ο.optionCongr) = Ο :=
Equiv.optionCongr_injective (by simp [β mul_assoc])
simp [β Perm.eq_inv_iff_eq, this]
#align equiv.perm.decompose_option Equiv.Perm.decomposeOption
| Mathlib/GroupTheory/Perm/Option.lean | 76 | 77 | theorem Equiv.Perm.decomposeOption_symm_of_none_apply {Ξ± : Type*} [DecidableEq Ξ±] (e : Perm Ξ±)
(i : Option Ξ±) : Equiv.Perm.decomposeOption.symm (none, e) i = i.map e := by | simp
| 1,241 |
import Mathlib.Data.Fintype.Option
import Mathlib.Data.Fintype.Perm
import Mathlib.Data.Fintype.Prod
import Mathlib.GroupTheory.Perm.Sign
import Mathlib.Logic.Equiv.Option
#align_import group_theory.perm.option from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
open Equiv
@[simp]
theorem Equiv.optionCongr_one {Ξ± : Type*} : (1 : Perm Ξ±).optionCongr = 1 :=
Equiv.optionCongr_refl
#align equiv.option_congr_one Equiv.optionCongr_one
@[simp]
theorem Equiv.optionCongr_swap {Ξ± : Type*} [DecidableEq Ξ±] (x y : Ξ±) :
optionCongr (swap x y) = swap (some x) (some y) := by
ext (_ | i)
Β· simp [swap_apply_of_ne_of_ne]
Β· by_cases hx : i = x
Β· simp only [hx, optionCongr_apply, Option.map_some', swap_apply_left, Option.mem_def,
Option.some.injEq]
by_cases hy : i = y <;> simp [hx, hy, swap_apply_of_ne_of_ne]
#align equiv.option_congr_swap Equiv.optionCongr_swap
@[simp]
theorem Equiv.optionCongr_sign {Ξ± : Type*} [DecidableEq Ξ±] [Fintype Ξ±] (e : Perm Ξ±) :
Perm.sign e.optionCongr = Perm.sign e := by
refine Perm.swap_induction_on e ?_ ?_
Β· simp [Perm.one_def]
Β· intro f x y hne h
simp [h, hne, Perm.mul_def, β Equiv.optionCongr_trans]
#align equiv.option_congr_sign Equiv.optionCongr_sign
@[simp]
theorem map_equiv_removeNone {Ξ± : Type*} [DecidableEq Ξ±] (Ο : Perm (Option Ξ±)) :
(removeNone Ο).optionCongr = swap none (Ο none) * Ο := by
ext1 x
have : Option.map (β(removeNone Ο)) x = (swap none (Ο none)) (Ο x) := by
cases' x with x
Β· simp
Β· cases h : Ο (some _)
Β· simp [removeNone_none _ h]
Β· have hn : Ο (some x) β none := by simp [h]
have hΟn : Ο (some x) β Ο none := Ο.injective.ne (by simp)
simp [removeNone_some _ β¨_, hβ©, β h, swap_apply_of_ne_of_ne hn hΟn]
simpa using this
#align map_equiv_remove_none map_equiv_removeNone
@[simps]
def Equiv.Perm.decomposeOption {Ξ± : Type*} [DecidableEq Ξ±] :
Perm (Option Ξ±) β Option Ξ± Γ Perm Ξ± where
toFun Ο := (Ο none, removeNone Ο)
invFun i := swap none i.1 * i.2.optionCongr
left_inv Ο := by simp
right_inv := fun β¨x, Οβ© => by
have : removeNone (swap none x * Ο.optionCongr) = Ο :=
Equiv.optionCongr_injective (by simp [β mul_assoc])
simp [β Perm.eq_inv_iff_eq, this]
#align equiv.perm.decompose_option Equiv.Perm.decomposeOption
theorem Equiv.Perm.decomposeOption_symm_of_none_apply {Ξ± : Type*} [DecidableEq Ξ±] (e : Perm Ξ±)
(i : Option Ξ±) : Equiv.Perm.decomposeOption.symm (none, e) i = i.map e := by simp
#align equiv.perm.decompose_option_symm_of_none_apply Equiv.Perm.decomposeOption_symm_of_none_apply
| Mathlib/GroupTheory/Perm/Option.lean | 80 | 81 | theorem Equiv.Perm.decomposeOption_symm_sign {Ξ± : Type*} [DecidableEq Ξ±] [Fintype Ξ±] (e : Perm Ξ±) :
Perm.sign (Equiv.Perm.decomposeOption.symm (none, e)) = Perm.sign e := by | simp
| 1,241 |
import Mathlib.Algebra.Group.Commutator
import Mathlib.Algebra.Group.Subgroup.Finite
import Mathlib.Data.Bracket
import Mathlib.GroupTheory.Subgroup.Centralizer
import Mathlib.Tactic.Group
#align_import group_theory.commutator from "leanprover-community/mathlib"@"4be589053caf347b899a494da75410deb55fb3ef"
variable {G G' F : Type*} [Group G] [Group G'] [FunLike F G G'] [MonoidHomClass F G G']
variable (f : F) {gβ gβ gβ g : G}
| Mathlib/GroupTheory/Commutator.lean | 31 | 32 | theorem commutatorElement_eq_one_iff_mul_comm : β
gβ, gββ = 1 β gβ * gβ = gβ * gβ := by |
rw [commutatorElement_def, mul_inv_eq_one, mul_inv_eq_iff_eq_mul]
| 1,242 |
import Mathlib.Algebra.Group.Commutator
import Mathlib.Algebra.Group.Subgroup.Finite
import Mathlib.Data.Bracket
import Mathlib.GroupTheory.Subgroup.Centralizer
import Mathlib.Tactic.Group
#align_import group_theory.commutator from "leanprover-community/mathlib"@"4be589053caf347b899a494da75410deb55fb3ef"
variable {G G' F : Type*} [Group G] [Group G'] [FunLike F G G'] [MonoidHomClass F G G']
variable (f : F) {gβ gβ gβ g : G}
theorem commutatorElement_eq_one_iff_mul_comm : β
gβ, gββ = 1 β gβ * gβ = gβ * gβ := by
rw [commutatorElement_def, mul_inv_eq_one, mul_inv_eq_iff_eq_mul]
#align commutator_element_eq_one_iff_mul_comm commutatorElement_eq_one_iff_mul_comm
theorem commutatorElement_eq_one_iff_commute : β
gβ, gββ = 1 β Commute gβ gβ :=
commutatorElement_eq_one_iff_mul_comm
#align commutator_element_eq_one_iff_commute commutatorElement_eq_one_iff_commute
theorem Commute.commutator_eq (h : Commute gβ gβ) : β
gβ, gββ = 1 :=
commutatorElement_eq_one_iff_commute.mpr h
#align commute.commutator_eq Commute.commutator_eq
variable (gβ gβ gβ g)
@[simp]
theorem commutatorElement_one_right : β
g, (1 : G)β = 1 :=
(Commute.one_right g).commutator_eq
#align commutator_element_one_right commutatorElement_one_right
@[simp]
theorem commutatorElement_one_left : β
(1 : G), gβ = 1 :=
(Commute.one_left g).commutator_eq
#align commutator_element_one_left commutatorElement_one_left
@[simp]
theorem commutatorElement_self : β
g, gβ = 1 :=
(Commute.refl g).commutator_eq
#align commutator_element_self commutatorElement_self
@[simp]
| Mathlib/GroupTheory/Commutator.lean | 61 | 62 | theorem commutatorElement_inv : β
gβ, gβββ»ΒΉ = β
gβ, gββ := by |
simp_rw [commutatorElement_def, mul_inv_rev, inv_inv, mul_assoc]
| 1,242 |
import Mathlib.Algebra.Group.Commutator
import Mathlib.Algebra.Group.Subgroup.Finite
import Mathlib.Data.Bracket
import Mathlib.GroupTheory.Subgroup.Centralizer
import Mathlib.Tactic.Group
#align_import group_theory.commutator from "leanprover-community/mathlib"@"4be589053caf347b899a494da75410deb55fb3ef"
variable {G G' F : Type*} [Group G] [Group G'] [FunLike F G G'] [MonoidHomClass F G G']
variable (f : F) {gβ gβ gβ g : G}
theorem commutatorElement_eq_one_iff_mul_comm : β
gβ, gββ = 1 β gβ * gβ = gβ * gβ := by
rw [commutatorElement_def, mul_inv_eq_one, mul_inv_eq_iff_eq_mul]
#align commutator_element_eq_one_iff_mul_comm commutatorElement_eq_one_iff_mul_comm
theorem commutatorElement_eq_one_iff_commute : β
gβ, gββ = 1 β Commute gβ gβ :=
commutatorElement_eq_one_iff_mul_comm
#align commutator_element_eq_one_iff_commute commutatorElement_eq_one_iff_commute
theorem Commute.commutator_eq (h : Commute gβ gβ) : β
gβ, gββ = 1 :=
commutatorElement_eq_one_iff_commute.mpr h
#align commute.commutator_eq Commute.commutator_eq
variable (gβ gβ gβ g)
@[simp]
theorem commutatorElement_one_right : β
g, (1 : G)β = 1 :=
(Commute.one_right g).commutator_eq
#align commutator_element_one_right commutatorElement_one_right
@[simp]
theorem commutatorElement_one_left : β
(1 : G), gβ = 1 :=
(Commute.one_left g).commutator_eq
#align commutator_element_one_left commutatorElement_one_left
@[simp]
theorem commutatorElement_self : β
g, gβ = 1 :=
(Commute.refl g).commutator_eq
#align commutator_element_self commutatorElement_self
@[simp]
theorem commutatorElement_inv : β
gβ, gβββ»ΒΉ = β
gβ, gββ := by
simp_rw [commutatorElement_def, mul_inv_rev, inv_inv, mul_assoc]
#align commutator_element_inv commutatorElement_inv
| Mathlib/GroupTheory/Commutator.lean | 65 | 66 | theorem map_commutatorElement : (f β
gβ, gββ : G') = β
f gβ, f gββ := by |
simp_rw [commutatorElement_def, map_mul f, map_inv f]
| 1,242 |
import Mathlib.Algebra.Group.Commutator
import Mathlib.Algebra.Group.Subgroup.Finite
import Mathlib.Data.Bracket
import Mathlib.GroupTheory.Subgroup.Centralizer
import Mathlib.Tactic.Group
#align_import group_theory.commutator from "leanprover-community/mathlib"@"4be589053caf347b899a494da75410deb55fb3ef"
variable {G G' F : Type*} [Group G] [Group G'] [FunLike F G G'] [MonoidHomClass F G G']
variable (f : F) {gβ gβ gβ g : G}
theorem commutatorElement_eq_one_iff_mul_comm : β
gβ, gββ = 1 β gβ * gβ = gβ * gβ := by
rw [commutatorElement_def, mul_inv_eq_one, mul_inv_eq_iff_eq_mul]
#align commutator_element_eq_one_iff_mul_comm commutatorElement_eq_one_iff_mul_comm
theorem commutatorElement_eq_one_iff_commute : β
gβ, gββ = 1 β Commute gβ gβ :=
commutatorElement_eq_one_iff_mul_comm
#align commutator_element_eq_one_iff_commute commutatorElement_eq_one_iff_commute
theorem Commute.commutator_eq (h : Commute gβ gβ) : β
gβ, gββ = 1 :=
commutatorElement_eq_one_iff_commute.mpr h
#align commute.commutator_eq Commute.commutator_eq
variable (gβ gβ gβ g)
@[simp]
theorem commutatorElement_one_right : β
g, (1 : G)β = 1 :=
(Commute.one_right g).commutator_eq
#align commutator_element_one_right commutatorElement_one_right
@[simp]
theorem commutatorElement_one_left : β
(1 : G), gβ = 1 :=
(Commute.one_left g).commutator_eq
#align commutator_element_one_left commutatorElement_one_left
@[simp]
theorem commutatorElement_self : β
g, gβ = 1 :=
(Commute.refl g).commutator_eq
#align commutator_element_self commutatorElement_self
@[simp]
theorem commutatorElement_inv : β
gβ, gβββ»ΒΉ = β
gβ, gββ := by
simp_rw [commutatorElement_def, mul_inv_rev, inv_inv, mul_assoc]
#align commutator_element_inv commutatorElement_inv
theorem map_commutatorElement : (f β
gβ, gββ : G') = β
f gβ, f gββ := by
simp_rw [commutatorElement_def, map_mul f, map_inv f]
#align map_commutator_element map_commutatorElement
theorem conjugate_commutatorElement : gβ * β
gβ, gββ * gββ»ΒΉ = β
gβ * gβ * gββ»ΒΉ, gβ * gβ * gββ»ΒΉβ :=
map_commutatorElement (MulAut.conj gβ).toMonoidHom gβ gβ
#align conjugate_commutator_element conjugate_commutatorElement
namespace Subgroup
instance commutator : Bracket (Subgroup G) (Subgroup G) :=
β¨fun Hβ Hβ => closure { g | β gβ β Hβ, β gβ β Hβ, β
gβ, gββ = g }β©
#align subgroup.commutator Subgroup.commutator
theorem commutator_def (Hβ Hβ : Subgroup G) :
β
Hβ, Hββ = closure { g | β gβ β Hβ, β gβ β Hβ, β
gβ, gββ = g } :=
rfl
#align subgroup.commutator_def Subgroup.commutator_def
variable {gβ gβ gβ} {Hβ Hβ Hβ Kβ Kβ : Subgroup G}
theorem commutator_mem_commutator (hβ : gβ β Hβ) (hβ : gβ β Hβ) : β
gβ, gββ β β
Hβ, Hββ :=
subset_closure β¨gβ, hβ, gβ, hβ, rflβ©
#align subgroup.commutator_mem_commutator Subgroup.commutator_mem_commutator
theorem commutator_le : β
Hβ, Hββ β€ Hβ β β gβ β Hβ, β gβ β Hβ, β
gβ, gββ β Hβ :=
Hβ.closure_le.trans
β¨fun h a b c d => h β¨a, b, c, d, rflβ©, fun h _g β¨a, b, c, d, h_eqβ© => h_eq βΈ h a b c dβ©
#align subgroup.commutator_le Subgroup.commutator_le
theorem commutator_mono (hβ : Hβ β€ Kβ) (hβ : Hβ β€ Kβ) : β
Hβ, Hββ β€ β
Kβ, Kββ :=
commutator_le.mpr fun _gβ hgβ _gβ hgβ => commutator_mem_commutator (hβ hgβ) (hβ hgβ)
#align subgroup.commutator_mono Subgroup.commutator_mono
| Mathlib/GroupTheory/Commutator.lean | 100 | 104 | theorem commutator_eq_bot_iff_le_centralizer : β
Hβ, Hββ = β₯ β Hβ β€ centralizer Hβ := by |
rw [eq_bot_iff, commutator_le]
refine forall_congr' fun p =>
forall_congr' fun _hp => forall_congr' fun q => forall_congr' fun hq => ?_
rw [mem_bot, commutatorElement_eq_one_iff_mul_comm, eq_comm]
| 1,242 |
import Mathlib.Algebra.Group.Commutator
import Mathlib.Algebra.Group.Subgroup.Finite
import Mathlib.Data.Bracket
import Mathlib.GroupTheory.Subgroup.Centralizer
import Mathlib.Tactic.Group
#align_import group_theory.commutator from "leanprover-community/mathlib"@"4be589053caf347b899a494da75410deb55fb3ef"
variable {G G' F : Type*} [Group G] [Group G'] [FunLike F G G'] [MonoidHomClass F G G']
variable (f : F) {gβ gβ gβ g : G}
theorem commutatorElement_eq_one_iff_mul_comm : β
gβ, gββ = 1 β gβ * gβ = gβ * gβ := by
rw [commutatorElement_def, mul_inv_eq_one, mul_inv_eq_iff_eq_mul]
#align commutator_element_eq_one_iff_mul_comm commutatorElement_eq_one_iff_mul_comm
theorem commutatorElement_eq_one_iff_commute : β
gβ, gββ = 1 β Commute gβ gβ :=
commutatorElement_eq_one_iff_mul_comm
#align commutator_element_eq_one_iff_commute commutatorElement_eq_one_iff_commute
theorem Commute.commutator_eq (h : Commute gβ gβ) : β
gβ, gββ = 1 :=
commutatorElement_eq_one_iff_commute.mpr h
#align commute.commutator_eq Commute.commutator_eq
variable (gβ gβ gβ g)
@[simp]
theorem commutatorElement_one_right : β
g, (1 : G)β = 1 :=
(Commute.one_right g).commutator_eq
#align commutator_element_one_right commutatorElement_one_right
@[simp]
theorem commutatorElement_one_left : β
(1 : G), gβ = 1 :=
(Commute.one_left g).commutator_eq
#align commutator_element_one_left commutatorElement_one_left
@[simp]
theorem commutatorElement_self : β
g, gβ = 1 :=
(Commute.refl g).commutator_eq
#align commutator_element_self commutatorElement_self
@[simp]
theorem commutatorElement_inv : β
gβ, gβββ»ΒΉ = β
gβ, gββ := by
simp_rw [commutatorElement_def, mul_inv_rev, inv_inv, mul_assoc]
#align commutator_element_inv commutatorElement_inv
theorem map_commutatorElement : (f β
gβ, gββ : G') = β
f gβ, f gββ := by
simp_rw [commutatorElement_def, map_mul f, map_inv f]
#align map_commutator_element map_commutatorElement
theorem conjugate_commutatorElement : gβ * β
gβ, gββ * gββ»ΒΉ = β
gβ * gβ * gββ»ΒΉ, gβ * gβ * gββ»ΒΉβ :=
map_commutatorElement (MulAut.conj gβ).toMonoidHom gβ gβ
#align conjugate_commutator_element conjugate_commutatorElement
namespace Subgroup
instance commutator : Bracket (Subgroup G) (Subgroup G) :=
β¨fun Hβ Hβ => closure { g | β gβ β Hβ, β gβ β Hβ, β
gβ, gββ = g }β©
#align subgroup.commutator Subgroup.commutator
theorem commutator_def (Hβ Hβ : Subgroup G) :
β
Hβ, Hββ = closure { g | β gβ β Hβ, β gβ β Hβ, β
gβ, gββ = g } :=
rfl
#align subgroup.commutator_def Subgroup.commutator_def
variable {gβ gβ gβ} {Hβ Hβ Hβ Kβ Kβ : Subgroup G}
theorem commutator_mem_commutator (hβ : gβ β Hβ) (hβ : gβ β Hβ) : β
gβ, gββ β β
Hβ, Hββ :=
subset_closure β¨gβ, hβ, gβ, hβ, rflβ©
#align subgroup.commutator_mem_commutator Subgroup.commutator_mem_commutator
theorem commutator_le : β
Hβ, Hββ β€ Hβ β β gβ β Hβ, β gβ β Hβ, β
gβ, gββ β Hβ :=
Hβ.closure_le.trans
β¨fun h a b c d => h β¨a, b, c, d, rflβ©, fun h _g β¨a, b, c, d, h_eqβ© => h_eq βΈ h a b c dβ©
#align subgroup.commutator_le Subgroup.commutator_le
theorem commutator_mono (hβ : Hβ β€ Kβ) (hβ : Hβ β€ Kβ) : β
Hβ, Hββ β€ β
Kβ, Kββ :=
commutator_le.mpr fun _gβ hgβ _gβ hgβ => commutator_mem_commutator (hβ hgβ) (hβ hgβ)
#align subgroup.commutator_mono Subgroup.commutator_mono
theorem commutator_eq_bot_iff_le_centralizer : β
Hβ, Hββ = β₯ β Hβ β€ centralizer Hβ := by
rw [eq_bot_iff, commutator_le]
refine forall_congr' fun p =>
forall_congr' fun _hp => forall_congr' fun q => forall_congr' fun hq => ?_
rw [mem_bot, commutatorElement_eq_one_iff_mul_comm, eq_comm]
#align subgroup.commutator_eq_bot_iff_le_centralizer Subgroup.commutator_eq_bot_iff_le_centralizer
| Mathlib/GroupTheory/Commutator.lean | 108 | 116 | theorem commutator_commutator_eq_bot_of_rotate (h1 : β
β
Hβ, Hββ, Hββ = β₯) (h2 : β
β
Hβ, Hββ, Hββ = β₯) :
β
β
Hβ, Hββ, Hββ = β₯ := by |
simp_rw [commutator_eq_bot_iff_le_centralizer, commutator_le,
mem_centralizer_iff_commutator_eq_one, β commutatorElement_def] at h1 h2 β’
intro x hx y hy z hz
trans x * z * β
y, β
zβ»ΒΉ, xβ»ΒΉβββ»ΒΉ * zβ»ΒΉ * y * β
xβ»ΒΉ, β
yβ»ΒΉ, zβββ»ΒΉ * yβ»ΒΉ * xβ»ΒΉ
Β· group
Β· rw [h1 _ (Hβ.inv_mem hy) _ hz _ (Hβ.inv_mem hx), h2 _ (Hβ.inv_mem hz) _ (Hβ.inv_mem hx) _ hy]
group
| 1,242 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.