Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 25e36be

Browse files
committed
chore(data/fintype/basic): fintype α/β from fintype α ⊕ β (#7736)
Also renaming the equivalent `α × β` versions, for consistency. Co-authored-by: Eric <37984851+ericrbg@users.noreply.github.com>
1 parent 4ea253b commit 25e36be

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/data/fintype/basic.lean

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,12 +733,12 @@ rfl
733733
card_product _ _
734734

735735
/-- Given that `α × β` is a fintype, `α` is also a fintype. -/
736-
def fintype.fintype_prod_left {α β} [decidable_eq α] [fintype (α × β)] [nonempty β] : fintype α :=
736+
def fintype.prod_left {α β} [decidable_eq α] [fintype (α × β)] [nonempty β] : fintype α :=
737737
⟨(fintype.elems (α × β)).image prod.fst,
738738
assume a, let ⟨b⟩ := ‹nonempty β› in by simp; exact ⟨b, fintype.complete _⟩⟩
739739

740740
/-- Given that `α × β` is a fintype, `β` is also a fintype. -/
741-
def fintype.fintype_prod_right {α β} [decidable_eq β] [fintype (α × β)] [nonempty α] : fintype β :=
741+
def fintype.prod_right {α β} [decidable_eq β] [fintype (α × β)] [nonempty α] : fintype β :=
742742
⟨(fintype.elems (α × β)).image prod.snd,
743743
assume b, let ⟨a⟩ := ‹nonempty α› in by simp; exact ⟨a, fintype.complete _⟩⟩
744744

@@ -763,6 +763,16 @@ instance (α : Type u) (β : Type v) [fintype α] [fintype β] : fintype (α ⊕
763763
((equiv.sum_equiv_sigma_bool _ _).symm.trans
764764
(equiv.sum_congr equiv.ulift equiv.ulift))
765765

766+
/-- Given that `α ⊕ β` is a fintype, `α` is also a fintype. This is non-computable as it uses
767+
that `sum.inl` is an injection, but there's no clear inverse if `α` is empty. -/
768+
noncomputable def fintype.sum_left {α β} [fintype (α ⊕ β)] : fintype α :=
769+
fintype.of_injective (sum.inl : α → α ⊕ β) sum.inl_injective
770+
771+
/-- Given that `α ⊕ β` is a fintype, `β` is also a fintype. This is non-computable as it uses
772+
that `sum.inr` is an injection, but there's no clear inverse if `β` is empty. -/
773+
noncomputable def fintype.sum_right {α β} [fintype (α ⊕ β)] : fintype β :=
774+
fintype.of_injective (sum.inr : β → α ⊕ β) sum.inr_injective
775+
766776
namespace fintype
767777
variables [fintype α] [fintype β]
768778

src/group_theory/order_of_element.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,9 +736,9 @@ begin
736736
have ft_prod : fintype (quotient (gpowers x) × (gpowers x)),
737737
from fintype.of_equiv G group_equiv_quotient_times_subgroup,
738738
have ft_s : fintype (gpowers x),
739-
from @fintype.fintype_prod_right _ _ _ ft_prod _,
739+
from @fintype.prod_right _ _ _ ft_prod _,
740740
have ft_cosets : fintype (quotient (gpowers x)),
741-
from @fintype.fintype_prod_left _ _ _ ft_prod ⟨⟨1, (gpowers x).one_mem⟩⟩,
741+
from @fintype.prod_left _ _ _ ft_prod ⟨⟨1, (gpowers x).one_mem⟩⟩,
742742
have eq₁ : fintype.card G = @fintype.card _ ft_cosets * @fintype.card _ ft_s,
743743
from calc fintype.card G = @fintype.card _ ft_prod :
744744
@fintype.card_congr _ _ _ ft_prod group_equiv_quotient_times_subgroup

0 commit comments

Comments
 (0)