Skip to content

[Merged by Bors] - feat(Mathlib/Data/Fintype/Quotient): Trunc version of Quotient.finChoice#13025

Closed
Komyyy wants to merge 3 commits intomasterfrom
Komyyy/Trunc.finChoice
Closed

[Merged by Bors] - feat(Mathlib/Data/Fintype/Quotient): Trunc version of Quotient.finChoice#13025
Komyyy wants to merge 3 commits intomasterfrom
Komyyy/Trunc.finChoice

Conversation

@Komyyy
Copy link
Copy Markdown
Contributor

@Komyyy Komyyy commented May 19, 2024


Open in Gitpod

@Komyyy Komyyy added awaiting-review awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. labels May 19, 2024
@github-actions github-actions bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label May 19, 2024
@Komyyy Komyyy requested a review from digama0 May 19, 2024 06:51
@Komyyy Komyyy changed the title feat: Trunc version of Quotient.finChoice feat(Mathlib/Data/Fintype/Quotient): Trunc version of Quotient.finChoice May 19, 2024
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@Komyyy Komyyy added the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label May 26, 2024
Copy link
Copy Markdown
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors d+

Suggestion is optional

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented May 26, 2024

✌️ Komyyy can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@ghost ghost added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-review labels May 26, 2024
@github-actions github-actions bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label May 26, 2024
@Komyyy
Copy link
Copy Markdown
Contributor Author

Komyyy commented May 26, 2024

bors r+

mathlib-bors bot pushed a commit that referenced this pull request May 26, 2024
…Choice` (#13025)

Co-authored-by: Pol'tta / Miyahara Kō <52843868+Komyyy@users.noreply.github.com>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented May 26, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(Mathlib/Data/Fintype/Quotient): Trunc version of Quotient.finChoice [Merged by Bors] - feat(Mathlib/Data/Fintype/Quotient): Trunc version of Quotient.finChoice May 26, 2024
@mathlib-bors mathlib-bors bot closed this May 26, 2024
@mathlib-bors mathlib-bors bot deleted the Komyyy/Trunc.finChoice branch May 26, 2024 11:25
callesonne pushed a commit that referenced this pull request Jun 4, 2024
…Choice` (#13025)

Co-authored-by: Pol'tta / Miyahara Kō <52843868+Komyyy@users.noreply.github.com>
js2357 pushed a commit that referenced this pull request Jun 18, 2024
…Choice` (#13025)

Co-authored-by: Pol'tta / Miyahara Kō <52843868+Komyyy@users.noreply.github.com>
mathlib-bors bot pushed a commit that referenced this pull request Jul 14, 2024
…rom some `DFinsupp` functions (#13235)

This PR removes `Decidable` instances from these `DFinsupp` functions:
1.
```lean
def DFinsupp.sigmaUncurry
    {ι : Type u} {α : ι → Type u_2} {δ : (i : ι) → α i → Type v} [(i : ι) → (j : α i) → Zero (δ i j)]
    [(i : ι) → DecidableEq (α i)] [(i : ι) → (j : α i) → Decidable (x ≠ 0)]
    (f : Π₀ (i : ι) (j : α i), δ i j) : Π₀ (i : (i : ι) × α i), δ i.fst i.snd

def DFinsupp.sigmaCurryEquiv
    {ι : Type u} [DecidableEq ι] {α : ι → Type u_2} {δ : (i : ι) → α i → Type v} [(i : ι) → (j : α i) → Zero (δ i j)]
    [(i : ι) → DecidableEq (α i)] [(i : ι) → (j : α i) → Decidable (x ≠ 0)] :
  Π₀ (i : (i : ι) × α i), δ i.fst i.snd ≃ Π₀ (i : ι) (j : α i), δ i j
```
to
```lean
def DFinsupp.sigmaUncurry
    {ι : Type u} {α : ι → Type u_2} {δ : (i : ι) → α i → Type v} [(i : ι) → (j : α i) → Zero (δ i j)] [DecidableEq ι]
    (f : Π₀ (i : ι) (j : α i), δ i j) : Π₀ (i : (i : ι) × α i), δ i.fst i.snd

def DFinsupp.sigmaCurryEquiv
    {ι : Type u} {α : ι → Type u_2} {δ : (i : ι) → α i → Type v} [(i : ι) → (j : α i) → Zero (δ i j)] [DecidableEq ι] :
  Π₀ (i : (i : ι) × α i), δ i.fst i.snd ≃ Π₀ (i : ι) (j : α i), δ i j
```

We use `Trunc.finChoice` from #13025 to compute support with the only `DecidableEq ι` instance.

2.
```lean
instance DFinsupp.decidableZero
    {ι : Type u} {β : ι → Type v} [DecidableEq ι] [(i : ι) → Zero (β i)] [(i : ι) → (x : β i) → Decidable (x ≠ 0)] (f : Π₀ (i : ι), β i) :
  Decidable (0 = f)
```
to
```lean
instance DFinsupp.decidableZero
    {ι : Type u} {β : ι → Type v} [(i : ι) → Zero (β i)] [(i : ι) → (x : β i) → Decidable (x = 0)] (f : Π₀ (i : ι), β i) :
  Decidable (f = 0)
```

We remove the redundant `DecidableEq ι` instance. Additionally, We replace the `(i : ι) → (x : β i) → Decidable (x ≠ 0)` instance with `(i : ι) → (x : β i) → Decidable (x = 0)` because it's more principal, and swaps `f` and `0`.

3.
```lean
noncomputable def DFinsupp.comapDomain
    {ι : Type u} {β : ι → Type v} [DecidableEq ι] {κ : Type u_1} [(i : ι) → Zero (β i)] (h : κ → ι) (hh : Function.Injective h) (f : Π₀ (i : ι), β i) :
  Π₀ (k : κ), β (h k)
```
to
```lean
noncomputable def DFinsupp.comapDomain
    {ι : Type u} {β : ι → Type v} {κ : Type u_1} [(i : ι) → Zero (β i)] (h : κ → ι) (hh : Function.Injective h) (f : Π₀ (i : ι), β i) :
  Π₀ (k : κ), β (h k)
```

`DecidableEq ι` is required to compute unconstructive support so this is redundant.



Co-authored-by: Pol'tta / Miyahara Kō <52843868+Komyyy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants