batteries icon indicating copy to clipboard operation
batteries copied to clipboard

feat: de-mathlib `Nat.binaryRec`

Open FR-vdash-bot opened this issue 1 year ago • 7 comments

Some of the definitions have been modified to be faster.

  • [x] depends on: #464
  • [x] depends on: #465

FR-vdash-bot avatar Oct 22 '23 14:10 FR-vdash-bot

awaiting-review

FR-vdash-bot avatar Nov 15 '23 12:11 FR-vdash-bot

What's the status of this PR in respect to #366? In that PR we got:

/--
An induction principal that works on divison by two.
-/
noncomputable def div2Induction {motive : Nat → Sort u}
    (n : Nat) (ind : ∀(n : Nat), (n > 0 → motive (n/2)) → motive n) : motive n := by
  induction n using Nat.strongInductionOn with
  | ind n hyp =>
    apply ind
    intro n_pos
    if n_eq : n = 0 then
      simp [n_eq] at n_pos
    else
      apply hyp
      exact Nat.div_lt_self n_pos (Nat.le_refl _)

but these don't seem directly related.

eric-wieser avatar Nov 29 '23 12:11 eric-wieser

I'm not sure where these diffs are. It might just be some mess from the merge.

FR-vdash-bot avatar Dec 16 '23 08:12 FR-vdash-bot

What's the status of this PR in respect to #366? In that PR we got:

/--
An induction principal that works on divison by two.
-/
noncomputable def div2Induction {motive : Nat → Sort u}
    (n : Nat) (ind : ∀(n : Nat), (n > 0 → motive (n/2)) → motive n) : motive n := by
  induction n using Nat.strongInductionOn with
  | ind n hyp =>
    apply ind
    intro n_pos
    if n_eq : n = 0 then
      simp [n_eq] at n_pos
    else
      apply hyp
      exact Nat.div_lt_self n_pos (Nat.le_refl _)

but these don't seem directly related.

I replaced it with binaryRecs and did some golf.

FR-vdash-bot avatar Dec 16 '23 08:12 FR-vdash-bot

Strange. Please ignore my comments then.

fgdorais avatar Dec 16 '23 08:12 fgdorais

It seems that Std.Data.Nat.Bitwise is not there now. What should I do now? Should I create a PR for core?

FR-vdash-bot avatar Mar 23 '24 05:03 FR-vdash-bot

Marking as duplicate while waiting for lean4#3756. Ask to remove that label if that PR doesn't get merged.

fgdorais avatar Jul 23 '24 12:07 fgdorais

Replaced by #799.

FR-vdash-bot avatar Aug 06 '24 17:08 FR-vdash-bot