Download lean/OAI/Probability/FirstPassage/ContourCounts.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 819 Bytes
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Probability/FirstPassage/ContourCounts.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/Probability/FirstPassage/ContourCounts.lean
-
curl -L -o ContourCounts.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Probability/FirstPassage/ContourCounts.lean
819 Bytes
| import OAI.Probability.FirstPassage.Paths | |
| import Mathlib.Data.List.Count | |
| namespace OAI | |
| namespace PlanarFPP | |
| theorem displacement_counts (ds : List Step) : | |
| (displacement ds).1=(ds.count Step.east : ℤ)-ds.count Step.west ∧ | |
| (displacement ds).2=(ds.count Step.north : ℤ)-ds.count Step.south ∧ | |
| ds.length=ds.count Step.east+ds.count Step.west+ds.count Step.north+ds.count Step.south := by | |
| induction ds with | |
| | nil => simp | |
| | cons d ds ih => | |
| cases d <;> simp_all [displacement_cons,Step.delta] <;> omega | |
| theorem closed_walk_up_left_count (ds : List Step) (h : displacement ds=0) : | |
| ds.length=2*(ds.count Step.north+ds.count Step.west) := by | |
| obtain ⟨hx,hy,hl⟩ := displacement_counts ds | |
| rw [h] at hx hy | |
| simp only [Prod.fst_zero,Prod.snd_zero] at hx hy | |
| omega | |
| end PlanarFPP | |
| end OAI | |