Skip to content

[Merged by Bors] - chore: remove bit0/bit1 and associated lemmas#14745

Closed
jcommelin wants to merge 25 commits intomasterfrom
jmc-rm-bit01-total
Closed

[Merged by Bors] - chore: remove bit0/bit1 and associated lemmas#14745
jcommelin wants to merge 25 commits intomasterfrom
jmc-rm-bit01-total

Conversation

@jcommelin
Copy link
Copy Markdown
Member

@jcommelin jcommelin commented Jul 15, 2024

This PR replaces bit0 x resp. bit1 x with:

  • 2 * x resp. 2 * x + 1 if possible, or
  • 2 • x resp. 2 • x + 1 if possible, or
  • x + x resp. x + x + 1 as fallback.

The versions Num.bit0 and Num.bit1 (as well as the PosNum and ZNum versions) are left alone.
All lemmas that mention bit0/bit1 have been adapted. A follow-up PR can remove these lemmas.

Deletions:

  • bit0
  • bit1

This PR combines #14644 and #14744. It might be easier to review those separately.
But I think that this current PR is the one that should be merged in the end.

Open in Gitpod

@jcommelin jcommelin added the tech debt Tracking cross-cutting technical debt, see e.g. the "Technical debt counters" stream on zulip label Jul 15, 2024
@mergify
Copy link
Copy Markdown

mergify bot commented Jul 15, 2024

⚠️ The sha of the head commit of this PR conflicts with #14744. Mergify cannot evaluate rules on this PR. ⚠️

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 15, 2024

PR summary aa3889edc7

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Init.Data.Nat.Basic 39 7 -32 (-82.05%)
Mathlib.Init.Data.Nat.Lemmas 43 12 -31 (-72.09%)
Mathlib.Data.Num.Prime 544 543 -1 (-0.18%)
Import changes for all files
Files Import difference
Mathlib.Init.Data.Nat.Basic -32
Mathlib.Init.Data.Nat.Lemmas -31
Mathlib.Data.Num.Prime -1

Declarations diff

+-+- not_even_bit1
+-+- pointReflection_fixed_iff_of_injective_bit0
+-+--+ bit1_of_bit1
+--+-+- cast_bit0
+--+-+- cast_bit1
- bit0_apply_eq_zero
- bit0_comp
- bit0_div_bit0
- bit0_div_two
- bit0_eq_bit0
- bit0_eq_two_mul
- bit0_mod_bit0
- bit0_zero
- bit1
- bit1_apply_eq_one
- bit1_comp
- bit1_div_bit0
- bit1_div_two
- bit1_eq_bit1
- bit1_mod_bit0
- bit1_zero
- coeff_cos_bit0
- coeff_cos_bit1
- coeff_sin_bit0
- coeff_sin_bit1
- even_bit0
- fib_bit0
- fib_bit0_succ
- fib_bit1
- fib_bit1_succ
- odd_bit1
- one_eq_bit1
- pow_bit0_nonneg
- pow_bit0_pos
- pow_bit0_pos_iff
- pow_bit1_neg_iff
- pow_bit1_nonneg_iff
- pow_bit1_nonpos_iff
- pow_bit1_pos_iff
- strictMono_pow_bit1
- two_dvd_bit0
- two_dvd_bit1
- zero_eq_bit0
- zpow_bit0_abs
-+- bit0_ne_bit1
-+- bit0_ne_zero
-+- bit1_ne_bit0
-+- bit1_ne_zero
-+- zero_ne_bit0
-+-+-+ bit0_of_bit0
-- bit0
-- bit0_val
-- bit1_eq_one
-- bit1_val
-- bodd_bit0
-- bodd_bit1
--++ bit_to_nat
--+- bit0_eq_zero

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

@mergify
Copy link
Copy Markdown

mergify bot commented Jul 15, 2024

⚠️ The sha of the head commit of this PR conflicts with #14744. Mergify cannot evaluate rules on this PR. ⚠️

@mergify
Copy link
Copy Markdown

mergify bot commented Jul 15, 2024

⚠️ The sha of the head commit of this PR conflicts with #14744. Mergify cannot evaluate rules on this PR. ⚠️

@riccardobrasca
Copy link
Copy Markdown
Member

LGTM thanks! (I don't understand the mergify error).

bors d+

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jul 15, 2024

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

@github-actions github-actions bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Jul 15, 2024
@jcommelin
Copy link
Copy Markdown
Member Author

bors r+

@github-actions github-actions bot added the ready-to-merge This PR has been sent to bors. label Jul 15, 2024
mathlib-bors bot pushed a commit that referenced this pull request Jul 15, 2024
This PR replaces `bit0 x` resp. `bit1 x` with:
- `2 * x` resp. `2 * x + 1` if possible, or
- `2 • x` resp. `2 • x + 1` if possible, or
- `x + x` resp. `x + x + 1` as fallback.

The versions `Num.bit0` and `Num.bit1` (as well as the `PosNum` and `ZNum` versions) are left alone.
All lemmas that mention `bit0`/`bit1` have been adapted. A follow-up PR can remove these lemmas.

Deletions:
- bit0
- bit1



Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jul 15, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore: remove bit0/bit1 and associated lemmas [Merged by Bors] - chore: remove bit0/bit1 and associated lemmas Jul 15, 2024
@mathlib-bors mathlib-bors bot closed this Jul 15, 2024
@mathlib-bors mathlib-bors bot deleted the jmc-rm-bit01-total branch July 15, 2024 12:18
@adomani adomani mentioned this pull request Aug 1, 2024
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). ready-to-merge This PR has been sent to bors. tech debt Tracking cross-cutting technical debt, see e.g. the "Technical debt counters" stream on zulip

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants