Download lean/OAI/Probability/BinarySweep/FiniteLaws/BitBlocks.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 901 Bytes
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Probability/BinarySweep/FiniteLaws/BitBlocks.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/Probability/BinarySweep/FiniteLaws/BitBlocks.lean
-
curl -L -o BitBlocks.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Probability/BinarySweep/FiniteLaws/BitBlocks.lean
901 Bytes
| import Mathlib | |
| namespace OAI | |
| noncomputable section | |
| open scoped BigOperators Classical | |
| namespace BinaryCoordinateSweeps | |
| lemma exists_bit_blocks (r : ℕ) (hr : 0<r) : ∀d : ℕ, r≤d → | |
| ∃b : ℕ, 1≤b ∧ ∃bits : Fin b → ℕ, | |
| (∀j,r≤bits j ∧ bits j≤2*r) ∧ ∑j,bits j=d := by | |
| intro d | |
| induction d using Nat.strong_induction_on with | |
| | h d ih => | |
| intro hd | |
| by_cases hsmall : d≤2*r | |
| · refine ⟨1,by omega,fun _ => d,fun _ => ⟨hd,hsmall⟩,?_⟩ | |
| simp | |
| obtain ⟨b,hb,bits,hbits,hsum⟩ := ih (d-r) (by omega) (by omega) | |
| refine ⟨b+1,by omega,Fin.cons r bits,?_,?_⟩ | |
| · intro j | |
| refine Fin.cases ?_ (fun i => ?_) j | |
| · simp only [Fin.cons_zero]; omega | |
| · simpa using hbits i | |
| · rw [Fin.sum_univ_succ] | |
| simp only [Fin.cons_zero,Fin.cons_succ,hsum,Nat.add_sub_of_le hd] | |
| end BinaryCoordinateSweeps | |
| end | |
| end OAI | |