Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
leanprover-community-mathlib4-bot committed Nov 4, 2024
2 parents 7ae666d + dbc6f5d commit a1f2d07
Show file tree
Hide file tree
Showing 1,162 changed files with 22,450 additions and 12,508 deletions.
4 changes: 2 additions & 2 deletions .github/build.in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ jobs:
- name: build everything
# make sure everything is available for test/import_all.lean
run: |
lake build Batteries Qq Aesop ProofWidgets
lake build Batteries Qq Aesop ProofWidgets Plausible
- name: test mathlib
id: test
Expand Down Expand Up @@ -287,7 +287,7 @@ jobs:
BUILD_OUTCOME: ${{ steps.build.outcome }}
NOISY_OUTCOME: ${{ steps.noisy.outcome }}
ARCHIVE_OUTCOME: ${{ steps.archive.outcome }}
COUNTEREXAMPLE_OUTCOME: ${{ steps.counterexamples.outcome }}
COUNTEREXAMPLES_OUTCOME: ${{ steps.counterexamples.outcome }}
LINT_OUTCOME: ${{ steps.lint.outcome }}
TEST_OUTCOME: ${{ steps.test.outcome }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ jobs:
- name: build everything
# make sure everything is available for test/import_all.lean
run: |
lake build Batteries Qq Aesop ProofWidgets
lake build Batteries Qq Aesop ProofWidgets Plausible
- name: test mathlib
id: test
Expand Down Expand Up @@ -297,7 +297,7 @@ jobs:
BUILD_OUTCOME: ${{ steps.build.outcome }}
NOISY_OUTCOME: ${{ steps.noisy.outcome }}
ARCHIVE_OUTCOME: ${{ steps.archive.outcome }}
COUNTEREXAMPLE_OUTCOME: ${{ steps.counterexamples.outcome }}
COUNTEREXAMPLES_OUTCOME: ${{ steps.counterexamples.outcome }}
LINT_OUTCOME: ${{ steps.lint.outcome }}
TEST_OUTCOME: ${{ steps.test.outcome }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ jobs:
- name: build everything
# make sure everything is available for test/import_all.lean
run: |
lake build Batteries Qq Aesop ProofWidgets
lake build Batteries Qq Aesop ProofWidgets Plausible
- name: test mathlib
id: test
Expand Down Expand Up @@ -304,7 +304,7 @@ jobs:
BUILD_OUTCOME: ${{ steps.build.outcome }}
NOISY_OUTCOME: ${{ steps.noisy.outcome }}
ARCHIVE_OUTCOME: ${{ steps.archive.outcome }}
COUNTEREXAMPLE_OUTCOME: ${{ steps.counterexamples.outcome }}
COUNTEREXAMPLES_OUTCOME: ${{ steps.counterexamples.outcome }}
LINT_OUTCOME: ${{ steps.lint.outcome }}
TEST_OUTCOME: ${{ steps.test.outcome }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_fork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ jobs:
- name: build everything
# make sure everything is available for test/import_all.lean
run: |
lake build Batteries Qq Aesop ProofWidgets
lake build Batteries Qq Aesop ProofWidgets Plausible
- name: test mathlib
id: test
Expand Down Expand Up @@ -301,7 +301,7 @@ jobs:
BUILD_OUTCOME: ${{ steps.build.outcome }}
NOISY_OUTCOME: ${{ steps.noisy.outcome }}
ARCHIVE_OUTCOME: ${{ steps.archive.outcome }}
COUNTEREXAMPLE_OUTCOME: ${{ steps.counterexamples.outcome }}
COUNTEREXAMPLES_OUTCOME: ${{ steps.counterexamples.outcome }}
LINT_OUTCOME: ${{ steps.lint.outcome }}
TEST_OUTCOME: ${{ steps.test.outcome }}
run: |
Expand Down
109 changes: 109 additions & 0 deletions .github/workflows/discover-lean-pr-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Discover `lean-pr-testing` branches

on:
push:
branches:
- nightly-testing
paths:
- lean-toolchain

jobs:
discover-lean-pr-testing:
runs-on: ubuntu-latest

steps:
- name: Checkout mathlib repository
uses: actions/checkout@v4
with:
repository: leanprover-community/mathlib
ref: nightly-testing
fetch-depth: 0 # Fetch all branches

- name: Set up Git
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
- name: Read date from lean-toolchain
id: fetch-date
run: |
TODAY=$(grep -oP 'nightly-\K\d{4}-\d{2}-\d{2}' lean-toolchain)
echo "TODAY=$TODAY" >> "$GITHUB_ENV"
- name: Set YESTERDAY
id: set-yesterday
run: |
YESTERDAY=$(date -d "$TODAY -1 day" +%Y-%m-%d)
echo "YESTERDAY=$YESTERDAY" >> "$GITHUB_ENV"
- name: Clone lean4-nightly repository and get PRs
id: get-prs
run: |
NIGHTLY_URL="https://github.com/leanprover/lean4-nightly.git"
# Create a temporary directory for cloning
cd "$(mktemp -d)" || exit 1
# Clone the repository with a depth of 30 (adjust as needed)
git clone --depth 30 "$NIGHTLY_URL"
# Navigate to the cloned repository
cd lean4-nightly || exit 1
YESTERDAY="${{ steps.set-yesterday.outputs.yesterday }}"
TODAY="${{ steps.fetch-date.outputs.today }}"
PRS=$(git log --oneline "nightly-$YESTERDAY..nightly-$TODAY" | sed 's/.*(#\([0-9]\+\))$/\1/')
# Output the PRs
echo "$PRS"
echo "prs=$PRS" >> "$GITHUB_OUTPUT"
- name: Use merged PRs information
id: find-branches
run: |
# Use the PRs from the previous step
PRS="${{ steps.get-prs.outputs.prs }}"
echo "$PRS" | tr ' ' '\n' > prs.txt
MATCHING_BRANCHES=$(git branch -r | grep -f prs.txt)
# Initialize an empty variable to store branches with relevant diffs
RELEVANT_BRANCHES=""
# Loop through each matching branch
for BRANCH in $MATCHING_BRANCHES; do
# Get the diff filenames
DIFF_FILES=$(git diff --name-only "origin/nightly-testing...$BRANCH")
# Check if the diff contains files other than the specified ones
if echo "$DIFF_FILES" | grep -v -e 'lake-manifest.json' -e 'lakefile.lean' -e 'lean-toolchain'; then
# If it does, add the branch to RELEVANT_BRANCHES
RELEVANT_BRANCHES="$RELEVANT_BRANCHES $BRANCH"
fi
done
# Output the relevant branches
echo "'$RELEVANT_BRANCHES'"
echo "branches=$RELEVANT_BRANCHES" >> "$GITHUB_OUTPUT"
- name: Check if there are relevant branches
id: check-branches
run: |
if [ -z "${{ steps.find-branches.outputs.branches }}" ]; then
echo "no_branches=true" >> "$GITHUB_ENV"
else
echo "no_branches=false" >> "$GITHUB_ENV"
fi
- name: Send message on Zulip
if: env.no_branches == 'false'
uses: zulip/github-actions-zulip/send-message@v1
with:
api-key: ${{ secrets.ZULIP_API_KEY }}
email: '[email protected]'
organization-url: 'https://leanprover.zulipchat.com'
to: 'nightly-testing'
type: 'stream'
topic: 'Mathlib status updates'
content: |
We will need to merge the following branches into `nightly-testing`:
${{ steps.find-branches.outputs.branches }}
2 changes: 1 addition & 1 deletion Archive/Imo/Imo2011Q5.lean
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Authors: Alain Verberkmoes
-/
import Mathlib.Algebra.Order.Group.Int
import Mathlib.Algebra.Ring.Divisibility.Basic
import Mathlib.Algebra.Ring.Int
import Mathlib.Algebra.Ring.Int.Defs

/-!
# IMO 2011 Q5
Expand Down
9 changes: 3 additions & 6 deletions Archive/Wiedijk100Theorems/BirthdayProblem.lean
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,9 @@ theorem birthday_measure :
· rw [Fintype.card_embedding_eq, Fintype.card_fin, Fintype.card_fin]
rfl
rw [this, ENNReal.lt_div_iff_mul_lt, mul_comm, mul_div, ENNReal.div_lt_iff]
rotate_left
iterate 2 right; norm_num
· decide
iterate 2 left; norm_num
simp only [Fintype.card_pi]
norm_num
all_goals
simp only [Fintype.card_pi, Fintype.card_fin, Finset.prod_const, Finset.card_univ]
norm_num

end MeasureTheory

Expand Down
2 changes: 1 addition & 1 deletion Archive/Wiedijk100Theorems/BuffonsNeedle.lean
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ include hd hB hBₘ in
lemma buffon_integral :
𝔼[N l B] = (d * π) ⁻¹ *
∫ (θ : ℝ) in Set.Icc 0 π,
∫ (x : ℝ) in Set.Icc (-d / 2) (d / 2) ∩ Set.Icc (-θ.sin * l / 2) (θ.sin * l / 2), 1 := by
∫ (_ : ℝ) in Set.Icc (-d / 2) (d / 2) ∩ Set.Icc (-θ.sin * l / 2) (θ.sin * l / 2), 1 := by
simp_rw [N, Function.comp_apply]
rw [
← MeasureTheory.integral_map hBₘ.aemeasurable
Expand Down
5 changes: 3 additions & 2 deletions Cache/IO.lean
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def CURLBIN :=

/-- leantar version at https://github.com/digama0/leangz -/
def LEANTARVERSION :=
"0.1.13"
"0.1.14"

def EXE := if System.Platform.isWindows then ".exe" else ""

Expand Down Expand Up @@ -138,7 +138,8 @@ private def CacheM.getContext : IO CacheM.Context := do
("ProofWidgets", LAKEPACKAGESDIR / "proofwidgets"),
("Qq", LAKEPACKAGESDIR / "Qq"),
("ImportGraph", LAKEPACKAGESDIR / "importGraph"),
("LeanSearchClient", LAKEPACKAGESDIR / "LeanSearchClient")
("LeanSearchClient", LAKEPACKAGESDIR / "LeanSearchClient"),
("Plausible", LAKEPACKAGESDIR / "plausible")
]⟩

def CacheM.run (f : CacheM α) : IO α := do ReaderT.run f (← getContext)
Expand Down
5 changes: 2 additions & 3 deletions LongestPole/Main.lean
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@ open System in
def countLOC (modules : List Name) : IO (NameMap Float) := do
let mut r := {}
for m in modules do
let fp := FilePath.mk ((← findOLean m).toString.replace ".lake/build/lib/" "")
|>.withExtension "lean"
if ← fp.pathExists then
if let .some fp ← Lean.SearchPath.findModuleWithExt [s!".{FilePath.pathSeparator}"] "lean" m
then
let src ← IO.FS.readFile fp
r := r.insert m (src.toList.count '\n').toFloat
return r
Expand Down
Loading

0 comments on commit a1f2d07

Please sign in to comment.