Skip to content

chore: remove bit0 and bit1#14644

Closed
jcommelin wants to merge 26 commits intomasterfrom
jmc-rm-bit01
Closed

chore: remove bit0 and bit1#14644
jcommelin wants to merge 26 commits intomasterfrom
jmc-rm-bit01

Conversation

@jcommelin
Copy link
Copy Markdown
Member

@jcommelin jcommelin commented Jul 11, 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

Open in Gitpod

@jcommelin jcommelin changed the title chore: remove bit0 and bit1` chore: remove bit0 and bit1 Jul 11, 2024
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 11, 2024

PR summary bf9280f5f2

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>

@jcommelin jcommelin marked this pull request as ready for review July 11, 2024 13:18
@@ -467,20 +467,20 @@ theorem pointReflection_involutive (x : P) : Involutive (pointReflection x : P
set_option linter.deprecated false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm guessing all of those can go now

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I would like to keep this diff as small as possible. And I also think that many of these lemmas can be removed or renamed in a second pass.

@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 12, 2024
@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 12, 2024
@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 13, 2024
@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 13, 2024
@grunweg grunweg added the tech debt Tracking cross-cutting technical debt, see e.g. the "Technical debt counters" stream on zulip label Jul 13, 2024
@jcommelin
Copy link
Copy Markdown
Member Author

Closing, as #14745 is the version that shall be merged.

@jcommelin jcommelin closed this Jul 15, 2024
@YaelDillies YaelDillies deleted the jmc-rm-bit01 branch August 15, 2025 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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